Files
gh-action-readme/.github/workflows/commitlint.yml
renovate[bot] 9e25e0925f chore(deps): update actions/checkout action (v6.0.1 → v6.0.2) (#152)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-24 18:48:44 +02:00

41 lines
1.1 KiB
YAML

---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Commit Messages
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
permissions:
contents: read
jobs:
commitlint:
name: Validate Commit Messages
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: "24"
- name: Install commitlint
run: |
npm install --save-dev @commitlint/cli@19.6.1 @commitlint/config-conventional@19.6.0
- name: Validate current commit (for single commits)
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose
- name: Validate PR commits
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose