diff options
author | Jason Wray <jason@mapbox.com> | 2018-08-07 15:06:55 -0400 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2018-08-07 15:11:00 -0400 |
commit | dfa7e3747626c09d03c080394ba2dfb3169874cc (patch) | |
tree | f6cb0193229a32ea8d3875cdf780c40387586a47 /scripts/environment.js | |
parent | 0ec4a84c310f4bf95265939698d71f267af5802e (diff) | |
download | qtlocation-mapboxgl-dfa7e3747626c09d03c080394ba2dfb3169874cc.tar.gz |
[build] Fix CI failure when master and release branch are identical
The search for branches containing the previous hash could return multiple matches on different lines, if, for instance, a newly-cut release branch were identical to master.
Diffstat (limited to 'scripts/environment.js')
-rwxr-xr-x | scripts/environment.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/environment.js b/scripts/environment.js index 9777377f19..bb0be77886 100755 --- a/scripts/environment.js +++ b/scripts/environment.js @@ -24,7 +24,7 @@ if (pr) { } else { const head = process.env['CIRCLE_SHA1']; for (const sha of execSync(`git rev-list --max-count=10 ${head}`).toString().trim().split('\n')) { - const base = execSync(`git branch -r --contains ${sha} origin/master origin/release-*`).toString().trim().replace(/^origin\//, ''); + const base = execSync(`git branch -r --contains ${sha} origin/master origin/release-*`).toString().replace(/$\n.*/m, '').trim().replace(/^origin\//, ''); if (base) { const mergeBase = execSync(`git merge-base origin/${base} ${head}`).toString().trim(); console.log(`export CIRCLE_TARGET_BRANCH=${base}`); |