Add env var alternative to dependency-caching input

This commit is contained in:
Michael B. Gale 2024-09-25 11:10:11 +01:00
parent f3714aed1f
commit 1338dbce25
No known key found for this signature in database
GPG key ID: FF5E2765BD00628F
6 changed files with 20 additions and 4 deletions

View file

@ -727,7 +727,9 @@ async function recordZstdAvailability(
/** Determines whether dependency caching is enabled. */
function getDependencyCachingEnabled(): boolean {
// If the workflow specified something always respect that
const dependencyCaching = getOptionalInput("dependency-caching");
const dependencyCaching =
getOptionalInput("dependency-caching") ||
process.env[EnvVar.DEPENDENCY_CACHING];
if (dependencyCaching !== undefined) return dependencyCaching === "true";
// On self-hosted runners which may have dependencies installed centrally, disable caching by default