Skip to content

Commit

Permalink
Merge pull request ajaynegi45#78 from smog-root/patch-1
Browse files Browse the repository at this point in the history
Implement GitHub PR Issue Checker Workflow
  • Loading branch information
ajaynegi45 authored Oct 19, 2024
2 parents ad7921a + c0f5ce4 commit 3cd9bfe
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: PR Issue Checker
# Created my @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\ #[0-9]+ ]]; then
echo "The PR description should include 'Fixes #<issue-number>' if not addressing any issue."
echo "##[error]Fixes #NEW must be included in the description."
exit 1
fi
echo "PR description is valid."
- name: Output result
run: echo "All checks passed."

0 comments on commit 3cd9bfe

Please sign in to comment.