Skip to content

Commit 4e0b6c7

Browse files
committed
Limit to Linux only
1 parent a4d10f0 commit 4e0b6c7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: dist/setup/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -61155,8 +61155,8 @@ const restoreCache = (versionSpec, packageManager, cacheDependencyPath) => __awa
6115561155
if (!fileHash) {
6115661156
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
6115761157
}
61158-
const imageOS = process.env.ImageOS || 'self-hosted';
61159-
const primaryKey = `setup-go-${platform}-${imageOS}-go-${versionSpec}-${fileHash}`;
61158+
const linuxVersion = process.env.RUNNER_OS === 'Linux' ? `${process.env.ImageOS}-` : '';
61159+
const primaryKey = `setup-go-${platform}-${linuxVersion}go-${versionSpec}-${fileHash}`;
6116061160
core.debug(`primary key is ${primaryKey}`);
6116161161
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
6116261162
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey);

Diff for: src/cache-restore.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ export const restoreCache = async (
2929
);
3030
}
3131

32-
const imageOS = process.env.ImageOS || 'self-hosted';
33-
const primaryKey = `setup-go-${platform}-${imageOS}-go-${versionSpec}-${fileHash}`;
32+
const linuxVersion =
33+
process.env.RUNNER_OS === 'Linux' ? `${process.env.ImageOS}-` : '';
34+
const primaryKey = `setup-go-${platform}-${linuxVersion}go-${versionSpec}-${fileHash}`;
3435
core.debug(`primary key is ${primaryKey}`);
3536

3637
core.saveState(State.CachePrimaryKey, primaryKey);

0 commit comments

Comments
 (0)