mirror of
https://github.com/dorny/paths-filter.git
synced 2024-12-20 00:49:04 +00:00
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
This commit is contained in:
parent
e1ae9889cb
commit
b365bd8768
@ -49,7 +49,7 @@ function getConfigFileContent(configPath: string): string {
|
||||
}
|
||||
|
||||
async function getChangedFiles(token: string): Promise<string[] | null> {
|
||||
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') {
|
||||
|
Loading…
Reference in New Issue
Block a user