Skip to content

Commit

Permalink
fix: fix broken merge group
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Sep 7, 2023
1 parent 5be6db2 commit 68c591c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
Expand Down
6 changes: 5 additions & 1 deletion find-successful-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 68c591c

Please sign in to comment.