chore: add an ection that ensures the PR title is valid (#6653)

This commit is contained in:
Frank Elsinga 2026-01-09 01:14:19 +01:00 committed by GitHub
parent 27c0ae8f1e
commit af26601f1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

31
.github/workflows/pr-title.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: "PR Metadata"
# if someone opens a PR, edits it, or reopens it we want to validate the title
# This is separate from the rest of the CI as the title may change without code changes
on:
# SECURITY: pull_request_target is used here to allow validation of PRs from forks.
# This is safe because:
# 1. No code from the PR is checked out
# 2. Permissions are restricted to pull-requests: read
# 3. Only a trusted third-party action is used to validate the PR title
# 4. No user-controlled code is executed
pull_request_target: # zizmor: ignore[dangerous-triggers]
types:
- opened
- edited
- reopened
- synchronize
permissions:
pull-requests: read
jobs:
pr-title:
name: Validate PR title follows https://conventionalcommits.org
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}