Skip to content

Commit b1f90cc

Browse files
chore: update .github/workflows/lint.yaml
1 parent 17e5660 commit b1f90cc

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/lint.yaml

Lines changed: 23 additions & 2 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 }}'
@@ -46,3 +49,21 @@ jobs:
4649
fi
4750
- run: docker run --rm -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} module-swapper
4851
- run: docker run --rm -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} /usr/local/bin/test_lint.sh
52+
commitlint:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
with:
57+
fetch-depth: 0
58+
- name: Setup node
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: lts/*
62+
- name: Install commitlint
63+
run: |
64+
npm install -D @commitlint/cli@19.8.1 @commitlint/config-conventional@19.8.1
65+
echo "module.exports = { extends: ['@commitlint/config-conventional'], rules: {'subject-case': [0]} };" > commitlint.config.js
66+
npx commitlint --version
67+
- name: Validate PR commits with commitlint
68+
if: github.event_name == 'pull_request'
69+
run: 'echo "${{ github.event.pull_request.title }}" | npx commitlint --verbose'

0 commit comments

Comments
 (0)