-
-
Notifications
You must be signed in to change notification settings - Fork 216
Expand file tree
/
Copy pathtag.js
More file actions
20 lines (15 loc) · 548 Bytes
/
tag.js
File metadata and controls
20 lines (15 loc) · 548 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const packageJson = require('./package.json');
const { execSync } = require('child_process');
function tagRelease() {
const commitMessage = execSync('git log -1 --pretty=%B').toString()
if(!commitMessage.toLocaleLowerCase().startsWith('[release]')) {
console.log('Not a release commit, skipping tag update')
return
}
const version = packageJson.version;
const tag = `v${version}`;
const message = `Release ${tag}`;
const e = execSync(`git tag -f -a ${tag} -m "${message}"`);
console.log(e.toString());
}
tagRelease();