Skip to content

Commit db3990c

Browse files
committed
fix: switch base to point to base.ref over main branching point
1 parent b691dd2 commit db3990c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

dist/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -29960,7 +29960,11 @@ let BASE_SHA;
2996029960
let HEAD_SHA = headResult.stdout;
2996129961
if (['pull_request', 'pull_request_target'].includes(eventName) &&
2996229962
!github.context.payload.pull_request.merged) {
29963-
const baseResult = (0, child_process_1.spawnSync)('git', ['merge-base', `origin/${mainBranchName}`, 'HEAD'], { encoding: 'utf-8' });
29963+
const baseResult = (0, child_process_1.spawnSync)('git', [
29964+
'merge-base',
29965+
`origin/${github.context.payload[eventName].base.ref}`,
29966+
'HEAD',
29967+
], { encoding: 'utf-8' });
2996429968
BASE_SHA = baseResult.stdout;
2996529969
}
2996629970
else if (eventName == 'merge_group') {

find-successful-workflow.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ let BASE_SHA: string;
4444
) {
4545
const baseResult = spawnSync(
4646
'git',
47-
['merge-base', `origin/${mainBranchName}`, 'HEAD'],
47+
[
48+
'merge-base',
49+
`origin/${github.context.payload[eventName].base.ref}`,
50+
'HEAD',
51+
],
4852
{ encoding: 'utf-8' },
4953
);
5054
BASE_SHA = baseResult.stdout;

0 commit comments

Comments
 (0)