Skip to content

Commit

Permalink
✨ Only commit if there are any changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Jul 5, 2022
1 parent 2364d60 commit 341bc09
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ export const run = async () => {
execSync(`git config --global user.email "${commitEmail}"`, { stdio: "inherit" });
execSync(`git config --global user.name "${commitUsername}"`, { stdio: "inherit" });
execSync("git pull", { stdio: "inherit" });
execSync("git add .", { stdio: "inherit" });
execSync(`git commit -m "${commitMessage}"`, { stdio: "inherit" });
execSync(`git diff --quiet && git diff --staged --quiet || git commit -am "${commitMessage}"`, { stdio: "inherit" });
execSync("git push", { stdio: "inherit" });
} catch (error) {
console.error(String(error));
Expand Down

0 comments on commit 341bc09

Please sign in to comment.