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:
Kevin Stillhammer
2026-09-17 15:56:38 +02:00
committed by GitHub
parent 3377a30666
commit a761a4e9af
8 changed files with 95 additions and 10 deletions
Generated Vendored
+12 -1
View File
@@ -64490,7 +64490,7 @@ function loadInputs() {
const checksum = getInput("checksum");
const enableCache = getEnableCache();
const restoreCache2 = getInput("restore-cache") === "true";
const saveCache4 = getInput("save-cache") === "true";
const saveCache4 = getSaveCache();
const cacheSuffix = getInput("cache-suffix") || "";
const cacheLocalPath = getCacheLocalPath(
workingDirectory,
@@ -64600,6 +64600,17 @@ function getEnableCache() {
}
return enableCacheInput === "true";
}
function getSaveCache() {
const saveCacheInput = getInput("save-cache");
if (saveCacheInput === "auto") {
if (process.env.GITHUB_EVENT_NAME === "merge_group") {
info2("Cache saving is disabled for the merge_group event");
return false;
}
return true;
}
return saveCacheInput === "true";
}
function getToolBinDir(workingDirectory) {
const toolBinDirInput = getInput("tool-bin-dir");
if (toolBinDirInput !== "") {