-
-
Notifications
You must be signed in to change notification settings - Fork 36
42 lines (37 loc) · 1.57 KB
/
Check if issue exists.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: PR has a valid Issue?
on:
pull_request_target:
types: [ edited, synchronize, opened, reopened ]
jobs:
checker:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: "Issue number validator"
uses: ./.github/actions/PR_has_a_valid_issue/
id: validator
with:
prbody: ${{ github.event.pull_request.body }}
prurl: ${{ github.event.pull_request.url }}
- name: "Validation action on 1"
if: ${{ steps.validator.outputs.valid == 1 }}
run: |
echo $Github_Token > mytoken.txt
gh auth login --with-token < mytoken.txt
gh pr edit $PRNUM --add-label "PR:Ready-to-Review"
gh pr edit $PRNUM --remove-label "PR:No-Issue"
rm mytoken.txt
env:
Github_Token: ${{ secrets.GITHUB_TOKEN }}
PRNUM: ${{ github.event.pull_request.number }}
- name: "Validation action on 0"
if: ${{ steps.validator.outputs.valid == 0 }}
run: |
echo $Github_Token > mytoken.txt
gh auth login --with-token < mytoken.txt
gh pr comment $PRNUM --body "PR is not linked to any issue, please make the corresponding changes in the body. The issue should look like [this](https://i.imgur.com/7952Qx1.png). For help follow this [link](https://github.com/ashutoshkrris/EazyLoader/blob/main/CONTRIBUTING.md)"
gh pr edit $PRNUM --add-label "PR:No-Issue"
rm mytoken.txt
env:
Github_Token: ${{ secrets.GITHUB_TOKEN }}
PRNUM: ${{ github.event.pull_request.number }}