Skip to content

Commit

Permalink
chore(ci): allow auto-approve to work if team-tf-cdk is author
Browse files Browse the repository at this point in the history
  • Loading branch information
xiehan authored and team-tf-cdk committed Jul 21, 2023
1 parent 155a25f commit 1f0cd70
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/auto-approve.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions projen/auto-approve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,19 @@ export class AutoApprove {
with: {
ref: "${{ github.event.pull_request.head.ref }}",
repository: "${{ github.event.pull_request.head.repo.full_name }}",
}
},
},
{
name: "Auto-approve PRs by team-tf-cdk as github-actions[bot]",
if: "contains(github.event.pull_request.labels.*.name, 'auto-approve') && (github.event.pull_request.user.login == 'team-tf-cdk')",
run: "gh pr review ${{ github.event.pull_request.number }} --approve",
env: {
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}",
},
},
{
name: "Auto-approve PR",
if: "contains(github.event.pull_request.labels.*.name, 'auto-approve')",
name: "Auto-approve PRs by other users as team-tf-cdk",
if: "contains(github.event.pull_request.labels.*.name, 'auto-approve') && (github.event.pull_request.user.login != 'team-tf-cdk')",
run: "gh pr review ${{ github.event.pull_request.number }} --approve",
env: {
GH_TOKEN: "${{ secrets.GH_TOKEN }}",
Expand All @@ -49,6 +57,7 @@ export class AutoApprove {
],
permissions: {
contents: JobPermission.READ,
pullRequests: JobPermission.WRITE,
},
},
});
Expand Down

0 comments on commit 1f0cd70

Please sign in to comment.