Skip saving cache for merge_group event

This commit is contained in:
なつき
2025-12-20 21:28:32 +01:00
committed by Benoit Daloze
parent ed55d55e82
commit d354de180d
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -218,7 +218,8 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
await exec.exec('bundle', ['install', '--jobs', `${jobs}`]) await exec.exec('bundle', ['install', '--jobs', `${jobs}`])
// @actions/cache only allows to save for non-existing keys // @actions/cache only allows to save for non-existing keys
if (!common.isExactCacheKeyMatch(key, cachedKey)) { // Also, skip saving cache for merge_group event
if (!common.isExactCacheKeyMatch(key, cachedKey) && process.env['GITHUB_EVENT_NAME'] !== 'merge_group') {
if (cachedKey) { // existing cache but Gemfile.lock differs, clean old gems if (cachedKey) { // existing cache but Gemfile.lock differs, clean old gems
await exec.exec('bundle', ['clean']) await exec.exec('bundle', ['clean'])
} }
Generated Vendored
+2 -1
View File
@@ -232,7 +232,8 @@ async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, b
await exec.exec('bundle', ['install', '--jobs', `${jobs}`]) await exec.exec('bundle', ['install', '--jobs', `${jobs}`])
// @actions/cache only allows to save for non-existing keys // @actions/cache only allows to save for non-existing keys
if (!common.isExactCacheKeyMatch(key, cachedKey)) { // Also, skip saving cache for merge_group event
if (!common.isExactCacheKeyMatch(key, cachedKey) && process.env['GITHUB_EVENT_NAME'] !== 'merge_group') {
if (cachedKey) { // existing cache but Gemfile.lock differs, clean old gems if (cachedKey) { // existing cache but Gemfile.lock differs, clean old gems
await exec.exec('bundle', ['clean']) await exec.exec('bundle', ['clean'])
} }