In a monorepo, you want the frontend CI workflow to run only when files under apps/web/** change on push. Which trigger configuration is correct?
Select an answer to reveal the explanation.
Short Explanation and Infographic
paths under push (or pull_request) is the monorepo scalpel: only matching file changes wake that workflow. There is no directories: key, no path_filter event, and hashFiles is for cache keys—not for on: filters.
Full explanation below image
Full Explanation
GitHub Actions supports path and paths-ignore filters on push and pull_request (and some related activity). Listing 'apps/web/**' under on.push.paths restricts runs to commits that touch at least one matching path, which is the standard monorepo pattern for frontend-only CI. The directories key is not valid under push. path_filter is not a workflow event. hashFiles is an expression function used inside jobs (commonly cache keys), not a substitute for event path filters. Remember that the first push of a new branch can include a broader comparison set, and that paths filters apply to the changed files in the event payload—not to arbitrary later steps. Combine paths with branches filters when you also need branch scoping, and use separate workflows per package when teams need independent status checks.