Skip to content

Commit a8845c4

Browse files
committed
ci: Replace outdated commitlint action
Use the commitlint npm package directly instead as recommended at: https://commitlint.js.org/guides/ci-setup.html Also align husky and package.json script with ui5/cli repo
1 parent a2a14fb commit a8845c4

5 files changed

Lines changed: 12 additions & 27 deletions

File tree

.github/workflows/commitlint.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/github-ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919

2020
- uses: actions/checkout@v6
21+
with:
22+
fetch-depth: 0
2123

2224
- name: Setup Node.js
2325
uses: actions/setup-node@v6
@@ -33,6 +35,14 @@ jobs:
3335
- name: Perfrom ESLint check
3436
run: npm run lint
3537

38+
- name: Validate current commit (last commit) with commitlint
39+
if: github.event_name == 'push'
40+
run: npm run lint:commit -- --last --verbose
41+
42+
- name: Validate PR commits with commitlint
43+
if: github.event_name == 'pull_request'
44+
run: npm run lint:commit -- --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
45+
3646
- name: Perfrom Licenses check
3747
run: npm run check-licenses
3848

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run lint:commit -- --edit "$1" # Lint currently edited commit message

.husky/pre-push

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@
3939
"scripts": {
4040
"check-licenses": "licensee --errors-only",
4141
"knip": "knip --config knip.config.js",
42-
"hooks:pre-push": "npm run lint:commit",
4342
"lint": "npm run lint --workspaces --if-present",
44-
"lint:commit": "commitlint -e",
43+
"lint:commit": "commitlint",
4544
"prepare": "node ./.husky/skip.js || husky",
4645
"check-engine": "check-engine-light .",
4746
"test": "npm run test --workspaces --if-present && npm run knip",

0 commit comments

Comments
 (0)