Skip to content

Commit

Permalink
Merge pull request #184 from ygowthamr/PrIssueChecker
Browse files Browse the repository at this point in the history
Github action PR Issue checker
  • Loading branch information
Harshdev098 authored Oct 17, 2024
2 parents e31dd5c + 53b9763 commit fb4f611
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/PRValidator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PR Description Check

on:
pull_request:
types: [opened]

jobs:
validate-pr-description:
runs-on: ubuntu-latest
steps:
- name: Validate PR Description
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 fb4f611

Please sign in to comment.