-
Notifications
You must be signed in to change notification settings - Fork 50
38 lines (33 loc) · 1.27 KB
/
update-test-rules.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Update Test Rules
on:
issue_comment:
types: [created]
jobs:
update-branch:
name: Update test-rules Branch
permissions:
contents: read
issues: read
pull-requests: read
checks: read
runs-on: ubuntu-20.04
# https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#issue_comment
if: github.event.issue.pull_request && contains(github.event.comment.body, '/update-test-rules')
environment: test-rules
steps:
- name: Get PR branch
uses: alessbell/[email protected] # Fork of xt0rted/pull-request-comment-branch, see https://github.com/xt0rted/pull-request-comment-branch/issues/322
id: comment-branch
- name: Checkout PR branch
uses: actions/checkout@v3
with:
repository: ${{ steps.comment-branch.outputs.head_owner }}/${{ steps.comment-branch.outputs.head_repo }}
ref: ${{ steps.comment-branch.outputs.head_ref }}
fetch-depth: 0
- name: Wait for Rule Validation Succeed
uses: lewagon/[email protected]
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
check-name: 'Run Rule Validation'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10