CI: Re-run lint when a PR's base branch changes#676
Merged
Conversation
Add 'edited' to the lint workflow's pull_request trigger, guarded so the SwiftFormat job only re-runs when the base branch actually changed. Retargeting a PR (e.g. main -> dev) fires pull_request: edited, which the default trigger types (opened, synchronize, reopened) ignore. When the new base requires the SwiftFormat status check, GitHub leaves it 'Expected - waiting for status to be reported' with no run behind it, blocking the PR indefinitely. Re-running on base change ensures the required check actually reports against the new base.
marionbarker
approved these changes
Jun 17, 2026
marionbarker
left a comment
Collaborator
There was a problem hiding this comment.
approve from code review
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
Add
editedto the lint workflow'spull_requesttrigger, guarded so theSwiftFormatjob only re-runs when the PR's base branch actually changed (not on routine title/description edits).Why
A real PR got stuck "pending" indefinitely (#653) and this is the fix.
The default
pull_requesttrigger types are[opened, synchronize, reopened]. Changing a PR's base branch firespull_request: edited— which none of those cover — so the lint workflow does not re-run on a retarget.That matters because
SwiftFormatis a required status check ondev. The failure sequence:main(common for new/outside contributors).main→dev. This fires onlyedited, so lint does not re-run.devruleset now requiresSwiftFormat, but no run ever reported it on the new base. GitHub shows it as "Expected — waiting for status to be reported" and the PR stays BLOCKED forever, with no run to even approve.Re-running lint on a base change ensures the required check actually reports against the new base. The
ifguard keeps it from re-linting on every title/body edit (which also fireedited).Note: this does not change the fork-PR approval gate — runs on outside-contributor forks still need a maintainer to approve them — but it guarantees there is a run to approve after a retarget, instead of a phantom required check.