Skip to content

Commit f83ee40

Browse files
authored
Merge pull request #68 from amiya-cyber/patch-3
generated pr checker workflow
2 parents 0cefb91 + 76fff1e commit f83ee40

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/pr-checker.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
name: PR Issue Checker
3+
4+
on:
5+
pull_request:
6+
types: [opened, edited]
7+
8+
jobs:
9+
check_pr_description:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Check PR Description
17+
id: check_pr_description
18+
run: |
19+
PR_DESCRIPTION="${{ github.event.pull_request.body }}"
20+
if [[ -z "$PR_DESCRIPTION" ]]; then
21+
echo "PR description is missing."
22+
exit 1
23+
fi
24+
25+
if [[ ! "$PR_DESCRIPTION" =~ Fixes\ #[0-9]+ ]]; then
26+
echo "The PR description should include 'Fixes #<issue-number>' if not addressing any issue."
27+
echo "##[error]Fixes #NEW must be included in the description."
28+
exit 1
29+
fi
30+
31+
echo "PR description is valid."
32+
33+
- name: Output result
34+
run: echo "All checks passed."

0 commit comments

Comments
 (0)