generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 149
79 lines (72 loc) · 2.61 KB
/
commitlint.yaml
File metadata and controls
79 lines (72 loc) · 2.61 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
73
74
75
76
77
78
79
name: Commit Lint
on:
pull_request:
branches:
- main
permissions:
contents: read
jobs:
commitlint:
name: Lint Commit Messages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install commitlint
run: npm install --save-dev @commitlint/{cli,config-conventional}
- name: Lint commits
id: lint
run: |
npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose 2>&1 | tee commitlint-output.txt
continue-on-error: true
- name: Show help on failure
if: steps.lint.outcome == 'failure'
run: |
echo ""
echo "============================================"
echo " ❌ Commit message lint failed"
echo "============================================"
echo ""
echo "One or more commit messages in this PR don't follow the"
echo "Conventional Commits format required by this project."
echo ""
echo "Required format:"
echo ""
echo " <type>: <description> (max 120 chars for the full header)"
echo ""
echo "Allowed types:"
echo " feat, fix, docs, example, examples, chore,"
echo " refactor, perf, test, ci, revert"
echo ""
echo "Examples:"
echo " feat: add support for streaming responses"
echo " fix: resolve timeout on large payloads"
echo " docs: update configuration guide"
echo " chore: bump dependency versions"
echo " refactor: simplify request routing logic"
echo ""
echo "Optional body/footer (no line-length limit):"
echo ""
echo " feat: add retry logic for failed requests"
echo " "
echo " Adds exponential backoff with jitter when upstream"
echo " returns 5xx. Configurable via RETRY_COUNT env var."
echo " "
echo " Closes #142"
echo ""
echo "Tip: To fix the most recent commit message, run:"
echo " git commit --amend"
echo ""
echo "To reword older commits in this PR, use interactive rebase:"
echo " git rebase -i origin/main"
echo ""
echo "For the full spec, see: https://www.conventionalcommits.org"
echo "============================================"
echo ""
exit 1