generated from pheonix-coder/flask-minimal-template
-
Notifications
You must be signed in to change notification settings - Fork 50
33 lines (27 loc) · 973 Bytes
/
pr-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
name: PR Issue Checker
# Created by @smog-root.
on:
pull_request:
types: [opened, edited]
jobs:
check_pr_description:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check PR Description
id: check_pr_description
run: |
PR_DESCRIPTION="${{ github.event.pull_request.body }}"
if [[ -z "$PR_DESCRIPTION" ]]; then
echo "PR description is missing."
exit 1
fi
if [[ ! "$PR_DESCRIPTION" =~ (Fixes|Closes|Fixed|Fix)\ #[0-9]+ ]]; then
echo "The PR description should include 'Fixes #<issue-number>' or 'Closes #<issue-number>' if addressing an issue."
echo "##[error]Fixes #<issue-number> or Closes #<issue-number> must be included in the description."
exit 1
fi
echo "PR description is valid."
- name: All checks passed
run: echo "All checks passed."