percy-client
Advanced tools
Comparing version 1.1.5 to 1.3.0
@@ -33,2 +33,4 @@ 'use strict'; | ||
return 'semaphore'; | ||
} else if (this._env.BUILDKITE == 'true') { | ||
return 'buildkite'; | ||
} | ||
@@ -45,2 +47,5 @@ return null; | ||
case 'travis': | ||
if (this.pullRequestNumber && this._env.TRAVIS_PULL_REQUEST_SHA) { | ||
return this._env.TRAVIS_PULL_REQUEST_SHA; | ||
} | ||
return this._env.TRAVIS_COMMIT; | ||
@@ -58,2 +63,6 @@ case 'jenkins': | ||
return this._env.REVISION; | ||
case 'buildkite': | ||
var commitSha = this._env.BUILDKITE_COMMIT; | ||
// Buildkite mixes SHAs and non-SHAs in BUILDKITE_COMMIT, so we return null if non-SHA. | ||
return commitSha !== 'HEAD' ? this._env.BUILDKITE_COMMIT : null; | ||
} | ||
@@ -70,8 +79,4 @@ return null; | ||
case 'travis': | ||
// Note: this is very unfortunately necessary because Travis doesn't expose the head branch, | ||
// only the targeted branch in TRAVIS_BRANCH and no way to get the actual head PR branch. | ||
// We create a fake branch name so that Percy doesn't mistake this PR as a new master build. | ||
// https://github.com/travis-ci/travis-ci/issues/1633#issuecomment-194749671 | ||
if (this.pullRequestNumber && this._env.TRAVIS_BRANCH == 'master') { | ||
return 'github-pr-' + this.pullRequestNumber; | ||
if (this.pullRequestNumber && this._env.TRAVIS_PULL_REQUEST_BRANCH) { | ||
return this._env.TRAVIS_PULL_REQUEST_BRANCH; | ||
} | ||
@@ -89,2 +94,4 @@ return this._env.TRAVIS_BRANCH; | ||
return this._env.BRANCH_NAME; | ||
case 'buildkite': | ||
return this._env.BUILDKITE_BRANCH; | ||
} | ||
@@ -108,2 +115,3 @@ // Not in a git repo? Assume that the branch is master. | ||
} | ||
// Deprecated flow: | ||
switch (this.ci) { | ||
@@ -148,2 +156,4 @@ case 'travis': | ||
return this._env.PULL_REQUEST_NUMBER; | ||
case 'buildkite': | ||
return this._env.BUILDKITE_PULL_REQUEST !== 'false' ? this._env.BUILDKITE_PULL_REQUEST : null; | ||
} | ||
@@ -175,2 +185,4 @@ return null; | ||
return this._env.SEMAPHORE_BUILD_NUMBER; | ||
case 'buildkite': | ||
return this._env.BUILDKITE_BUILD_ID; | ||
} | ||
@@ -200,2 +212,5 @@ return null; | ||
case 'codeship': | ||
if (this._env.CI_NODE_TOTAL) { | ||
return parseInt(this._env.CI_NODE_TOTAL); | ||
} | ||
break; | ||
@@ -209,2 +224,4 @@ case 'drone': | ||
break; | ||
case 'buildkite': | ||
break; | ||
} | ||
@@ -211,0 +228,0 @@ return null; |
{ | ||
"name": "percy-client", | ||
"version": "1.1.5", | ||
"version": "1.3.0", | ||
"description": "JavaScript API client library for Percy (https://percy.io).", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2110969
60553