Skip to content

Commit

Permalink
chore(DEV-106): pr_validation file added.
Browse files Browse the repository at this point in the history
  • Loading branch information
sohitkumar committed Oct 7, 2024
1 parent 48a3b93 commit a06ed7b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/pr_validation.yml
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."

0 comments on commit a06ed7b

Please sign in to comment.