File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353 default : ' .'
5454
5555permissions :
56- contents : read
56+ contents : write
5757 id-token : write
5858
5959jobs :
@@ -93,11 +93,36 @@ jobs:
9393 shell : bash
9494 working-directory : ${{ inputs.build-working-directory }}
9595
96- - name : 🏷️ Set Version
96+ - name : 🔧 Configure Git
97+ if : ${{ inputs.tag == 'latest' }}
98+ run : |
99+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
100+ git config --global user.name "github-actions[bot]"
101+ shell : bash
102+
103+ - name : 🏷️ Bump Version, Commit & Tag
104+ if : ${{ inputs.tag == 'latest' }}
105+ id : bump-version
106+ run : |
107+ NEW_TAG=$(npm version ${{ inputs.version }} --tag-version-prefix="v" --message "v%s")
108+ echo "tag=$NEW_TAG" >> "$GITHUB_OUTPUT"
109+ shell : bash
110+ working-directory : ${{ inputs.package-directory }}
111+
112+ - name : 🏷️ Set Version (no commit)
113+ if : ${{ inputs.tag != 'latest' }}
97114 run : npm version --no-git-tag-version --allow-same-version ${{ inputs.version }}
98115 shell : bash
99116 working-directory : ${{ inputs.package-directory }}
100117
118+ - name : 🔄 Push Version Commit & Tag
119+ if : ${{ inputs.tag == 'latest' }}
120+ run : |
121+ git push origin HEAD:${{ github.ref_name }}
122+ git push origin ${{ steps.bump-version.outputs.tag }}
123+ shell : bash
124+ working-directory : ${{ inputs.package-directory }}
125+
101126 - name : 🚀 Publish to npm
102127 run : npm publish --tag ${{ inputs.tag }}
103128 shell : bash
Original file line number Diff line number Diff line change 2222 - major
2323
2424permissions :
25- contents : read
25+ contents : write
2626 id-token : write
2727
2828jobs :
Original file line number Diff line number Diff line change 1010 default : patch
1111
1212permissions :
13- contents : read
13+ contents : write
1414 id-token : write
1515
1616jobs :
You can’t perform that action at this time.
0 commit comments