mirror of
https://github.com/step-security/harden-runner.git
synced 2026-06-05 19:53:33 +00:00
Improve error handling
This commit is contained in:
parent
b38e918ba8
commit
3e118b145b
3 changed files with 11 additions and 14 deletions
10
dist/pre/index.js
vendored
10
dist/pre/index.js
vendored
|
|
@ -88197,16 +88197,16 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
|
|||
version: cacheUtils.getCacheVersion([cacheFilePath], compressionMethod, false),
|
||||
};
|
||||
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
|
||||
if (!response.ok) {
|
||||
lib_core.debug(`Cache not found for version ${request.version} of keys: ${cacheKey}`);
|
||||
return undefined;
|
||||
}
|
||||
const url = new URL(response.signedDownloadUrl);
|
||||
lib_core.info(`Adding cacheHost: ${url.hostname}:443 to allowed-endpoints`);
|
||||
confg.allowed_endpoints += ` ${url.hostname}:443`;
|
||||
}
|
||||
catch (e) {
|
||||
lib_core.error(`v2 failed: ${e}`);
|
||||
lib_core.info(`Unable to fetch cacheURL ${e}`);
|
||||
if (confg.egress_policy === "block") {
|
||||
lib_core.info("Switching egress-policy to audit mode");
|
||||
confg.egress_policy = "audit";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "v1":
|
||||
|
|
|
|||
2
dist/pre/index.js.map
vendored
2
dist/pre/index.js.map
vendored
File diff suppressed because one or more lines are too long
13
src/setup.ts
13
src/setup.ts
|
|
@ -145,13 +145,6 @@ interface MonitorResponse {
|
|||
request
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
core.debug(
|
||||
`Cache not found for version ${request.version} of keys: ${cacheKey}`
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const url = new URL(response.signedDownloadUrl);
|
||||
core.info(
|
||||
`Adding cacheHost: ${url.hostname}:443 to allowed-endpoints`
|
||||
|
|
@ -159,7 +152,11 @@ interface MonitorResponse {
|
|||
|
||||
confg.allowed_endpoints += ` ${url.hostname}:443`;
|
||||
} catch (e) {
|
||||
core.error(`v2 failed: ${e}`);
|
||||
core.info(`Unable to fetch cacheURL ${e}`);
|
||||
if (confg.egress_policy === "block") {
|
||||
core.info("Switching egress-policy to audit mode");
|
||||
confg.egress_policy = "audit";
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue