66 # If pull request was merged then we should check for a package version update
77 check-version-update :
88 runs-on : ubuntu-22.04
9+ outputs :
10+ should-bump : ${{ steps.version-check.outputs.should-bump }}
911 steps :
1012 # Checkout to target branch
11- - uses : actions/checkout@v2
13+ - uses : actions/checkout@v5
1214 with :
1315 fetch-depth : 0
1416
@@ -26,20 +28,29 @@ jobs:
2628 id : packageOld
2729 uses : codex-team/action-nodejs-package-info@v1
2830
29- # Stop workflow and do not bump version if it was changed already
30- - name : Stop workflow and do not bump version if it was changed already
31- uses : andymckay/cancel-action@0.2
32- if : steps.packageOld.outputs.version != steps.packageNew.outputs.version
31+ # Check if version should be bumped
32+ - name : Check if version should be bumped
33+ id : version-check
34+ run : |
35+ if [ "${{ steps.packageOld.outputs.version }}" == "${{ steps.packageNew.outputs.version }}" ]; then
36+ echo "should-bump=true" >> $GITHUB_OUTPUT
37+ else
38+ echo "should-bump=false" >> $GITHUB_OUTPUT
39+ fi
3340
3441 bump-version :
3542 needs : check-version-update
43+ if : needs.check-version-update.outputs.should-bump == 'true'
3644 runs-on : ubuntu-22.04
3745 steps :
3846 # Checkout to target branch
39- - uses : actions/checkout@v2
47+ - uses : actions/checkout@v5
48+ with :
49+ repository : ${{ github.event.pull_request.head.repo.full_name }}
50+ ref : ${{ github.event.pull_request.head.ref }}
4051
4152 # Setup node environment
42- - uses : actions/setup-node@v3
53+ - uses : actions/setup-node@v5
4354 with :
4455 node-version-file : ' .nvmrc'
4556 registry-url : https://registry.npmjs.org/
5465 uses : codex-team/action-nodejs-package-info@v1
5566
5667 # Commit version upgrade
57- - uses : EndBug/add-and-commit@v7
68+ - uses : EndBug/add-and-commit@v9
5869 with :
5970 author_name : github-actions
6071 author_email : 41898282+github-actions[bot]@users.noreply.github.com
0 commit comments