fix: cache key should include node version

This commit is contained in:
Steven 2022-09-30 15:11:50 -04:00
parent 969bd26639
commit 2792b3f52b
3 changed files with 12 additions and 8 deletions

View file

@ -40,14 +40,16 @@ export async function run() {
await installer.getNode(version, stable, checkLatest, auth, arch);
}
let installedVersion = version
// Output version of node is being used
try {
const {stdout: installedVersion} = await exec.getExecOutput(
const {stdout} = await exec.getExecOutput(
'node',
['--version'],
{ignoreReturnCode: true, silent: true}
);
core.setOutput('node-version', installedVersion.trim());
installedVersion = stdout.trim();
core.setOutput('node-version', installedVersion);
} catch (err) {
core.setOutput('node-version', '');
}
@ -60,7 +62,7 @@ export async function run() {
if (cache && isCacheFeatureAvailable()) {
const cacheDependencyPath = core.getInput('cache-dependency-path');
await restoreCache(cache, cacheDependencyPath);
await restoreCache(cache, cacheDependencyPath, installedVersion);
}
const matchersPath = path.join(__dirname, '../..', '.github');