-
-
Notifications
You must be signed in to change notification settings - Fork 216
70 lines (60 loc) · 2.02 KB
/
pr_opened.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: "pr_opened"
on:
pull_request_target:
types:
- opened
concurrency:
group: pr-${{ github.event.pull_request.number || github.ref }}
jobs:
check-ready:
runs-on: ubuntu-latest
steps:
- name: Add label
uses: andymckay/[email protected]
if: github.event.pull_request.draft == true
with:
add-labels: 'work in progress'
- name: Add label
uses: andymckay/[email protected]
if: tojson(github.event.pull_request.requested_reviewers) != '[]'
with:
add-labels: 'ready for review'
check-contrib:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check contrib
id: contrib
run: |
echo flag=$(scripts/rgh.py show_pr ${{ github.event.pull_request.number }} --json \
| jq -r .pull_request.contrib) >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.github_token }}
- name: Add label
if: steps.contrib.outputs.flag == 'true'
uses: andymckay/[email protected]
with:
add-labels: 'contribution'
check-issue:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check issue
id: issue
run: |
echo url=$(scripts/rgh.py show_pr ${{ github.event.pull_request.number }} --json \
| jq -r .issue.url) >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.github_token }}
- name: Post Comment
if: |
steps.issue.outputs.url == '' ||
steps.issue.outputs.url == 'null'
uses: thollander/actions-comment-pull-request@v2
with:
message: ":robot: Upon creation, pull request description does not have a link to an issue.
If there is a related issue, please add it to the description
using any of the [supported formats](https://docs.github.com/en/get-started/\
writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls)."