Skip to content

Commit cf059a2

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

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

dist/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -29960,7 +29960,9 @@ 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+
console.log(github);
29964+
console.log(github.context);
29965+
const baseResult = github.context.payload.base.ref;
2996429966
BASE_SHA = baseResult.stdout;
2996529967
}
2996629968
else if (eventName == 'merge_group') {

find-successful-workflow.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ 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-
);
45+
console.log(github);
46+
console.log(github.context);
47+
const baseResult = github.context.payload.base.ref;
5048
BASE_SHA = baseResult.stdout;
5149
} else if (eventName == 'merge_group') {
5250
const baseResult = spawnSync('git', ['rev-parse', 'HEAD^1'], {

0 commit comments

Comments
 (0)