mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-09-20 12:18:48 +00:00
Disable automatic cache saves for merge queues (#1056)
Amp-Thread-ID: https://ampcode.com/threads/T-01a0af68-f950-77dc-b9ae-9402987584c8 Closes: #1052 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
committed by
GitHub
parent
3377a30666
commit
a761a4e9af
+13
-1
@@ -60,7 +60,7 @@ export function loadInputs(): SetupInputs {
|
||||
const checksum = core.getInput("checksum");
|
||||
const enableCache = getEnableCache();
|
||||
const restoreCache = core.getInput("restore-cache") === "true";
|
||||
const saveCache = core.getInput("save-cache") === "true";
|
||||
const saveCache = getSaveCache();
|
||||
const cacheSuffix = core.getInput("cache-suffix") || "";
|
||||
const cacheLocalPath = getCacheLocalPath(
|
||||
workingDirectory,
|
||||
@@ -189,6 +189,18 @@ function getEnableCache(): boolean {
|
||||
return enableCacheInput === "true";
|
||||
}
|
||||
|
||||
function getSaveCache(): boolean {
|
||||
const saveCacheInput = core.getInput("save-cache");
|
||||
if (saveCacheInput === "auto") {
|
||||
if (process.env.GITHUB_EVENT_NAME === "merge_group") {
|
||||
log.info("Cache saving is disabled for the merge_group event");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return saveCacheInput === "true";
|
||||
}
|
||||
|
||||
function getToolBinDir(workingDirectory: string): string | undefined {
|
||||
const toolBinDirInput = core.getInput("tool-bin-dir");
|
||||
if (toolBinDirInput !== "") {
|
||||
|
||||
Reference in New Issue
Block a user