Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github action PR Issue checker #184

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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