YAML anchors for all verbose conditions, and precise label triggering conditions#7535
Merged
achamayou merged 6 commits intomicrosoft:mainfrom Dec 17, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors GitHub Actions workflow trigger conditions to use YAML anchors for code reusability and introduces more precise label-based triggering logic. The changes aim to prevent duplicate workflow runs when a PR is both labeled and opened/reopened simultaneously.
- Introduces YAML anchors (
&check_trigger_conditions) to deduplicate verbose trigger conditions across multiple jobs - Attempts to implement more precise label-triggering logic to distinguish between
labeledevents and other pull request events - Updates three workflow files with the new trigger condition pattern
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
.github/workflows/long-verification.yml |
Replaces inline trigger conditions with YAML anchor and anchor references across three jobs |
.github/workflows/long-test.yml |
Updates the existing YAML anchor with new precise triggering logic |
.github/workflows/bencher-ab.yml |
Replaces inline trigger conditions with YAML anchor and anchor references across three jobs |
achamayou
reviewed
Dec 16, 2025
achamayou
approved these changes
Dec 17, 2025
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.
First commit should be uncontroversial - applying the same tidy discussed in #7529 to
long-verification.ymlandbench-ab.yml.Second is trying to rewrite these conditions to be more accurately triggered. Previously if you
openeda PR that was alreadylabeled, you'd get 2 separate events and 2 separate runs. and similarly if youlabeledsomething (withany-old-junk) that also had the triggering label, we'd trigger another run. I think the correct condition is as spelt:labeledevent only triggers this workflow when the relevant label is added, and the otherpull_requestaction types only trigger this workflow if the label was present.(NB:
unlabeledis a separate event, so don't worry about triggers for removals).This condition is now even longer and more unreadable. I think this multi-line block is valid YAML, but the
GH ActionsVS Code extension's language server isn't happy with it, so maybe they have a more restricted parser. Let's see what it looks like in the wild - I can flatten to one line again if necessary.