mirror of
https://github.com/actions/setup-node.git
synced 2026-03-14 07:06:24 +00:00
Merge db56306c3a into 53b83947a5
This commit is contained in:
commit
9e946804f8
@ -25,6 +25,9 @@ inputs:
|
|||||||
default: true
|
default: true
|
||||||
cache-dependency-path:
|
cache-dependency-path:
|
||||||
description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.'
|
description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.'
|
||||||
|
cache-write:
|
||||||
|
description: 'Whether to save the cache at the end of the workflow. Set to false for cache read-only mode, useful for preventing cache poisoning from untrusted PR builds.'
|
||||||
|
default: true
|
||||||
mirror:
|
mirror:
|
||||||
description: 'Used to specify an alternative mirror to download Node.js binaries from'
|
description: 'Used to specify an alternative mirror to download Node.js binaries from'
|
||||||
mirror-token:
|
mirror-token:
|
||||||
|
|||||||
5
dist/cache-save/index.js
vendored
5
dist/cache-save/index.js
vendored
@ -71532,6 +71532,11 @@ process.on('uncaughtException', e => {
|
|||||||
// Added early exit to resolve issue with slow post action step:
|
// Added early exit to resolve issue with slow post action step:
|
||||||
async function run(earlyExit) {
|
async function run(earlyExit) {
|
||||||
try {
|
try {
|
||||||
|
const cacheWriteEnabled = core.getInput('cache-write');
|
||||||
|
if (cacheWriteEnabled === 'false') {
|
||||||
|
core.info('Cache write is disabled (read-only mode). Skipping cache save.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const cacheLock = core.getState(constants_1.State.CachePackageManager);
|
const cacheLock = core.getState(constants_1.State.CachePackageManager);
|
||||||
if (cacheLock) {
|
if (cacheLock) {
|
||||||
await cachePackages(cacheLock);
|
await cachePackages(cacheLock);
|
||||||
|
|||||||
@ -16,6 +16,14 @@ process.on('uncaughtException', e => {
|
|||||||
// Added early exit to resolve issue with slow post action step:
|
// Added early exit to resolve issue with slow post action step:
|
||||||
export async function run(earlyExit?: boolean) {
|
export async function run(earlyExit?: boolean) {
|
||||||
try {
|
try {
|
||||||
|
const cacheWriteEnabled = core.getInput('cache-write');
|
||||||
|
if (cacheWriteEnabled === 'false') {
|
||||||
|
core.info(
|
||||||
|
'Cache write is disabled (read-only mode). Skipping cache save.'
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const cacheLock = core.getState(State.CachePackageManager);
|
const cacheLock = core.getState(State.CachePackageManager);
|
||||||
|
|
||||||
if (cacheLock) {
|
if (cacheLock) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user