Run PR Validation on push to main so status checks appear in branch protection picker#2264
Merged
Merged
Conversation
The PR Validation workflow currently triggers only on pull_request and workflow_dispatch, so its check-runs are never recorded against commits on main. As a result, GitHub's branch-protection "Status checks that have run recently" autocomplete dropdown stays empty and you cannot pick the scrape/build check names to require. Add a push trigger for main (with the same paths-ignore) so the same jobs run after each merge. Once at least one run completes on main, the check names (Scrape headers: x64/x86/arm64, Build, test, package) become selectable in the branch protection UI, and main also gets post-merge validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
vineeththomasalex
approved these changes
May 27, 2026
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.
Why
The
PR Validationworkflow currently only triggers onpull_request(andworkflow_dispatch), so its check-runs are never recorded against commits onmain. GitHub's branch-protection "Status checks that have run recently" autocomplete dropdown is populated from check runs observed on the protected branch's recent commits — sincemainitself has none of these jobs in its history, the dropdown stays empty and you can't pickScrape headers: x64/x86/arm64orBuild, test, packageto require them.Verified with:
What this change does
Adds a
push: branches: [main]trigger (with the samepaths-ignoreas thepull_requesttrigger) so the same matrix of jobs runs after every merge tomain.Effect
Scrape headers: x64,Scrape headers: x86,Scrape headers: arm64, andBuild, test, packagewill appear in the branch-protection status-check picker at https://github.com/microsoft/win32metadata/settings/branch_protection_rules/23707585 and can be marked required.mainalso gets post-merge validation, catching any breakage that slips through PR validation (e.g. semantic merge conflicts between two PRs).concurrencygroup still groups PR runs by PR number andpushruns bygithub.ref(i.e.refs/heads/main);cancel-in-progress: truealready applied to PRs, and applies to main pushes the same way (a newer push will cancel an in-flight main run — acceptable, but happy to switch tocancel-in-progress: falseformainif preferred).Alternatives considered