Skip to content

Commit

Permalink
Merge branch 'dev' into feat/git-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sohitkumar authored Oct 7, 2024
2 parents a7d2a4e + ce0d2e4 commit c2185e3
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/pr_validation.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR Validation
name: PR Title Validation

on:
pull_request:
Expand All @@ -9,19 +9,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Check PR Title and Description
- name: Check PR Title
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'."
if [[ "$title" != feat* ]] && \
[[ "$title" != fix* ]] && \
[[ "$title" != refactor* ]] && \
[[ "$title" != style* ]] && \
[[ "$title" != chore* ]]; then
echo "Error: Pull request title must start with 'feat', 'fix', 'refactor', 'style', or 'chore'."
exit 1
fi
echo "Pull request title and description are valid."
echo "Pull request title is valid."

0 comments on commit c2185e3

Please sign in to comment.