fix: fail closed when cached version cannot be verified
This commit is contained in:
parent
af3f129cf0
commit
37a513a584
54
dist/setup/index.js
generated
vendored
54
dist/setup/index.js
generated
vendored
File diff suppressed because one or more lines are too long
@ -97,7 +97,12 @@ export default async (options: Input): Promise<Output> => {
|
||||
if (revision) {
|
||||
const expectedVersion = extractVersionFromUrl(url);
|
||||
const [actualVersion] = revision.split("+");
|
||||
if (expectedVersion && actualVersion !== expectedVersion) {
|
||||
if (!expectedVersion) {
|
||||
warning(
|
||||
`Could not parse expected version from URL: ${url}. Ignoring cache.`,
|
||||
);
|
||||
revision = undefined;
|
||||
} else if (actualVersion !== expectedVersion) {
|
||||
warning(
|
||||
`Cached Bun version ${revision} does not match expected version ${expectedVersion}. Re-downloading.`,
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user