-
Notifications
You must be signed in to change notification settings - Fork 30
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 #63 from amiya-cyber/patch-1
created pr checker automation workflow
- Loading branch information
Showing
1 changed file
with
32 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,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." |