File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -128,20 +128,32 @@ jobs:
128128 if : steps.perm.outputs.allowed == 'true'
129129 run : |
130130 pnpm run bump
131+
132+ - name : Retrieve new version
133+ id : ver
134+ uses : actions/github-script@v7
135+ with :
136+ script : |
137+ const fs = require('fs');
138+ const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
139+ core.setOutput('version', String(pkg.version));
140+
141+ - name : Commit changes
142+ if : steps.perm.outputs.allowed == 'true'
143+ run : |
131144 git add package.json
132- git commit -m "chore: bump version"
145+ git commit -m "chore: bump version to ${{ steps.ver.outputs.version }} "
133146 git push
134147
135148 - name : Add comment to PR
136149 if : steps.perm.outputs.allowed == 'true'
137150 uses : actions/github-script@v7
138151 with :
139152 script : |
140- const fs = require('fs');
141- const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
153+ const version = ${{ steps.ver.outputs.version }}
142154 github.rest.issues.createComment({
143155 issue_number: context.issue.number,
144156 owner: context.repo.owner,
145157 repo: context.repo.repo,
146- body: `✅ Version bumped to ${pkg. version}`
158+ body: `✅ Version bumped to ${version}`
147159 })
You can’t perform that action at this time.
0 commit comments