forked from cadence-workflow/cadence-web
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (63 loc) · 2.06 KB
/
semantic-pr.yml
File metadata and controls
72 lines (63 loc) · 2.06 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Semantic Pull Request
on:
pull_request:
types:
- opened
- edited
- synchronize
jobs:
semantic-pr:
name: Validate PR title follows conventional commit format
runs-on: ubuntu-latest
# TODO: Remove this once we commit to conventional commits
continue-on-error: true
steps:
- name: Validate PR title
id: lint_pr_title
uses: amannn/action-semantic-pull-request@v5.4.0
with:
# Allow standard conventional commit types
types: |
fix
feat
docs
style
refactor
perf
test
chore
ci
build
# TODO: Remove this once we've decided on scopes
requireScope: false
# Skip validation for certain labels if needed
ignoreLabels: |
skip-commit-format
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on PR if validation fails
if: steps.lint_pr_title.outputs.error_message != null
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `⚠️ **Semantic PR Check Failed**
**Error Details:**
\`\`\`
${{ steps.lint_pr_title.outputs.error_message }}
\`\`\`
**Required Format:**
\`\`\`
<type>: <description>
\`\`\`
**Allowed types:** fix, feat, docs, style, refactor, perf, test, chore, ci, build
**Examples:**
- \`feat: add user authentication system\`
- \`fix: resolve memory leak in worker pool\`
- \`docs: update API documentation\`
- \`test: add integration tests for auth flow\`
This is currently a **warning only** and won't block your PR from being merged.`
})