Check that PR titles do not reference issue (#8118)

This commit is contained in:
Hans-Peter Lehmann
2025-11-29 11:23:31 +01:00
committed by GitHub
parent 5e6355d514
commit 0e1a5da0de

19
.github/workflows/pr-conventions.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: PR Conventions
on:
pull_request:
types: [ opened, synchronize, reopened, edited, labeled, unlabeled ]
jobs:
pr-title:
name: "Title"
runs-on: ubuntu-latest
steps:
- name: Prevent issue reference in title
uses: actions/github-script@v7
with:
script: |
const issueRegex = /#\d+/i;
if (issueRegex.test(context.payload.pull_request.title)) {
core.setFailed("Please mention the issue number in the PR description, not in the title. Make sure to write 'closes: #<number>'.");
}