@kakarot-ci/core 0.6.3 → 0.6.4
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.
- package/dist/cli/index.js +22 -16
- package/dist/cli/index.js.map +2 -2
- package/dist/index.cjs +22 -16
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +22 -16
- package/dist/index.js.map +2 -2
- package/dist/src/github/client.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -245,6 +245,10 @@ var GitHubClient = class {
|
|
|
245
245
|
try {
|
|
246
246
|
return await fn();
|
|
247
247
|
} catch (err) {
|
|
248
|
+
const isNotFound = err && typeof err === "object" && "status" in err && err.status === 404;
|
|
249
|
+
if (isNotFound) {
|
|
250
|
+
throw err;
|
|
251
|
+
}
|
|
248
252
|
if (retries <= 0) {
|
|
249
253
|
error(`${operation} failed after ${this.maxRetries} retries: ${err instanceof Error ? err.message : String(err)}`);
|
|
250
254
|
throw err;
|
|
@@ -431,25 +435,27 @@ var GitHubClient = class {
|
|
|
431
435
|
* Check if a file exists in the repository
|
|
432
436
|
*/
|
|
433
437
|
async fileExists(ref, path) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
438
|
+
try {
|
|
439
|
+
await this.octokit.rest.repos.getContent({
|
|
440
|
+
owner: this.owner,
|
|
441
|
+
repo: this.repo,
|
|
442
|
+
path,
|
|
443
|
+
ref
|
|
444
|
+
});
|
|
445
|
+
return true;
|
|
446
|
+
} catch (err) {
|
|
447
|
+
const status = err && typeof err === "object" && "status" in err ? err.status : void 0;
|
|
448
|
+
if (status === 404) {
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
if (err instanceof Error) {
|
|
452
|
+
const message = err.message.toLowerCase();
|
|
453
|
+
if (message.includes("404") || message.includes("not found")) {
|
|
448
454
|
return false;
|
|
449
455
|
}
|
|
450
|
-
throw err;
|
|
451
456
|
}
|
|
452
|
-
|
|
457
|
+
throw err;
|
|
458
|
+
}
|
|
453
459
|
}
|
|
454
460
|
/**
|
|
455
461
|
* Get the current rate limit status
|