mirror of
https://github.com/actions/setup-go.git
synced 2025-06-30 05:03:43 +00:00
Fix review points
This commit is contained in:
parent
c1691a39b4
commit
c733861b29
5 changed files with 14 additions and 9 deletions
|
@ -14,6 +14,7 @@ export const restoreCache = async (
|
|||
) => {
|
||||
const packageManagerInfo = await getPackageManagerInfo(packageManager);
|
||||
const platform = process.env.RUNNER_OS;
|
||||
const versionSpec = core.getInput('go-version');
|
||||
|
||||
const cachePath = await getCacheDirectoryPath(packageManagerInfo);
|
||||
|
||||
|
@ -28,7 +29,7 @@ export const restoreCache = async (
|
|||
);
|
||||
}
|
||||
|
||||
const primaryKey = `go-cache-${platform}-${fileHash}`;
|
||||
const primaryKey = `${platform}-go${versionSpec}-${fileHash}`;
|
||||
core.debug(`primary key is ${primaryKey}`);
|
||||
|
||||
core.saveState(State.CachePrimaryKey, primaryKey);
|
||||
|
|
|
@ -16,7 +16,7 @@ export async function run() {
|
|||
//
|
||||
let versionSpec = core.getInput('go-version');
|
||||
|
||||
const cache = core.getInput('cache');
|
||||
const cache = core.getBooleanInput('cache');
|
||||
core.info(`Setup go version spec ${versionSpec}`);
|
||||
|
||||
if (versionSpec) {
|
||||
|
@ -45,7 +45,7 @@ export async function run() {
|
|||
if (isGhes()) {
|
||||
throw new Error('Caching is not supported on GHES');
|
||||
}
|
||||
const packageManager = cache.toUpperCase() === 'TRUE' ? 'default' : cache;
|
||||
const packageManager = 'default';
|
||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||
await restoreCache(packageManager, cacheDependencyPath);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue