From 68c591cb922b9d9771283db427a75358bd4c789c Mon Sep 17 00:00:00 2001 From: Miroslav Jonas Date: Thu, 7 Sep 2023 09:52:51 +0200 Subject: [PATCH] fix: fix broken merge group --- dist/index.js | 6 +++++- find-successful-workflow.js | 6 +++++- package.json | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3f75c9d..e3303b1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -13943,7 +13943,11 @@ let BASE_SHA; const headResult = spawnSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf-8' }); const HEAD_SHA = headResult.stdout; - if (['pull_request', 'pull_request_target', 'merge_group'].includes(eventName) && !github.context.payload.pull_request.merged) { + + if ( + (['pull_request', 'pull_request_target'].includes(eventName) && !github.context.payload.pull_request.merged) || + eventName == 'merge_group' + ) { try { const mergeBaseRef = await findMergeBaseRef(); const baseResult = spawnSync('git', ['merge-base', `origin/${mainBranchName}`, mergeBaseRef], { encoding: 'utf-8' }); diff --git a/find-successful-workflow.js b/find-successful-workflow.js index ea3b50c..73e64ff 100644 --- a/find-successful-workflow.js +++ b/find-successful-workflow.js @@ -27,7 +27,11 @@ let BASE_SHA; const headResult = spawnSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf-8' }); const HEAD_SHA = headResult.stdout; - if (['pull_request', 'pull_request_target', 'merge_group'].includes(eventName) && !github.context.payload.pull_request.merged) { + + if ( + (['pull_request', 'pull_request_target'].includes(eventName) && !github.context.payload.pull_request.merged) || + eventName == 'merge_group' + ) { try { const mergeBaseRef = await findMergeBaseRef(); const baseResult = spawnSync('git', ['merge-base', `origin/${mainBranchName}`, mergeBaseRef], { encoding: 'utf-8' }); diff --git a/package.json b/package.json index 8684c49..f5c5a09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.2.1", + "version": "3.2.2", "license": "MIT", "description": "This package.json is here purely to control the version of the Action, in combination with https://github.com/JamesHenry/publish-shell-action", "scripts": {