File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change 55 types : [created]
66
77permissions :
8- contents : read
8+ contents : write
99 id-token : write
1010
1111jobs :
@@ -22,14 +22,21 @@ jobs:
2222 registry-url : ' https://registry.npmjs.org'
2323 cache : ' npm'
2424
25- - name : Update package.json version from release tag
26- uses : cssnr/update-version-tags-action@v1.2.0 # Use the latest version of the action
27- with :
28- # Optional: Commit the changes back to the repository (defaults to true)
29- commit : false
30-
31- # Optional: Push the changes back to the repository (defaults to true)
32- push : false
25+ - name : Extract version from tag
26+ id : get_version
27+ run : |
28+ # Get the tag name (e.g., v1.0.1)
29+ TAG_NAME="${{ github.event.release.tag_name }}"
30+ # Remove 'v' prefix if present
31+ VERSION="${TAG_NAME#v}"
32+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
33+ echo "Extracted version: ${VERSION}"
34+
35+ - name : Update package.json version
36+ run : |
37+ VERSION="${{ steps.get_version.outputs.version }}"
38+ npm version ${VERSION} --no-git-tag-version
39+ echo "Updated package.json to version ${VERSION}"
3340
3441 # Ensure npm 11.5.1 or later is installed
3542 - name : Update npm
You can’t perform that action at this time.
0 commit comments