Skip to content

Commit

Permalink
Merge pull request #63 from amiya-cyber/patch-1
Browse files Browse the repository at this point in the history
created pr checker automation workflow
  • Loading branch information
GauravKesh authored Oct 29, 2024
2 parents 0d304b7 + 8c5f9f2 commit f0d5348
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pr-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PR Issue Checker

on:
pull_request:
types: [opened, edited]

jobs:
check_pr_description:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Check PR Description
id: check_pr_description
run: |
PR_DESCRIPTION="${{ github.event.pull_request.body }}"
# Check if PR description is empty
if [[ -z "$PR_DESCRIPTION" ]]; then
echo "##[error]PR description is missing for CodeIt."
exit 1
fi
# Check if PR description includes 'Fixes #<issue-number>'
if [[ ! "$PR_DESCRIPTION" =~ Fixes\ #[0-9]+ ]]; then
echo "##[error]The PR description should include 'Fixes #<issue-number>' if addressing an issue for CodeIt."
exit 1
fi
echo "PR description is valid."
- name: Output result
if: success()
run: echo "All checks passed."

0 comments on commit f0d5348

Please sign in to comment.