mirror of
https://github.com/actions/setup-python.git
synced 2026-03-25 08:01:02 +00:00
Merge b5284171bb355255370814377fe050263b856f78 into a309ff8b426b58ec0e2a45f0f869d46889d02405
This commit is contained in:
commit
712b3477b2
@ -20,6 +20,9 @@ inputs:
|
|||||||
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
|
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
|
||||||
cache-dependency-path:
|
cache-dependency-path:
|
||||||
description: "Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies."
|
description: "Used to specify the path to dependency files. 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
|
||||||
update-environment:
|
update-environment:
|
||||||
description: "Set this option if you want the action to update environment variables."
|
description: "Set this option if you want the action to update environment variables."
|
||||||
default: true
|
default: true
|
||||||
|
|||||||
5
dist/cache-save/index.js
vendored
5
dist/cache-save/index.js
vendored
@ -44170,6 +44170,11 @@ const cache_distributor_1 = __nccwpck_require__(92326);
|
|||||||
// https://github.com/actions/cache/pull/1217
|
// https://github.com/actions/cache/pull/1217
|
||||||
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 cache = core.getInput('cache');
|
const cache = core.getInput('cache');
|
||||||
if (cache) {
|
if (cache) {
|
||||||
await saveCache(cache);
|
await saveCache(cache);
|
||||||
|
|||||||
@ -9,6 +9,14 @@ import {State} from './cache-distributions/cache-distributor';
|
|||||||
// https://github.com/actions/cache/pull/1217
|
// https://github.com/actions/cache/pull/1217
|
||||||
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 cache = core.getInput('cache');
|
const cache = core.getInput('cache');
|
||||||
if (cache) {
|
if (cache) {
|
||||||
await saveCache(cache);
|
await saveCache(cache);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user