Skip to content

Commit d130085

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

File tree

3 files changed

+138
-3
lines changed

3 files changed

+138
-3
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
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@actions/cache": "^4.0.3",
2626
"@actions/core": "^1.11.1",
2727
"@actions/exec": "^1.1.1",
28+
"@actions/github": "^6.0.1",
2829
"@actions/io": "^1.1.3",
2930
"@actions/tool-cache": "^2",
3031
"linux-os-info": "^2.0.0",

yarn.lock

Lines changed: 134 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)