Skip to content

Commit cab8b47

Browse files
committed
ci: fix branch comparison
1 parent a9be15e commit cab8b47

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 current branch.
40+
const currentBranch = process.env.TRAVIS_BRANCH || execSync('git symbolic-ref --short HEAD', {
41+
encoding: 'utf-8'
42+
});
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)