Skip to content

ci: add conventional commits linter #1

ci: add conventional commits linter

ci: add conventional commits linter #1

name: Check pull requests

Check failure on line 1 in .github/workflows/conventional-commits.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/conventional-commits.yml

Invalid workflow file

you may only define one of `branches` and `branches-ignore` for a single event
on:
push:
branches: '*'
branches-ignore: # Run the checks on all branches but the protected ones
- master
- release/*
pull_request_target:
branches:
- master
- release/*
types:
- opened
- edited
- reopened
- ready_for_review
jobs:
check-conventional-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: master # Always load the latest workflow, not the branch's
sparse-checkout: |
.github
- if: ${{ github.event.pull_request }}
run: |
set -ex
node .github/workflows/conventional-commits-lint.js pr <<EOF
${{ github.event.pull_request && toJSON(github.event.pull_request) }}
EOF
- if: ${{ github.event.push }}
run: |
set -ex
node .github/workflows/conventional-commits-lint.js push <<EOF
${{ github.event.push && toJSON(github.event.push) }}
EOF