diff --git a/CHANGELOG.md b/CHANGELOG.md index da33177..4f591ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## v2.2.1 +- [Add support for pull_request_target](https://github.com/dorny/paths-filter/pull/29) + ## v2.2.0 - [Improve change detection for feature branches](https://github.com/dorny/paths-filter/pull/16) diff --git a/README.md b/README.md index d1e1b29..a683a10 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: dorny/paths-filter@v2.2.0 + - uses: dorny/paths-filter@v2.2.1 id: filter with: # inline YAML or path to separate file (e.g.: .github/filters.yaml) @@ -104,7 +104,7 @@ jobs: frontend: ${{ steps.filter.outputs.frontend }} steps: # For pull requests it's not necessary to checkout the code - - uses: dorny/paths-filter@v2.2.0 + - uses: dorny/paths-filter@v2.2.1 id: filter with: # Filters stored in own yaml file diff --git a/dist/index.js b/dist/index.js index fb24b6c..636c54e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4582,7 +4582,7 @@ function getConfigFileContent(configPath) { } function getChangedFiles(token) { return __awaiter(this, void 0, void 0, function* () { - 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; return token ? yield getChangedFilesFromApi(token, pr) : yield getChangedFilesFromGit(pr.base.sha); } diff --git a/src/main.ts b/src/main.ts index 9b005e0..4498b05 100644 --- a/src/main.ts +++ b/src/main.ts @@ -64,7 +64,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') {