-
Notifications
You must be signed in to change notification settings - Fork 182
38 lines (32 loc) · 1.25 KB
/
checker.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: PR has a valid Issue?
on:
pull_request_target:
types: [ edited, synchronize, opened, reopened ]
jobs:
checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Issue Validator
uses: HarshCasper/[email protected]
id: validator
with:
prbody: ${{ github.event.pull_request.body }}
prurl: ${{ github.event.pull_request.url }}
- name: PR has a valid Issue
if: ${{ steps.validator.outputs.valid == 1 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRNUM: ${{ github.event.pull_request.number }}
run: |
gh pr edit $PRNUM --add-label "PR:Ready-to-Review"
gh pr edit $PRNUM --add-label "hacktoberfest-accepted"
gh pr edit $PRNUM --remove-label "PR:No-Issue"
- name: PR has no valid Issue
if: ${{ steps.validator.outputs.valid == 0 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRNUM: ${{ github.event.pull_request.number }}
run: |
gh pr comment $PRNUM --body "PR is not linked to any issue, please make the corresponding changes in the body."
gh pr edit $PRNUM --add-label "PR:No-Issue"