Fix review points

This commit is contained in:
Ivan Zosimov 2022-04-04 19:29:29 +02:00
parent c1691a39b4
commit c733861b29
5 changed files with 14 additions and 9 deletions

View file

@ -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);

View file

@ -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);
}