Skip to content

ci: move the PR template check into its own workflow so an edit re-checks it#425

Open
ion-alpha-dev wants to merge 1 commit into
mainfrom
ci-pr-body-workflow
Open

ci: move the PR template check into its own workflow so an edit re-checks it#425
ion-alpha-dev wants to merge 1 commit into
mainfrom
ci-pr-body-workflow

Conversation

@ion-alpha-dev

Copy link
Copy Markdown
Collaborator

What

Moves the PR body follows template job out of ci.yml into a new .github/workflows/pr-body.yml, which triggers on edited as well as the usual events. The check itself is unchanged, including its name and the bot waiver.

Why

The check could only be satisfied by pushing a commit, which is absurd for a check about the pull request body.

Editing a body fired nothing: ci.yml triggers on [opened, synchronize, reopened, ready_for_review] and not edited, so a failing check just sat at its old result. Re-running the workflow did not help either, because the job reads the body from github.event.pull_request.body and a re-run replays the original event payload. It re-read the body as it was when the PR opened and failed identically, which reads as "my edit did not save". Hit live on #423 and #424: both bodies were corrected and both checks stayed red.

Adding edited to ci.yml would have been worse. Its concurrency group is keyed on the ref with cancel-in-progress, so editing a title would cancel an in-flight matrix run, and ci-success fails on a cancelled job. A title tweak could turn a green PR red.

A separate workflow gets the edited trigger with its own concurrency group, so a body edit costs one short job instead of the full matrix, and nothing gets cancelled.

How to verify

  • Open a PR with a body missing ## What, confirm PR body follows template fails.
  • Edit the body to add the sections. The check should re-run on its own and go green, with no push and no other job re-running.
  • Edit a title while the matrix is running and confirm the matrix is not cancelled.
  • On this PR: only PR body follows template should come from the new workflow, and CI success should still gate everything else.

Notes for reviewers

  • The check name is deliberately unchanged (PR body follows template), so the main protection ruleset and any saved status context see the same name. The ruleset requires only CI success, so there is no settings change needed to merge this.
  • Follow-up you may want: ci-success no longer has pr-body in its needs, so the template check is no longer transitively required. If it should stay blocking, add PR body follows template to the ruleset's required checks. Adding it is safe at any time, before or after this merges, because the name does not change.
  • Two things left deliberately alone, flag if you disagree: the bot waiver (AUTHOR_TYPE = Bot skips the check), and reading the body from the event payload rather than the API. The payload read was a security decision and the edited trigger removes the reason to change it.
  • Task: d184a8b0-ff35-4b67-86ba-4f4cde682b6a

…ecks it

The template check could only be satisfied by pushing a commit. Editing a pull
request body fired nothing, because ci.yml triggers on
[opened, synchronize, reopened, ready_for_review] and not on `edited`, so a
failing check sat at its old result. Re-running the workflow did not help either:
the job reads the body from `github.event.pull_request.body`, and a re-run replays
the original event payload, so it re-read the body as it was when the PR opened and
failed identically. The obvious recovery looked like the edit had not saved.

Adding `edited` to ci.yml would have been worse. Its concurrency group is keyed on
the ref with cancel-in-progress, so editing a title would cancel an in-flight matrix
run, and ci-success fails on a cancelled job. A title tweak could turn a green pull
request red.

Move the job to .github/workflows/pr-body.yml, which takes the `edited` trigger and
carries its own concurrency group keyed on the pull request number. A body edit now
costs one short job instead of the whole matrix, and nothing gets cancelled. The
check name is unchanged, so the branch ruleset and ci-success's contract see the
same status context as before; ci-success no longer needs the job, since it now
lives in a separate workflow.
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant