Skip to content

Commit e1a2656

Browse files
committed
fix: do not increment versions in dist-tags
1 parent 66ccb67 commit e1a2656

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

analyzeCommits.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ const analyzeCommits = require('@semantic-release/commit-analyzer')
33
module.exports = function (pluginConfig, config, cb) {
44
// run standard commit analysis
55
return analyzeCommits(pluginConfig, config, function(error, type) {
6-
const branch = config.env.TRAVIS_BRANCH;
7-
const distTag = config.options.branchTags[branch];
6+
const branch = config.env.TRAVIS_BRANCH || config.env.GIT_BRANCH;
7+
const branchTags = config.options.branchTags;
8+
const distTag = branchTags && branchTags[branch];
89
let releaseType = type;
910

1011
// if branch publishes a dist-tag

getLastRelease.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const defaultLastRelease = require('@semantic-release/last-release-npm');
2+
3+
module.exports = function (pluginConfig, config, cb) {
4+
let branch;
5+
6+
if (config.env.TRAVIS) {
7+
branch = config.env.TRAVIS_BRANCH;
8+
} else {
9+
branch = config.env.GIT_BRANCH;
10+
}
11+
12+
const distTag = config.options.branchTags[branch];
13+
if (distTag) {
14+
// use 'latest' dist tag to determine what version will be published
15+
config.npm.tag = "latest";
16+
}
17+
18+
return defaultLastRelease(pluginConfig, config, cb);
19+
};
20+

0 commit comments

Comments
 (0)