-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(DEV-106): pr_validation file added.
- Loading branch information
1 parent
48a3b93
commit a06ed7b
Showing
1 changed file
with
27 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,27 @@ | ||
name: PR Validation | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited] | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check PR Title and Description | ||
run: | | ||
title="${{ github.event.pull_request.title }}" | ||
description="${{ github.event.pull_request.body }}" | ||
# Validate PR title | ||
if [[ "$title" != *"feat"* ]] && \ | ||
[[ "$title" != *"fix"* ]] && \ | ||
[[ "$title" != *"refactor"* ]] && \ | ||
[[ "$title" != *"style"* ]] && \ | ||
[[ "$title" != *"chore"* ]]; then | ||
echo "Error: Pull request title must include 'feat', 'fix', 'refactor', 'style' or 'chore'." | ||
exit 1 | ||
fi | ||
echo "Pull request title and description are valid." |