Conversation
…aceful skip pattern Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
March 16, 2026 12:00
View session
pelikhan
approved these changes
Mar 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the “Custom Trigger Filtering” documentation to avoid failing workflows when a trigger doesn’t match, by describing skip-based filtering patterns instead of using exit 1.
Changes:
- Replaces the
exit 1trigger-filtering example with a job output + workflow-levelif:pattern. - Adds a “Simple Context Conditions” subsection showing direct
if:usage without a custom job. - Adds a “Query-Based Filtering” subsection pointing to
skip-if-match/skip-if-no-match.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
|
||
| ## Custom Trigger Filtering | ||
|
|
||
| Use a deterministic job to compute whether the agent should run, expose the result as a job output, and reference it with `if:`. The compiler automatically adds the filter job as a dependency of the activation job, so when the condition is false the workflow run is **skipped** (not failed), keeping the Actions tab clean. |
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.
Using
exit 1in a pre-agent step to filter triggers marks the entire workflow run as failed, cluttering the Actions tab with red X's and spuriously firing the Workflow Failure issue mechanism.Changes
exit 1step anti-pattern with a deterministicfilterjob that sets a boolean output and never exits non-zero. Theif:frontmatter field references the output; the compiler wires the filter job as a dependency of activation so non-matching runs are skipped, not failed.if:usage (no custom job needed) for conditions expressible from GitHub Actions context alone.skip-if-match:/skip-if-no-match:as the idiomatic mechanism when the filter can be expressed as a GitHub search query — both produce the same skipped-not-failed outcome.