Feature request: Expression-based filtering of workflow triggers #187467
Replies: 1 comment
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Why are you starting this discussion?
Product Feedback
What GitHub Actions topic or product is this about?
Workflow Configuration
Discussion Details
Hey folks, I’d like to propose an enhancement to how workflow triggers can be filtered in GitHub Actions.
Currently, workflows are triggered by events such as
pull_request,push, andworkflow_dispatch. Some events support activity types that allow partial filtering. For example:This ensures the workflow runs only when a pull request is edited (e.g., title, description, or base branch changes), and not for other activities like new commits.
However, this filtering is not granular enough in some cases.
The Problem
The
editedactivity type is triggered for multiple distinct changes:There is currently no way to distinguish between these at the workflow trigger level.
For example, suppose I want a workflow to run only when the base branch changes, but not when the title or description changes. Today, the only workaround is to add if conditions to every job in the workflow to manually inspect
github.eventand skip execution when the condition doesn’t match.This creates several issues:
In short, we can skip jobs, but we cannot truly prevent the workflow from running.
Proposed Enhancement
I’m proposing support for expression-based filtering at the workflow level, similar to how
if:works on jobs and steps.For example:
With this feature:
editedevent.This would allow developers to use the
githubcontext (and other available variables) to precisely control when workflows truly execute, without side effects on check status.Would love to hear thoughts from the Actions team and others who may have run into similar issues.
Beta Was this translation helpful? Give feedback.
All reactions