Skip to content

Commit

Permalink
Added PrValidator github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ygowthamr committed Oct 17, 2024
1 parent b6d3f29 commit 21d146b
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 21d146b

Please sign in to comment.