Skip to content

Commit

Permalink
Github action PR Issue checker
Browse files Browse the repository at this point in the history
  • Loading branch information
ygowthamr committed Oct 17, 2024
1 parent 8b76b37 commit 0222a75
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/prIssueChecker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PR Description Check

on:
pull_request:
types: [opened]

jobs:
validate-pr-description:
steps:
- name: Check if PR description exists
id: check_description
run: |
if [ -z "${{ github.event.pull_request.body }}" ]; then
echo "::error::Description is missing!"
exit 1
fi
- name: Check for issue number or 'Fixes #NEW'
id: check_issue_number
run: |
description="${{ github.event.pull_request.body }}"
if [[ ! "$description" =~ (Fixes #[0-9]+|Fixes #NEW) ]]; then
echo "::error::PR description must contain an issue number or 'Fixes #NEW'"
exit 1
fi

0 comments on commit 0222a75

Please sign in to comment.