Skip to content

Commit 72b037a

Browse files
Automatic approval of vitess-bot clean backports (#14352)
1 parent cfef771 commit 72b037a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/auto_approve_pr.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Auto Approval of Bot Pull Requests
2+
on:
3+
pull_request:
4+
types: [opened, reopened]
5+
6+
jobs:
7+
auto_approve:
8+
name: Auto Approve Pull Request
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v3
13+
14+
- name: Auto Approve Pull Request
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
run: |
18+
# here we are checking that the PR has been created by the vitess-bot[bot] account and that it is not a draft
19+
# if there is a merge conflict in the backport, the PR will always be created as a draft, meaning we can rely
20+
# on checking whether or not the PR is a draft
21+
if [[ "${{github.event.pull_request.user.login}}" == "vitess-bot[bot]" ]] && [[ "${{github.event.pull_request.draft}}" == "false" ]]; then
22+
gh pr review ${{ github.event.pull_request.number }} --approve
23+
fi

0 commit comments

Comments
 (0)