Skip to content

Commit

Permalink
Merge pull request #516 from siri-chandana-macha/main
Browse files Browse the repository at this point in the history
created pr-checker
  • Loading branch information
ankit071105 authored Oct 22, 2024
2 parents 1294b27 + 562b457 commit d489119
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PR Issue Checker
# Created by @siri-chandana-macha
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
# Allow any text before #<issue-number>
if [[ ! "$PR_DESCRIPTION" =~ .*\ #[0-9]+ ]]; then
echo "The PR description should include the issue number assigned to you.⚠️"
echo "##[error]An issue reference like 'Fixed #<issue-number>' 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 d489119

Please sign in to comment.