-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #184 from ygowthamr/PrIssueChecker
Github action PR Issue checker
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |