forked from paritytech/substrate
-
Notifications
You must be signed in to change notification settings - Fork 15
42 lines (40 loc) · 1.54 KB
/
pr-custom-review.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
39
40
41
42
name: Assign reviewers
on:
pull_request:
branches:
- master
- main
types:
- opened
- reopened
- synchronize
- review_requested
- review_request_removed
- ready_for_review
- converted_to_draft
pull_request_review:
jobs:
pr-custom-review:
runs-on: ubuntu-latest
steps:
- name: Skip if pull request is in Draft
# `if: github.event.pull_request.draft == true` should be kept here, at
# the step level, rather than at the job level. The latter is not
# recommended because when the PR is moved from "Draft" to "Ready to
# review" the workflow will immediately be passing (since it was skipped),
# even though it hasn't actually ran, since it takes a few seconds for
# the workflow to start. This is also disclosed in:
# https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17
# That scenario would open an opportunity for the check to be bypassed:
# 1. Get your PR approved
# 2. Move it to Draft
# 3. Push whatever commits you want
# 4. Move it to "Ready for review"; now the workflow is passing (it was
# skipped) and "Check reviews" is also passing (it won't be updated
# until the workflow is finished)
if: github.event.pull_request.draft == true
run: exit 1
- name: pr-custom-review
uses: paritytech/pr-custom-review@action-v3
with:
checks-reviews-api: http://pcr.parity-prod.parity.io/api/v1/check_reviews