From d8c7b26839d777fa0aed3c96316543d1fe282b82 Mon Sep 17 00:00:00 2001 From: John White <750350+johnhwhite@users.noreply.github.com> Date: Mon, 14 Aug 2023 10:46:32 -0400 Subject: [PATCH] fix: support `pull_request_target` event Fixes #102 --- find-successful-workflow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find-successful-workflow.js b/find-successful-workflow.js index bc1181f..ca622fe 100644 --- a/find-successful-workflow.js +++ b/find-successful-workflow.js @@ -26,7 +26,7 @@ let BASE_SHA; const HEAD_SHA = execSync(`git rev-parse HEAD`, { encoding: 'utf-8' }); - if (eventName === 'pull_request') { + if (['pull_request','pull_request_target'].includes(eventName)) { BASE_SHA = execSync(`git merge-base origin/${mainBranchName} HEAD`, { encoding: 'utf-8' }); } else { try {