Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leonid-shutov committed Aug 21, 2024
1 parent dbc7b15 commit 2ee3ad6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/commit.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#!/usr/bin/env zx

const getOutput = ({ stdout }) => stdout;

await $`git config --local user.email "[email protected]"`;
await $`git config --local user.name "leonid-shutov"`;
await $`git add .`;

// workaround not to have extra symbols in commands with dashes
const getWorkingTreeStatus = () => $`git status --porcelain`.then(getOutput);

if (!(await getWorkingTreeStatus())) {
echo("Nothing to commit");
process.exit(0);
}

await $`git commit -m "UPDATE README"`;

await $`git push`;
3 changes: 1 addition & 2 deletions .github/workflows/update-readme.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ $.verbose = false;
await $`cat init.vim >> README.md`;
const end = "```";
await $`echo ${end} >> README.md`;
const commitMessage = "UPDATE README";
await $`npx zx .github/commit.mjs --message "${commitMessage}"`;
await $`npx zx .github/commit.mjs`;
})();

0 comments on commit 2ee3ad6

Please sign in to comment.