Skip to content

Commit

Permalink
Merge pull request #953 from ygowthamr/patch-1
Browse files Browse the repository at this point in the history
Added PR Validator Workflow
  • Loading branch information
PriyaGhosal authored Oct 18, 2024
2 parents e0a1cf5 + 82cb2c4 commit d1e1ee9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/PrValidator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PR Description Check

on:
pull_request:
types: [opened,edited]

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 'Fix #NEW'
id: check_issue_number
run: |
description="${{ github.event.pull_request.body }}"
if [[ ! "$description" =~ (?i)fix #[0-9]+|(?i)fix #NEW ]]; then
echo "::error::PR description must contain an issue number or 'Fix #NEW'"
exit 1
fi

0 comments on commit d1e1ee9

Please sign in to comment.