Skip to content

Commit 4f93b7d

Browse files
committed
Skip saving cache for merge_group event
1 parent 6797dcb commit 4f93b7d

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
@@ -3,6 +3,7 @@ const path = require('path')
33
const core = require('@actions/core')
44
const exec = require('@actions/exec')
55
const cache = require('@actions/cache')
6+
const github = require('@actions/github')
67
const common = require('./common')
78

89
export const DEFAULT_CACHE_VERSION = '0'
@@ -197,7 +198,8 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
197198
await exec.exec('bundle', ['install', '--jobs', '4'])
198199

199200
// @actions/cache only allows to save for non-existing keys
200-
if (!common.isExactCacheKeyMatch(key, cachedKey)) {
201+
// Also, skip saving cache for merge_group event
202+
if (!common.isExactCacheKeyMatch(key, cachedKey) && github.context.eventName !== 'merge_group') {
201203
if (cachedKey) { // existing cache but Gemfile.lock differs, clean old gems
202204
await exec.exec('bundle', ['clean'])
203205
}

0 commit comments

Comments
 (0)