Skip to content

Commit fb718a4

Browse files
mohammadalfaiyazbitgopranavjain97
authored andcommitted
ci: enable commit lint for future commits
Ticket: WP-5314
1 parent 64f65f5 commit fb718a4

6 files changed

Lines changed: 46483 additions & 1794 deletions

File tree

.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/build-and-test.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@ on:
99
default: '22.1.0'
1010

1111
jobs:
12+
commit-lint:
13+
name: Commit Lint
14+
runs-on: ubuntu-latest
15+
if: github.event_name == 'pull_request'
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ inputs.node-version }}
26+
cache: 'yarn'
27+
28+
- name: Install dependencies
29+
run: yarn install
30+
31+
- name: Validate PR commits with commitlint
32+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
33+
1234
build:
1335
name: Build
1436
runs-on: ubuntu-latest
@@ -31,6 +53,7 @@ jobs:
3153
lint:
3254
name: Run lint
3355
runs-on: ubuntu-latest
56+
needs: [commit-lint]
3457
steps:
3558
- name: Checkout
3659
uses: actions/checkout@v4

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)