.github: use pull_request_target which has access to token

This tries to add support for forked repo pull requests, to be able
to run quality checks on it and send comments on the PR. Hopefully,
this solves the issues faced recently.

Due to the way pull_request_target works, I can't send this as a PR
so committing directly to `main` and then sending a dummy PR from a fork
to test if it works as documented by github and elsewhere.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2022-04-18 14:28:05 +05:30
parent c265df965e
commit dcb9143330
1 changed files with 3 additions and 1 deletions

View File

@ -17,7 +17,7 @@
name: PR Quality Check
on: [pull_request]
on: [pull_request_target]
jobs:
build:
@ -25,6 +25,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Changed Java Files
id: java-changes