Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit 7640a90

Browse files
committed
Fixed the comparison that was being done. Based on Travis's documentation the environment variable is set to: The pull request number if the current job is a pull request, "false" if it's not a pull request.
1 parent c1dbe16 commit 7640a90

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/getGitData.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@
5050
});
5151
it('should be able to get the commit id from Git', function () {
5252
// If we are currently running on Travis, we should be able to use the commit id environment variable
53-
// to check the git commit id method with actual git.
54-
if (actualTravisCommit && process.env.TRAVIS_PULL_REQUEST !== 'true') {
53+
// to check the git commit id method with actual git. But we can't do this for Pull Requests because
54+
// Travis provides the Commit id that triggered the Pull Request not the current Commit Id
55+
if (actualTravisCommit && process.env.TRAVIS_PULL_REQUEST === 'false') {
5556
return expect(getGitData.getCommitId()).to.eventually.equal(actualTravisCommit);
5657
}
5758
return expect(getGitData.getCommitId()).to.eventually.be.fulfilled;

0 commit comments

Comments
 (0)