Skip to content

Commit

Permalink
title
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Nov 15, 2024
1 parent b132597 commit 3d68fa9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PR Title Check

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
check-pr-title:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v2

- name: Validate PR title
id: validate
run: |
PR_TITLE=$(jq -r .pull_request.title "$GITHUB_EVENT_PATH")
echo "PR Title: $PR_TITLE"
if [[ ! "$PR_TITLE" =~ ^(feat|fix|docs|style|refactor|test|chore):\ .+ ]]; then
echo "PR title does not match the required pattern."
exit 1
fi
- name: Set status
if: failure()
run: |
gh pr comment ${{ github.event.pull_request.number }} --body "❌ PR title does not match the required pattern. Please use the format: 'type: description' (e.g., 'feat: add new feature')."

0 comments on commit 3d68fa9

Please sign in to comment.