File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -21,25 +21,18 @@ jobs:
2121 node-version : ' 20.x'
2222 registry-url : ' https://registry.npmjs.org'
2323
24- # Extract the version from package.json
25- - name : Extract version from package.json
26- id : extract_version
24+ # Automatically bump the version
25+ - name : Bump version
2726 run : |
28- VERSION=$(node -p "require('./package.json').version")
29- echo "VERSION=$VERSION" >> $GITHUB_ENV
30-
31- # Update package.json with the extracted version
32- - name : Update package.json with version
33- run : |
34- echo "Updating package.json version to $VERSION"
35- npm version "$VERSION" --no-git-tag-version
27+ echo "Bumping version..."
28+ npm version patch --no-git-tag-version
3629
3730 - name : Commit and push version update
3831 run : |
3932 git config user.name "github-actions"
4033 git config user.email "github-actions@github.com"
4134 git add package.json package-lock.json
42- git commit -m "Update package.json to version $VERSION "
35+ git commit -m "Bump version to $(node -p "require('./package.json').version") "
4336 git push origin main
4437 env :
4538 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments