Skip to content

Commit a917931

Browse files
ci: enable commit lint for future commits
Ticket: WP-5314
1 parent 0e5ab4f commit a917931

File tree

7 files changed

+46498
-1794
lines changed

7 files changed

+46498
-1794
lines changed

.commitlintrc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"],
3+
"rules": {
4+
"footer-max-line-length": [0, "always"],
5+
"header-max-length": [2, "always", 72],
6+
"references-empty": [1, "never"],
7+
"subject-case": [0],
8+
"scope-enum": [2, "always", ["mbe", "ebe", "docker"]],
9+
"scope-empty": [0, "never"]
10+
},
11+
"parserPreset": {
12+
"parserOpts": {
13+
"issuePrefixes": ["BTC-", "COIN-", "WP-"]
14+
}
15+
}
16+
}

.github/workflows/commit-lint.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Commit Lint
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
commitlint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22.1.0'
20+
cache: 'yarn'
21+
22+
- name: Install dependencies
23+
run: yarn install
24+
25+
- name: Print versions
26+
run: |
27+
git --version
28+
node --version
29+
yarn --version
30+
npx commitlint --version
31+
32+
- name: Validate PR commits with commitlint
33+
if: github.event_name == 'pull_request'
34+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

.github/workflows/pull_request.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ permissions:
1212
packages: read # required for ArgoCD deploy
1313

1414
jobs:
15+
commit-lint:
16+
name: Commit Lint
17+
uses: ./.github/workflows/commit-lint.yaml
18+
1519
build-and-test:
1620
name: Build & Test (CI)
1721
uses: ./.github/workflows/build-and-test.yaml

git_commit_template.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
# ^ Subject Line
3+
# Capitalize, do not end with a period, use the imperative mood
4+
# Limit the subject line to no more than 72 characters: end here --> |
5+
6+
7+
# ^ Body
8+
# Separate subject from body with a blank line, wrap at 72 characters|
9+
# Use the body to explain what and why
10+
11+
Ticket: PROJECT-NUMBER
12+
# ^ Metadata: keyword: <value>
13+
14+
########################################################################
15+
# #
16+
# BitGo Commit Message Standard #
17+
# (info inlined above as well) #
18+
# #
19+
# #
20+
########################################################################
21+
# Commit Message SHALL
22+
# …limit the subject line to no more than 72 characters
23+
# …capitalize the subject line
24+
# …not end the subject line with a period
25+
# …use the imperative mood in the subject line
26+
# …separate subject from body with a blank line
27+
# …wrap the body at 72 characters
28+
#
29+
# Commit Message SHOULD use the body to explain what and why vs. how
30+
#
31+
# Commit Message metadata SHALL be at the bottom of the commit message
32+
# Commit Message metadata MUST follow format “keyword: <value>”
33+
# Commit Message metadata SHOULD contain a ticket reference in the format “Ticket: PROJECT-NUMBER”
34+
#

0 commit comments

Comments
 (0)