Skip to content

Commit 1b8f194

Browse files
authored
chore(CI): add commlint PoC (#2399)
1 parent 7ca51ab commit 1b8f194

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

.github/workflows/lint.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ name: 'lint'
2020
on:
2121
workflow_dispatch:
2222
pull_request:
23-
branches:
24-
- main
23+
types: [opened, edited, reopened, synchronize]
24+
branches: [main]
25+
26+
permissions:
27+
contents: read
2528

2629
concurrency:
2730
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
@@ -47,8 +50,25 @@ jobs:
4750
- run: docker run --rm -e ENABLE_BPMETADATA -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} module-swapper
4851
env:
4952
ENABLE_BPMETADATA: 1
50-
5153
- run: docker run --rm -e ENABLE_BPMETADATA -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} /usr/local/bin/test_lint.sh
5254
env:
5355
ENABLE_BPMETADATA: 1
5456

57+
commitlint:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
with:
62+
fetch-depth: 0
63+
- name: Setup node
64+
uses: actions/setup-node@v4
65+
with:
66+
node-version: lts/*
67+
- name: Install commitlint
68+
run: |
69+
npm install -D @commitlint/[email protected] @commitlint/[email protected]
70+
echo "module.exports = { extends: ['@commitlint/config-conventional'], };" > commitlint.config.js
71+
npx commitlint --version
72+
- name: Validate PR commits with commitlint
73+
if: github.event_name == 'pull_request'
74+
run: 'echo "${{ github.event.pull_request.title }}" | npx commitlint --verbose'

0 commit comments

Comments
 (0)