Skip to content

chore(CI)!: add commlint #2399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
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
26 changes: 23 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ name: 'lint'
on:
workflow_dispatch:
pull_request:
branches:
- main
types: [opened, edited, reopened, synchronize]
branches: [main]

permissions:
contents: read

concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
Expand All @@ -47,8 +50,25 @@ jobs:
- run: docker run --rm -e ENABLE_BPMETADATA -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} module-swapper
env:
ENABLE_BPMETADATA: 1

- run: docker run --rm -e ENABLE_BPMETADATA -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} /usr/local/bin/test_lint.sh
env:
ENABLE_BPMETADATA: 1

commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install commitlint
run: |
npm install -D @commitlint/cli @commitlint/config-conventional
echo "module.exports = { extends: ['@commitlint/config-conventional'], };" > commitlint.config.js
npx commitlint --version
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: 'echo "${{ github.event.pull_request.title }}" | npx commitlint --verbose'