Skip to content

Commit 7ad4dca

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

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

dist/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29960,8 +29960,7 @@ 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' });
29964-
BASE_SHA = baseResult.stdout;
29963+
BASE_SHA = github.context.payload[eventName].base.ref;
2996529964
}
2996629965
else if (eventName == 'merge_group') {
2996729966
const baseResult = (0, child_process_1.spawnSync)('git', ['rev-parse', 'HEAD^1'], {

find-successful-workflow.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ let BASE_SHA: string;
4242
['pull_request', 'pull_request_target'].includes(eventName) &&
4343
!github.context.payload.pull_request.merged
4444
) {
45-
const baseResult = spawnSync(
46-
'git',
47-
['merge-base', `origin/${mainBranchName}`, 'HEAD'],
48-
{ encoding: 'utf-8' },
49-
);
50-
BASE_SHA = baseResult.stdout;
45+
BASE_SHA = github.context.payload[eventName].base.ref;
5146
} else if (eventName == 'merge_group') {
5247
const baseResult = spawnSync('git', ['rev-parse', 'HEAD^1'], {
5348
encoding: 'utf-8',

0 commit comments

Comments
 (0)