Skip to content

Commit

Permalink
Limit to Linux only
Browse files Browse the repository at this point in the history
  • Loading branch information
dsame committed Jul 10, 2023
1 parent a4d10f0 commit 2b35b14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61155,8 +61155,8 @@ const restoreCache = (versionSpec, packageManager, cacheDependencyPath) => __awa
if (!fileHash) {
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
}
const imageOS = process.env.ImageOS || 'self-hosted';
const primaryKey = `setup-go-${platform}-${imageOS}-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.saveState(constants_1.State.CachePrimaryKey, primaryKey);
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey);
Expand Down
5 changes: 3 additions & 2 deletions src/cache-restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ export const restoreCache = async (
);
}

const imageOS = process.env.ImageOS || 'self-hosted';
const primaryKey = `setup-go-${platform}-${imageOS}-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.saveState(State.CachePrimaryKey, primaryKey);
Expand Down

0 comments on commit 2b35b14

Please sign in to comment.