From b32e880b2b57781c1dc04587e29782afc28ccd19 Mon Sep 17 00:00:00 2001 From: Rob Dodson Date: Thu, 13 Aug 2020 11:56:45 -0700 Subject: [PATCH] Update main.ts Add support for the new `pull_request_target` event. https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 78c480c6..a8c4030a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -49,7 +49,7 @@ function getConfigFileContent(configPath: string): string { } async function getChangedFiles(token: string): Promise { - if (github.context.eventName === 'pull_request') { + if (github.context.eventName === 'pull_request' || github.context.eventName === 'pull_request_target') { const pr = github.context.payload.pull_request as Webhooks.WebhookPayloadPullRequestPullRequest return token ? await getChangedFilesFromApi(token, pr) : await getChangedFilesFromGit(pr.base.sha) } else if (github.context.eventName === 'push') {