Skip to content

Commit 8e2f20e

Browse files
committed
fix: prevent npm version from creating git tags automatically
1 parent fc8511e commit 8e2f20e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161
"test": "node --test test/*.test.js",
6262
"prepublishOnly": "npm run build",
6363
"release": "node scripts/release.js",
64-
"release:patch": "npm version patch && npm run release",
65-
"release:minor": "npm version minor && npm run release",
66-
"release:major": "npm version major && npm run release"
64+
"release:patch": "npm version patch --no-git-tag-version && npm run release",
65+
"release:minor": "npm version minor --no-git-tag-version && npm run release",
66+
"release:major": "npm version major --no-git-tag-version && npm run release"
6767
},
6868
"peerDependencies": {
6969
"husky": "^9.0.0"

scripts/release.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@ async function createRelease() {
5050
console.log('\n📦 Building and testing...');
5151
run('npm run build');
5252
run('npm test');
53-
54-
// 2. Create git tag
53+
54+
// 2. Commit version changes and create git tag
55+
console.log('\n📝 Committing version changes...');
56+
run('git add package.json package-lock.json');
57+
run(`git commit -m "${currentVersion}"`);
58+
5559
console.log('\n🏷️ Creating git tag...');
5660
run(`git tag -a v${currentVersion} -m "Release v${currentVersion}"`);
57-
61+
5862
// 3. Push to GitHub
5963
console.log('\n⬆️ Pushing to GitHub...');
6064
run('git push origin main');

0 commit comments

Comments
 (0)