Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"footer-max-line-length": [0, "always"],
"header-max-length": [2, "always", 72],
"references-empty": [1, "never"],
"subject-case": [0],
"scope-enum": [2, "always", ["mbe", "ebe", "docker"]],
"scope-empty": [0, "never"]
},
"parserPreset": {
"parserOpts": {
"issuePrefixes": ["BTC-", "COIN-", "WP-"]
}
}
}
34 changes: 34 additions & 0 deletions .github/workflows/commit-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Commit Lint

on: [push, pull_request]

permissions:
contents: read

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.1.0'
cache: 'yarn'

- name: Install dependencies
run: yarn install

- name: Print versions
run: |
git --version
node --version
yarn --version
npx commitlint --version

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
4 changes: 4 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ permissions:
packages: read # required for ArgoCD deploy

jobs:
commit-lint:
name: Commit Lint
uses: ./.github/workflows/commit-lint.yaml

build-and-test:
name: Build & Test (CI)
uses: ./.github/workflows/build-and-test.yaml
34 changes: 34 additions & 0 deletions git_commit_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

# ^ Subject Line
# Capitalize, do not end with a period, use the imperative mood
# Limit the subject line to no more than 72 characters: end here --> |


# ^ Body
# Separate subject from body with a blank line, wrap at 72 characters|
# Use the body to explain what and why

Ticket: PROJECT-NUMBER
# ^ Metadata: keyword: <value>

########################################################################
# #
# BitGo Commit Message Standard #
# (info inlined above as well) #
# #
# #
########################################################################
# Commit Message SHALL
# …limit the subject line to no more than 72 characters
# …capitalize the subject line
# …not end the subject line with a period
# …use the imperative mood in the subject line
# …separate subject from body with a blank line
# …wrap the body at 72 characters
#
# Commit Message SHOULD use the body to explain what and why vs. how
#
# Commit Message metadata SHALL be at the bottom of the commit message
# Commit Message metadata MUST follow format “keyword: <value>”
# Commit Message metadata SHOULD contain a ticket reference in the format “Ticket: PROJECT-NUMBER”
#
Loading