Limit workflow triggers to relevant path changes#1858
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds paths filters to multiple GitHub Actions workflows so they only trigger on changes that are likely to affect their outputs, reducing unnecessary CI runs.
Changes:
- Add
pathsfilters topush/pull_requesttriggers for CodeQL analysis. - Add
pathsfilters to PR-triggered build/test workflow. - Add
pathsfilters to Docfx and Draft Release workflows onpush.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/draft.yaml | Restricts draft release workflow runs to source/test/build-relevant changes. |
| .github/workflows/docfx.yaml | Restricts Docfx workflow runs to documentation/source/readme changes. |
| .github/workflows/codeql-analysis.yml | Restricts CodeQL runs to code/build configuration changes (plus workflow self-changes). |
| .github/workflows/buildtest.yaml | Restricts PR build/test runs to code/e2e/build configuration changes (plus workflow self-changes). |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
.github/workflows/codeql-analysis.yml:35
- The new
pull_request.pathsfilter also omits.editorconfig. If a PR only changes analyzer/style config, CodeQL would be skipped; include.editorconfigto ensure scanning reflects updated analysis settings.
- 'Directory.*'
- 'global.json'
- 'nuget.config'
- Files reviewed: 4/4 changed files
- Comments generated: 4
- Review effort level: Low
| - 'Directory.*' | ||
| - 'global.json' | ||
| - 'nuget.config' |
| - 'doc/**' | ||
| - 'src/**' | ||
| - 'README.md' | ||
| - '.github/workflows/docfx.yaml' |
| - 'Directory.*' | ||
| - 'global.json' | ||
| - 'nuget.config' |
| - 'Directory.*' | ||
| - 'CodeCoverage.runsettings' | ||
| - 'global.json' | ||
| - 'nuget.config' |
tg123
left a comment
There was a problem hiding this comment.
/LGTM
editorconfig is nice to add the list
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, tg123 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Summary
Add path filters to commit-triggered GitHub Actions workflows so they run only when relevant files are modified.
Changes
pathsfilters topushandpull_requestin.github/workflows/codeql-analysis.ymlpathsfilters topull_requestin.github/workflows/buildtest.yamlpathsfilters topushin.github/workflows/docfx.yamlpathsfilters topushin.github/workflows/draft.yamlNotes
schedulein CodeQL andworkflow_dispatchin Docfx are unchanged..github/workflows/nuget.yamlis release-triggered and intentionally unchanged.Why
This reduces unnecessary CI load and shortens feedback time by skipping workflow runs for unrelated changes.