This commit is contained in:
Peng Xiao
2024-05-22 19:11:00 +05:30
committed by GitHub
3 changed files with 21 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ import * as core from '@actions/core';
import * as glob from '@actions/glob';
import path from 'path';
import fs from 'fs';
import os from 'os';
import {State} from './constants';
import {
@@ -20,7 +21,8 @@ export const restoreCache = async (
if (!packageManagerInfo) {
throw new Error(`Caching for '${packageManager}' is not supported`);
}
const platform = process.env.RUNNER_OS;
const platform = os.platform();
const arch = os.arch();
const cachePaths = await getCacheDirectories(
packageManagerInfo,
@@ -38,7 +40,7 @@ export const restoreCache = async (
);
}
const keyPrefix = `node-cache-${platform}-${packageManager}`;
const keyPrefix = `node-cache-${platform}-${arch}-${packageManager}`;
const primaryKey = `${keyPrefix}-${fileHash}`;
core.debug(`primary key is ${primaryKey}`);