1
0
Fork 0
mirror of https://github.com/actions/setup-go synced 2024-12-22 06:12:42 +00:00

Merge pull request #383 from akv-platform/issue-368

Add imageOS to primaryKey
This commit is contained in:
Sergey Dolin 2023-07-11 09:44:30 +02:00 committed by GitHub
commit 08b314a573
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

3
dist/setup/index.js vendored
View file

@ -61155,7 +61155,8 @@ const restoreCache = (versionSpec, packageManager, cacheDependencyPath) => __awa
if (!fileHash) { if (!fileHash) {
throw new Error('Some specified paths were not resolved, unable to cache dependencies.'); throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
} }
const primaryKey = `setup-go-${platform}-go-${versionSpec}-${fileHash}`; const linuxVersion = process.env.RUNNER_OS === 'Linux' ? `${process.env.ImageOS}-` : '';
const primaryKey = `setup-go-${platform}-${linuxVersion}go-${versionSpec}-${fileHash}`;
core.debug(`primary key is ${primaryKey}`); core.debug(`primary key is ${primaryKey}`);
core.saveState(constants_1.State.CachePrimaryKey, primaryKey); core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey); const cacheKey = yield cache.restoreCache(cachePaths, primaryKey);

View file

@ -29,7 +29,9 @@ export const restoreCache = async (
); );
} }
const primaryKey = `setup-go-${platform}-go-${versionSpec}-${fileHash}`; const linuxVersion =
process.env.RUNNER_OS === 'Linux' ? `${process.env.ImageOS}-` : '';
const primaryKey = `setup-go-${platform}-${linuxVersion}go-${versionSpec}-${fileHash}`;
core.debug(`primary key is ${primaryKey}`); core.debug(`primary key is ${primaryKey}`);
core.saveState(State.CachePrimaryKey, primaryKey); core.saveState(State.CachePrimaryKey, primaryKey);