Skip to content

Commit a9c1ac1

Browse files
committed
chore: add autoapprove-staging-reset workflow
1 parent 7bfe5f7 commit a9c1ac1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Auto-approve staging resets
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- reset-base # XXX: default branch / target for staging reset
7+
8+
permissions:
9+
contents: read
10+
pull_requests: write
11+
12+
jobs:
13+
auto-approve:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: auto approve
17+
if: startsWith(github.head_ref, 'staging-reset/staging-')
18+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
19+
with:
20+
script: |
21+
github.rest.pulls.createReview({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
pull_number: "${{ github.ref }}".split("/")[2],
25+
body: "Auto-approved via action for staging reset",
26+
event: "APPROVE"
27+
});

0 commit comments

Comments
 (0)