@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.js
CHANGED
|
@@ -179,6 +179,10 @@ var GitHubClient = class {
|
|
|
179
179
|
try {
|
|
180
180
|
return await fn();
|
|
181
181
|
} catch (err) {
|
|
182
|
+
const isNotFound = err && typeof err === "object" && "status" in err && err.status === 404;
|
|
183
|
+
if (isNotFound) {
|
|
184
|
+
throw err;
|
|
185
|
+
}
|
|
182
186
|
if (retries <= 0) {
|
|
183
187
|
error(`${operation} failed after ${this.maxRetries} retries: ${err instanceof Error ? err.message : String(err)}`);
|
|
184
188
|
throw err;
|
|
@@ -365,25 +369,27 @@ var GitHubClient = class {
|
|
|
365
369
|
* Check if a file exists in the repository
|
|
366
370
|
*/
|
|
367
371
|
async fileExists(ref, path) {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
372
|
+
try {
|
|
373
|
+
await this.octokit.rest.repos.getContent({
|
|
374
|
+
owner: this.owner,
|
|
375
|
+
repo: this.repo,
|
|
376
|
+
path,
|
|
377
|
+
ref
|
|
378
|
+
});
|
|
379
|
+
return true;
|
|
380
|
+
} catch (err) {
|
|
381
|
+
const status = err && typeof err === "object" && "status" in err ? err.status : void 0;
|
|
382
|
+
if (status === 404) {
|
|
383
|
+
return false;
|
|
384
|
+
}
|
|
385
|
+
if (err instanceof Error) {
|
|
386
|
+
const message = err.message.toLowerCase();
|
|
387
|
+
if (message.includes("404") || message.includes("not found")) {
|
|
382
388
|
return false;
|
|
383
389
|
}
|
|
384
|
-
throw err;
|
|
385
390
|
}
|
|
386
|
-
|
|
391
|
+
throw err;
|
|
392
|
+
}
|
|
387
393
|
}
|
|
388
394
|
/**
|
|
389
395
|
* Get the current rate limit status
|