mirror of
https://code.forgejo.org/actions/setup-node
synced 2025-06-09 21:42:20 +02:00
fix: add arch to cached path (#843)
* fix: add arch to cached path * fix: change from using env to os module * fix: use process.env.RUNNER_OS instead of os.platform() * fix: remove unused var
This commit is contained in:
parent
abb238b131
commit
39370e3970
3 changed files with 14 additions and 3 deletions
|
@ -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 {
|
||||
|
@ -21,6 +22,7 @@ export const restoreCache = async (
|
|||
throw new Error(`Caching for '${packageManager}' is not supported`);
|
||||
}
|
||||
const platform = process.env.RUNNER_OS;
|
||||
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}`);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue