Skip to content

Commit 8bad2c4

Browse files
committed
ci: Set the correct version in package json before releasing
1 parent aa7f3db commit 8bad2c4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
github-token: ${{ secrets.github_token }}
4747
skip-on-empty: false
4848
skip-commit: true
49+
pre-changelog-generation: './update-package-json.js'
4950

5051
- name: GIT/NPM config
5152
run: |

update-package-json.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const fs = require('node:fs')
2+
3+
exports.preTagGeneration = (tag) => {
4+
const packageJson = require('./package.json')
5+
packageJson.version = tag
6+
7+
fs.writeFileSync('./package.json', packageJson)
8+
9+
return tag
10+
}

0 commit comments

Comments
 (0)