From 1bba2ff515778bddb2c71bb06a852d745c51dec5 Mon Sep 17 00:00:00 2001 From: ItsPaulAT <76869048+ItsPaulAT@users.noreply.github.com> Date: Wed, 21 Oct 2026 04:33:49 +0200 Subject: [PATCH 1/2] fix(ci): let Dependabot's capitalised titles pass the PR-title check Same change as luminare-dev/oss-template#2: only the lower-case rule is relaxed for PRs authored by dependabot[bot]. Signed-off-by: ItsPaulAT <76869048+ItsPaulAT@users.noreply.github.com> --- .github/workflows/reusable-ci.yml | 1 + scripts/check_pr_title.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml index 70d28e9..0f1b22a 100644 --- a/.github/workflows/reusable-ci.yml +++ b/.github/workflows/reusable-ci.yml @@ -120,4 +120,5 @@ jobs: - name: Conventional Commit title with offer-free wording env: PR_TITLE: ${{ github.event.pull_request.title }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} run: python3 scripts/check_pr_title.py diff --git a/scripts/check_pr_title.py b/scripts/check_pr_title.py index a7ec877..ed5942d 100755 --- a/scripts/check_pr_title.py +++ b/scripts/check_pr_title.py @@ -7,7 +7,7 @@ * pass the wording check from scripts/forbidden_words.py (offer-free release notes). Usage: python3 scripts/check_pr_title.py "feat(backup): add a restore drill" - PR_TITLE="..." python3 scripts/check_pr_title.py (how CI calls it) + PR_TITLE="..." PR_AUTHOR="login" python3 scripts/check_pr_title.py (how CI calls it) Exit codes: 0 ok, 1 rejected, 2 no title given. """ @@ -26,9 +26,12 @@ TYPES = ("feat", "fix", "docs", "refactor", "perf", "test", "style", "build", "ci", "chore", "revert", "security") TITLE_RE = re.compile(r"^(?P[a-z]+)(?:\((?P[a-z0-9][a-z0-9._/-]*)\))?(?P!)?: (?P\S.*)$") MAX_LENGTH = 100 +# Bots whose titles follow Conventional Commits but start the summary with a capital ("Bump ..."). +# Only the lower-case rule is relaxed for them; format, types, length and wording still apply. +CAPITALISED_SUMMARY_OK = ("dependabot[bot]",) -def problems(title: str) -> list[str]: +def problems(title: str, author: str = "") -> list[str]: title = title.strip() out: list[str] = [] m = TITLE_RE.match(title) @@ -41,7 +44,8 @@ def problems(title: str) -> list[str]: subject = m.group("subject") if subject.endswith("."): out.append("the summary must not end with a full stop") - if subject[:1].isupper() and not subject.split()[0].isupper(): + if (subject[:1].isupper() and not subject.split()[0].isupper() + and author not in CAPITALISED_SUMMARY_OK): out.append("the summary must start with a lower-case letter (imperative mood: 'add', 'fix')") if len(title) > MAX_LENGTH: out.append(f"the title is {len(title)} characters long; keep it to {MAX_LENGTH}") @@ -55,7 +59,7 @@ def main(argv: list[str] | None = None) -> int: if not title.strip(): print("error: no pull request title given", file=sys.stderr) return 2 - found = problems(title) + found = problems(title, os.environ.get("PR_AUTHOR", "")) for prob in found: print(f"error: {prob}") if not found: From 7246a2b85df223b0606761fb14b2150299278ba2 Mon Sep 17 00:00:00 2001 From: ItsPaulAT <76869048+ItsPaulAT@users.noreply.github.com> Date: Wed, 21 Oct 2026 04:34:30 +0200 Subject: [PATCH 2/2] test: pin the template copies to luminare-dev/oss-template#2 Signed-off-by: ItsPaulAT <76869048+ItsPaulAT@users.noreply.github.com> --- tests/test_template_copies.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_template_copies.py b/tests/test_template_copies.py index afc91d1..2cf8664 100644 --- a/tests/test_template_copies.py +++ b/tests/test_template_copies.py @@ -16,14 +16,14 @@ ROOT = Path(__file__).resolve().parent.parent TEMPLATE = ROOT.parent / "oss-template" -SOURCE_COMMIT = "9a47a307004b95567ae30d917aaa4536eda4045f" # luminare-dev/oss-template, 2026-10-07 +SOURCE_COMMIT = "d917a85a876c5f5e83b5001002ed777056655c52" # luminare-dev/oss-template#2, 2026-10-21 COPIES = { "scripts/forbidden_words.py": "dd4773373f182e457c0200036e0a010f6df880f506e6b5087f7935255300834e", "scripts/set_byline.py": "7655a30b5d00ccdb88fa468e97055ffac8dcf74fa4c6c3f0695eb0af8787f0e1", "scripts/check_workflows.py": "3c0a075411d2f0e0143ab130be638d3de7ba3dedc2ce64af19d7f3afb664b247", - "scripts/check_pr_title.py": "a3dc57b7702cd58ff5f98f000bf898964fefa21a029d40644b8d60ab9a4b28ed", + "scripts/check_pr_title.py": "a20da7141a68c291c1c023fab0cd1fb077b718132beae5d69db187bd7322a71d", ".github/workflows/pr-title.yml": "2e6c2aa6b2eef94c5c2a22a30482d9650aab86ff9de88a6a18ba4c7ebf61db6b", - ".github/workflows/reusable-ci.yml": "377426a9f5b64960698693b2a04d6b9846c9fab37689d497e2b2346df15e134d", + ".github/workflows/reusable-ci.yml": "c9c99667f9389f4c64f8716ea36623a72db682e996d6d1c2f7b6f6f3f3a65af9", ".github/workflows/reusable-gitleaks.yml": "696a42a07731eaa36bd2237e7f7853cb1c664306b51a7d84e156d3d0f069abf6", ".gitleaks.toml": "0e9a0915d0bc2636c6b59f8d0c8631fb64def2d9224f7c99b9e4709dc7d62d72", }