How do you configure a push trigger to only run when files in the 'src/' directory change?
Select an answer to reveal the explanation.
Short Explanation and Infographic
The 'paths:' filter on a push trigger is your workflow's file watchlist — it only wakes up when changes touch matching paths.
Full explanation below image
Full Explanation
The 'paths:' filter under push and pull_request triggers accepts glob patterns and restricts the trigger to runs where at least one changed file matches a pattern. 'src/**' matches all files inside the src directory at any depth. 'filter:', 'include:', and 'files:' are not valid GitHub Actions trigger keys. The counterpart 'paths-ignore:' excludes paths. Note: 'paths' and 'branches' filters are ANDed together, so both must be satisfied for the workflow to trigger.