Skip to content

Commit

Permalink
use a workflow step instead of node script to commit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
echo-bravo-yahoo committed Oct 22, 2024
1 parent ded968f commit 925990b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jobs:
build:
runs-on: ubuntu-latest

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write

steps:
- uses: actions/checkout@v4
- name: Use Node.js (22.x)
Expand All @@ -21,6 +26,10 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm run bump
# Commit changes to package.json back to the repository
- uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: 'package.json'
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
3 changes: 0 additions & 3 deletions scripts/version-bump.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,3 @@ if (scope === 'patch' || ['fix', 'chore', 'docs', 'refactor', 'perf', 'test', 'b
}

execSync(`npm version ${flag}`);
execSync("git add package.json");
execSync("git commit --amend --no-edit");
execSync("git push --force");

0 comments on commit 925990b

Please sign in to comment.