Skip to content

Commit eff29ba

Browse files
author
Justin Vogt
committed
Refactor GitHub Actions to use action-update-file for version updates in package.json
1 parent 0aac668 commit eff29ba

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ jobs:
3838
run: npm run build
3939

4040
- name: Commit version update
41-
run: |
42-
git config --local user.email "action@github.com"
43-
git config --local user.name "GitHub Action"
44-
git add package.json package-lock.json
45-
if git diff --staged --quiet; then
46-
echo "No changes to commit"
47-
else
48-
git commit -m "chore: update package.json version to ${{ steps.version.outputs.VERSION }}"
49-
git push
50-
fi
41+
uses: test-room-7/action-update-file@v1
42+
with:
43+
file-path: |
44+
package.json
45+
package-lock.json
46+
commit-msg: "chore: update package.json version to ${{ steps.version.outputs.VERSION }}"
47+
github-token: ${{ secrets.GITHUB_TOKEN }}
5148

5249
- name: Publish to npm
5350
run: npm publish

0 commit comments

Comments
 (0)