@percy/env 1.15.0 → 1.19.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,6 +38,8 @@ export class PercyEnv {
38
38
  return 'github';
39
39
  } else if (this.vars.NETLIFY === 'true') {
40
40
  return 'netlify';
41
+ } else if (this.vars.HARNESS_PROJECT_ID) {
42
+ return 'harness';
41
43
  } else if (this.vars.CI) {
42
44
  return 'CI/unknown';
43
45
  } else {
@@ -98,6 +100,8 @@ export class PercyEnv {
98
100
  return this.vars.BITBUCKET_COMMIT;
99
101
  case 'github':
100
102
  return ((_github$pull_request = github(this.vars).pull_request) === null || _github$pull_request === void 0 ? void 0 : _github$pull_request.head.sha) || this.vars.GITHUB_SHA;
103
+ case 'harness':
104
+ return this.vars.DRONE_COMMIT_SHA;
101
105
  }
102
106
  })();
103
107
  return commit || null;
@@ -143,6 +147,8 @@ export class PercyEnv {
143
147
  return ((_github$pull_request2 = github(this.vars).pull_request) === null || _github$pull_request2 === void 0 ? void 0 : _github$pull_request2.head.ref) || this.vars.GITHUB_REF;
144
148
  case 'netlify':
145
149
  return this.vars.HEAD;
150
+ case 'harness':
151
+ return this.vars.DRONE_SOURCE_BRANCH || this.vars.DRONE_COMMIT_BRANCH;
146
152
  }
147
153
  })();
148
154
  return (branch === null || branch === void 0 ? void 0 : branch.replace(/^refs\/\w+?\//, '')) || null;
@@ -154,7 +160,7 @@ export class PercyEnv {
154
160
  return this.vars.PERCY_PULL_REQUEST;
155
161
  }
156
162
  let pr = (() => {
157
- var _this$vars$CI_PULL_RE, _this$vars$PULL_REQUE, _github$pull_request3;
163
+ var _this$vars$CI_PULL_RE, _this$vars$PULL_REQUE, _github$pull_request3, _this$vars$DRONE_COMM;
158
164
  switch (this.ci) {
159
165
  case 'travis':
160
166
  return this.vars.TRAVIS_PULL_REQUEST !== 'false' && this.vars.TRAVIS_PULL_REQUEST;
@@ -186,6 +192,8 @@ export class PercyEnv {
186
192
  return this.vars.PULL_REQUEST !== 'false' && this.vars.REVIEW_ID;
187
193
  case 'github':
188
194
  return (_github$pull_request3 = github(this.vars).pull_request) === null || _github$pull_request3 === void 0 ? void 0 : _github$pull_request3.number;
195
+ case 'harness':
196
+ return this.vars.DRONE_BUILD_EVENT === 'pull_request' && ((_this$vars$DRONE_COMM = this.vars.DRONE_COMMIT_LINK) === null || _this$vars$DRONE_COMM === void 0 ? void 0 : _this$vars$DRONE_COMM.split('/').slice(-1)[0]);
189
197
  }
190
198
  })();
191
199
  return pr || null;
@@ -233,6 +241,8 @@ export class PercyEnv {
233
241
  return this.vars.BITBUCKET_BUILD_NUMBER;
234
242
  case 'github':
235
243
  return this.vars.GITHUB_RUN_ID;
244
+ case 'harness':
245
+ return this.vars.HARNESS_BUILD_ID;
236
246
  }
237
247
  })();
238
248
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/env",
3
- "version": "1.15.0",
3
+ "version": "1.19.0-alpha.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,5 +30,5 @@
30
30
  "test": "node ../../scripts/test",
31
31
  "test:coverage": "yarn test --coverage"
32
32
  },
33
- "gitHead": "383ce2888d2e4fe6972368f9bbe8580b23431a98"
33
+ "gitHead": "84a27b8600c45ca67f8dd9b3403a0a8913e7c6f3"
34
34
  }