Skip to content

Commit 0ecf29e

Browse files
committed
Skip saving cache for merge_group event
1 parent ed55d55 commit 0ecf29e

File tree

4 files changed

+4668
-252
lines changed

4 files changed

+4668
-252
lines changed

bundler.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const path = require('path')
44
const core = require('@actions/core')
55
const exec = require('@actions/exec')
66
const cache = require('@actions/cache')
7+
const github = require('@actions/github')
78
const common = require('./common')
89

910
export const DEFAULT_CACHE_VERSION = '0'
@@ -218,7 +219,8 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
218219
await exec.exec('bundle', ['install', '--jobs', `${jobs}`])
219220

220221
// @actions/cache only allows to save for non-existing keys
221-
if (!common.isExactCacheKeyMatch(key, cachedKey)) {
222+
// Also, skip saving cache for merge_group event
223+
if (!common.isExactCacheKeyMatch(key, cachedKey) && github.context.eventName !== 'merge_group') {
222224
if (cachedKey) { // existing cache but Gemfile.lock differs, clean old gems
223225
await exec.exec('bundle', ['clean'])
224226
}

0 commit comments

Comments
 (0)