Skip to content

Commit 339ad42

Browse files
filipesilvasumitarora
authored andcommitted
ci: fix branch comparison (#6247)
1 parent 1d99472 commit 339ad42

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/test-commit-messages.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ execSync('git fetch origin');
3636
// Travis doesn't have master when running jobs on other branches (minor/patch/etc).
3737
execSync('git fetch origin master:master');
3838

39+
// Get PR target branch, default to master for running locally.
40+
const currentBranch = process.env.TRAVIS_BRANCH
41+
|| process.env.APPVEYOR_REPO_BRANCH
42+
|| 'master';
3943

40-
const output = execSync('git log master.. --reverse --format="%H %s" --no-merges', {
44+
const output = execSync('git log ' + currentBranch + '..HEAD --reverse --format="%H %s" --no-merges', {
4145
encoding: 'utf-8'
4246
});
4347

0 commit comments

Comments
 (0)