diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0e2ef24..115f23d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,2 @@ +* @Pijukatel /.github/workflows/factory_review.yaml @mtrunkat diff --git a/.github/workflows/request_factory_review.yaml b/.github/workflows/request_factory_review.yaml new file mode 100644 index 0000000..9420855 --- /dev/null +++ b/.github/workflows/request_factory_review.yaml @@ -0,0 +1,27 @@ +name: Request apify-factory review + +on: + # Taken from the default branch, never from the pull request. Pull request code is never + # checked out or executed. + pull_request_target: + types: + - opened + - ready_for_review + +permissions: {} + +jobs: + request-review: + if: >- + !github.event.pull_request.draft + && github.event.pull_request.user.login != 'apify-factory' + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + # Requested with apify-factory's own token: a request made with GITHUB_TOKEN wouldn't + # trigger the `review_requested` run of factory_review.yaml. + - env: + GH_TOKEN: ${{ secrets.APIFY_FACTORY_GITHUB_TOKEN }} + REPO: ${{ github.repository }} + PR_NUMBER: ${{ github.event.pull_request.number }} + run: gh api -X POST "repos/$REPO/pulls/$PR_NUMBER/requested_reviewers" -f 'reviewers[]=apify-factory' --silent