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
Open
ci: move the PR template check into its own workflow so an edit re-checks it#425ion-alpha-dev wants to merge 1 commit into
ion-alpha-dev wants to merge 1 commit into
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Moves the
PR body follows templatejob out ofci.ymlinto a new.github/workflows/pr-body.yml, which triggers oneditedas 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.ymltriggers on[opened, synchronize, reopened, ready_for_review]and notedited, so a failing check just sat at its old result. Re-running the workflow did not help either, because the job reads the body fromgithub.event.pull_request.bodyand 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
editedtoci.ymlwould have been worse. Its concurrency group is keyed on the ref withcancel-in-progress, so editing a title would cancel an in-flight matrix run, andci-successfails on a cancelled job. A title tweak could turn a green PR red.A separate workflow gets the
editedtrigger 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
## What, confirmPR body follows templatefails.PR body follows templateshould come from the new workflow, andCI successshould still gate everything else.Notes for reviewers
PR body follows template), so themain protectionruleset and any saved status context see the same name. The ruleset requires onlyCI success, so there is no settings change needed to merge this.ci-successno longer haspr-bodyin itsneeds, so the template check is no longer transitively required. If it should stay blocking, addPR body follows templateto the ruleset's required checks. Adding it is safe at any time, before or after this merges, because the name does not change.AUTHOR_TYPE = Botskips the check), and reading the body from the event payload rather than the API. The payload read was a security decision and theeditedtrigger removes the reason to change it.d184a8b0-ff35-4b67-86ba-4f4cde682b6a