Skip to content

Commit 143a8de

Browse files
authored
ci(common): merge commitlint ruleset and action (#1366)
1 parent fcc1f9b commit 143a8de

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/config/commitlint.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ const Configuration = {
2020
*/
2121
rules: {
2222
'type-empty': [RuleConfigSeverity.Error, 'never'],
23+
'scope-enum': [RuleConfigSeverity.Error, 'always',
24+
[
25+
'coprocessor',
26+
'host-contracts',
27+
'gateway-contracts',
28+
'protocol-contracts',
29+
'contracts',
30+
'library-solidity',
31+
'kms-connector',
32+
'sdk',
33+
'test-suite',
34+
'charts',
35+
'common'
36+
]
37+
],
2338
},
2439
};
2540

.github/workflows/common-pull-request-lint.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ jobs:
3737
- name: Install & run commitlint
3838
if: ${{ !startsWith(github.head_ref, 'mergify/merge-queue/') }}
3939
env:
40-
BASE_SHA: ${{ github.event.pull_request.base.sha }}
41-
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
40+
PR_TITLE: ${{ github.event.pull_request.title }}
4241
run: |
4342
npm install @commitlint/config-conventional@^18 conventional-changelog-conventionalcommits @commitlint/types@^18
4443
npm install -g @commitlint/cli@^18
45-
npx commitlint --config .github/config/commitlint.config.js --from "${BASE_SHA}" --to "${HEAD_SHA}" --verbose
44+
echo "$PR_TITLE" | npx commitlint --config .github/config/commitlint.config.js --verbose
4645
4746
- name: Run zizmor 🌈
4847
uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0

0 commit comments

Comments
 (0)