Skip to content

Commit 523baa4

Browse files
ci: split fork-PR build from trusted review job
1 parent a0fd0ee commit 523baa4

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/pr-review.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: PR Review
2+
3+
on:
4+
workflow_run:
5+
workflows: [Test]
6+
types: [completed]
7+
8+
permissions:
9+
pull-requests: write
10+
actions: read
11+
contents: read
12+
13+
jobs:
14+
review:
15+
runs-on: ubuntu-latest
16+
if: ${{ github.event.workflow_run.event == 'pull_request' }}
17+
18+
steps:
19+
- name: Download PR number
20+
uses: actions/download-artifact@v4
21+
with:
22+
name: pr-number
23+
run-id: ${{ github.event.workflow_run.id }}
24+
github-token: ${{ github.token }}
25+
26+
- name: Read PR number
27+
id: pr
28+
run: echo "number=$(cat pr-number.txt)" >> "$GITHUB_OUTPUT"
29+
30+
- uses: mate-academy/auto-approve-action@v2
31+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
32+
with:
33+
github-token: ${{ github.token }}
34+
pull-request-number: ${{ steps.pr.outputs.number }}
35+
36+
- uses: mate-academy/auto-reject-action@v2
37+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
38+
with:
39+
github-token: ${{ github.token }}
40+
pull-request-number: ${{ steps.pr.outputs.number }}

0 commit comments

Comments
 (0)