File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : PR Checklist
2+
3+ on :
4+ pull_request :
5+ types : [opened]
6+
7+ permissions :
8+ pull-requests : write
9+
10+ jobs :
11+ check-linked-issues :
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Get PR body
16+ id : pr-body
17+ run : |
18+ body="${{ github.event.pull_request.body }}"
19+ echo "body=${body}" >> $GITHUB_OUTPUT
20+
21+ - name : Check for linked issues
22+ id : check-issues
23+ run : |
24+ body="${{ github.event.pull_request.body }}"
25+ if echo "$body" | grep -iE "(closes|fixes|resolves|references|ref|close|fix|resolve) #[0-9]+"; then
26+ echo "has_issue=true" >> $GITHUB_OUTPUT
27+ else
28+ echo "has_issue=false" >> $GITHUB_OUTPUT
29+ fi
30+
31+ - name : Comment if no linked issue
32+ if : steps.check-issues.outputs.has_issue == 'false'
33+ uses : peter-evans/create-or-update-comment@v3
34+ with :
35+ token : ${{ secrets.GITHUB_TOKEN }}
36+ issue-number : ${{ github.event.pull_request.number }}
37+ body : |
38+ Hi @${{ github.event.pull_request.user.login }},
39+
40+ Looks like there is no issue linked in this PR. Please link this PR to an open issue using one of these keywords in the PR description:
41+ - Closes #issue-number
42+ - Fixes #issue-number
43+ - Resolves #issue-number
44+
45+ If there isn't an issue yet, please create one first and then link it to this PR.
You can’t perform that action at this time.
0 commit comments