From 208e360ea7a2d955beb2dd3dd88016caebe5052d Mon Sep 17 00:00:00 2001 From: Nara Kasbergen Kwon <855115+xiehan@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:09:19 +0200 Subject: [PATCH] chore: update auto-approve.ts --- projenrc/auto-approve.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projenrc/auto-approve.ts b/projenrc/auto-approve.ts index 89591a7..388c6db 100644 --- a/projenrc/auto-approve.ts +++ b/projenrc/auto-approve.ts @@ -16,11 +16,12 @@ export class AutoApprove { if (!workflow) throw new Error("no workflow defined"); workflow.on({ - pullRequest: { + pullRequestTarget: { types: ["opened", "labeled", "ready_for_review", "reopened"], }, }); + const maintainerStatuses = `fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]')`; workflow.addJobs({ approve: { runsOn: ["ubuntu-latest"], @@ -37,7 +38,7 @@ export class AutoApprove { }, { name: "Auto-approve PRs by other users as team-tf-cdk", - if: "github.event.pull_request.user.login != 'team-tf-cdk'", + if: `github.event.pull_request.user.login != 'team-tf-cdk' && (contains(${maintainerStatuses}, github.event.pull_request.author_association) || github.actor == 'dependabot[bot])`, run: "gh pr review ${{ github.event.pull_request.number }} --approve", env: { GH_TOKEN: "${{ secrets.PROJEN_GITHUB_TOKEN }}",