diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b24662aaad..e33ff33ec1 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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 }}' @@ -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'