Skip to content

SRE-715: Add reusable workflow enforcing Linear issue ID in PR titles#65

Merged
TimDiekmann merged 3 commits into
mainfrom
t/sre-715-enforce-linear-issue-id-in-pr-titles
May 22, 2026
Merged

SRE-715: Add reusable workflow enforcing Linear issue ID in PR titles#65
TimDiekmann merged 3 commits into
mainfrom
t/sre-715-enforce-linear-issue-id-in-pr-titles

Conversation

@TimDiekmann
Copy link
Copy Markdown
Member

@TimDiekmann TimDiekmann commented May 22, 2026

Summary

  • New reusable workflow preflight-pr-title.yml that fails when a PR title is missing a Linear issue ID (e.g. H-1234, BE-5678, SRE-715) in the prefix segment (text before the first :).
  • Mirrors the prefix-parsing convention already used by preflight-todo-comments.yml, so both checks key off the same set of IDs.
  • Skips bot-authored PRs by default (pull_request.user.user.type == 'Bot' — covers hash-worker[bot], dependabot[bot], and any future GitHub App). Additional human logins can be exempted via the ignored-actors input.
  • Failure case prints a self-explanatory summary in $GITHUB_STEP_SUMMARY (current title, expected format, examples).
  • Self-PR (changes to the workflow file itself) triggers the workflow via the paths: filter — this PR's title is intentionally missing an ID so the workflow can fail on itself as a smoke test.

Once stable, the next step is wiring this as a required status check via workflow_call in consumer repos.

Test plan

  • Workflow run on this PR fails (no Linear ID in title)
  • Re-title to include the ID (e.g. SRE-715: …) and re-run → passes
  • Verify summary message is helpful
  • Confirm pull_request_target path still works once wired into a consumer repo

Adds preflight-pr-title.yml, mirroring the prefix-parsing approach of
preflight-todo-comments.yml so both checks key off the same IDs. PRs from
GitHub App accounts (user.type == 'Bot') — hash-worker, dependabot, etc. —
are skipped by default; extra human logins can be exempted via the
`ignored-actors` input. Failure path prints a self-explanatory summary in
the workflow run.
@cursor
Copy link
Copy Markdown

cursor Bot commented May 22, 2026

PR Summary

Medium Risk
Introduces a new PR-gating GitHub Actions workflow that can fail human-authored PRs based on title format, potentially blocking merges if misconfigured. Uses pull_request_target/merge_group triggers but only reads PR metadata, keeping security risk low.

Overview
Adds a reusable GitHub Actions preflight (preflight-pr-title.yml) that fails human-authored PRs when the PR title prefix (before the first :) does not contain at least one Linear-style issue ID (e.g. H-1234).

The workflow supports workflow_call with an ignored-actors allowlist, automatically skips bot authors, and writes a clear pass/fail message to GITHUB_STEP_SUMMARY showing the expected title format and detected IDs.

Reviewed by Cursor Bugbot for commit 779df27. Bugbot is set up for automated code reviews on this repo. Configure here.

@TimDiekmann TimDiekmann changed the title Add reusable workflow enforcing Linear issue ID in PR titles SRE-715: Add reusable workflow enforcing Linear issue ID in PR titles May 22, 2026
Default `pull_request` types are `opened, synchronize, reopened` — a title-only
edit wouldn't re-run the check, so a PR could stay red after the user fixes the
title. Add `edited` explicitly to both `pull_request` and `pull_request_target`.
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 22, 2026

🤖 Augment PR Summary

Summary: Introduces a reusable GitHub Actions workflow to enforce that human-authored PR titles include a Linear issue ID.

Changes:

  • Added .github/workflows/preflight-pr-title.yml to validate PR title prefixes (segment before the first :) for IDs like H-1234/SRE-708.
  • Skips checks for bot-authored PRs and supports an optional ignored-actors allowlist.
  • Emits a clear pass/fail explanation into $GITHUB_STEP_SUMMARY with examples.
  • Includes a paths filter so edits to the workflow can self-test on PRs.

Technical Notes: Uses simple shell parsing (prefix extraction + case-normalized regex match) and keeps permissions scoped to contents: read.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread .github/workflows/preflight-pr-title.yml
@TimDiekmann TimDiekmann changed the title SRE-715: Add reusable workflow enforcing Linear issue ID in PR titles SRE715: Add reusable workflow enforcing Linear issue ID in PR titles May 22, 2026
@TimDiekmann TimDiekmann changed the title SRE715: Add reusable workflow enforcing Linear issue ID in PR titles SRE-715: Add reusable workflow enforcing Linear issue ID in PR titles May 22, 2026
@TimDiekmann TimDiekmann requested a review from vilkinsons May 22, 2026 14:54
@TimDiekmann TimDiekmann enabled auto-merge May 22, 2026 14:54
Comment thread .github/workflows/preflight-pr-title.yml
indietyp
indietyp previously approved these changes May 22, 2026
@TimDiekmann TimDiekmann added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit e12e306 May 22, 2026
8 checks passed
@TimDiekmann TimDiekmann deleted the t/sre-715-enforce-linear-issue-id-in-pr-titles branch May 22, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants