forked from ai16z/eliza
-
Notifications
You must be signed in to change notification settings - Fork 2
28 lines (23 loc) · 989 Bytes
/
pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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|fix|docs|style|refactor|test|chore: title')."