From b365bd8768da904d276a3f9b6fdf4f16082ce637 Mon Sep 17 00:00:00 2001 From: Rob Dodson Date: Thu, 13 Aug 2020 12:44:57 -0700 Subject: [PATCH] Update main.ts (#29) 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 78c480c..a8c4030 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') {