mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-03-11 15:59:49 +00:00
* ci: add permissions: {} to CI workflow with job-level contents: read
* ci: enforce least-privilege permissions in security workflow
* ci: enforce least-privilege permissions in commitlint workflow
* ci: enforce least-privilege permissions in pr-lint workflow and update actions
* ci: enforce least-privilege permissions in stale workflow and update actions
* ci: enforce least-privilege permissions in sync-labels workflow and update actions
* ci: enforce least-privilege permissions in release workflow and update actions
* chore(actions): update ivuorinen/actions/codeql-analysis (v2026.03.06 → v2026.03.09)
* chore(deps): update testdata composite action dependencies
42 lines
1.2 KiB
YAML
42 lines
1.2 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: {}
|
|
|
|
jobs:
|
|
commitlint:
|
|
name: Validate Commit Messages
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.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
|