mirror of
https://github.com/nektos/act.git
synced 2026-04-26 17:35:49 +03:00
[PR #2729] feat: Support filtering workflows using on.<> filters and events #2576
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#2576
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/nektos/act/pull/2729
Author: @john-tipper
Created: 4/11/2025
Status: 🔄 Open
Base:
master← Head:#2489-filter-workflows-by-events📝 Commits (4)
e948801Support filtering workflows by on.<> filters.8a77428Don't try to handle path filters in pull request events.750e5f3Add missing files943bd64Merge branch 'master' into #2489-filter-workflows-by-events📊 Changes
17 files changed (+2905 additions, -84 deletions)
View changed files
📝
cmd/input.go(+1 -0)📝
cmd/root.go(+28 -51)📝
go.mod(+2 -0)📝
go.sum(+5 -0)📝
pkg/artifacts/server_test.go(+1 -1)📝
pkg/model/planner.go(+57 -20)📝
pkg/model/planner_test.go(+640 -1)➕
pkg/model/testdata/filter-events/pr-opened.json(+532 -0)➕
pkg/model/testdata/filter-events/push-foo.json(+219 -0)➕
pkg/model/testdata/filter-events/push-master.json(+219 -0)➕
pkg/model/testdata/filter-events/push-tag-v1.json(+219 -0)➕
pkg/model/testdata/filter-events/push-tag-v2.json(+219 -0)📝
pkg/model/workflow.go(+370 -0)📝
pkg/model/workflow_test.go(+383 -2)📝
pkg/runner/reusable_workflow.go(+2 -2)📝
pkg/runner/runner.go(+1 -0)📝
pkg/runner/runner_test.go(+7 -7)📄 Description
resolves #2489
This PR adds a non-breaking change to add a
--apply-event-filtersflag.Limitations:
More detailed thoughts on paths and pull request events:
GitHub says it does a 3 dot diff between base and head (https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-comparing-branches-in-pull-requests)
We could get the 2 SHA values from githubPullRequestEvent, but we'd have to decide whether we want to:
I've elected to do nothing for now, happy to consider adding this in later if we can agree the way forward.
Additional changes:
I removed a section of dead code around filtering, given that it just fed the list/graph output but didn't do anything else. That printing logic has been moved further down in
root.goto be able to use variables that are defined later.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.