ci: exclude non-code folders from triggering GitHub Actions workflows#540
ci: exclude non-code folders from triggering GitHub Actions workflows#540Copilot wants to merge 4 commits into
Conversation
Co-authored-by: sjwaight <4828246+sjwaight@users.noreply.github.com> Agent-Logs-Url: https://github.com/kubefleet-dev/kubefleet/sessions/7ec861bf-e56b-41ce-a6a6-ea32941f58a6
| - main | ||
| - release-* | ||
| paths-ignore: | ||
| - ".github/**" |
There was a problem hiding this comment.
Hi Copilot ! Some of the pipelines are UTs/ITs/E2Es specific; we expect them to run automatically when we edit the pipeline configurations so that we could verify the validity of changes. Consider exempting them from the exclusion list.
There was a problem hiding this comment.
Hi Copilot ! Some of the pipelines are UTs/ITs/E2Es specific; we expect them to run automatically when we edit the pipeline configurations so that we could verify the validity of changes. Consider exempting them from the exclusion list.
There was a problem hiding this comment.
Removed .github/** from paths-ignore in ci.yml, code-lint.yml, upgrade.yml, and codeql-analysis.yml so that changes to workflow files continue to trigger those CI pipelines. The other non-code folder exclusions (.pipeline/**, screenshots/**, examples/**) remain. Non-test workflows (codespell.yml, trivy.yml) retain the .github/** exclusion since they don't need to validate pipeline changes. See commit 041f36b.
| - "**.mdx" | ||
| - "**.png" | ||
| - "**.jpg" | ||
| - ".github/**" |
There was a problem hiding this comment.
Same here. Copilot
…ine change validation Co-authored-by: michaelawyu <14261500+michaelawyu@users.noreply.github.com> Agent-Logs-Url: https://github.com/kubefleet-dev/kubefleet/sessions/a16bcec4-ee28-4c71-b855-a0643ae9ec01
| - main | ||
| - release-* | ||
| paths-ignore: [docs/**, "**.md", "**.mdx", "**.png", "**.jpg"] | ||
| paths-ignore: |
There was a problem hiding this comment.
Hi Copilot ! Consider changing this to the paths based pattern, make sure that:
.githubdirectory is ignored, but.github/workflows/ci.ymlis included.- markdown files + images files are ignored
hack/directory is ignored.pipelinedirectory is ignored
Learn about the syntax from here: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-including-and-excluding-paths
There was a problem hiding this comment.
Switched ci.yml, code-lint.yml, and upgrade.yml from paths-ignore to a paths-based filter (commit 4db07c6). The pattern:
- Starts with
**to include everything - Excludes
!.github/**, then re-includes the workflow's own file (e.g..github/workflows/ci.yml) so CI triggers on pipeline changes - Excludes markdown (
!**.md,!**.mdx) and image files (!**.png,!**.jpg) - Excludes
!hack/**,!.pipeline/**,!screenshots/**,!examples/**
…filters Co-authored-by: michaelawyu <14261500+michaelawyu@users.noreply.github.com> Agent-Logs-Url: https://github.com/kubefleet-dev/kubefleet/sessions/3132d372-6cc6-40f3-8786-ec5369e04e23
Changes to
.pipeline,screenshots, andexamplesfolders should not trigger CI builds, as none of these contain buildable code. Changes to.githubare excluded from non-test workflows only, so that edits to CI/UT/IT/E2E pipeline configurations continue to trigger those workflows for validation.Changes
ci.yml,code-lint.yml,upgrade.yml: Switched topaths-based filter on bothpushandpull_requesttriggers. The pattern includes everything (**), then excludes.github/**while re-including the workflow's own file (e.g..github/workflows/ci.yml), and also excludes markdown/image files,hack/**,.pipeline/**,screenshots/**, andexamples/**.codespell.yml: Convertedon: [pull_request]shorthand to structured form to supportpaths-ignore(excludes.github/**,.pipeline/**,screenshots/**,examples/**)codeql-analysis.yml: Addedpaths-ignoreto bothpushandpull_requesttriggers (excludes.pipeline/**,screenshots/**,examples/**only, keeping.github/**so workflow changes are still analyzed)trivy.yml: Addedpaths-ignoretopushtrigger (excludes.github/**,.pipeline/**,screenshots/**,examples/**)pathsfilter used in CI/test workflows (ci.yml,code-lint.yml,upgrade.yml):paths-ignorefilter used in non-test workflows (codespell.yml,trivy.yml):Workflows not modified:
pr-title-lint.yml(title check, path-agnostic by design),markdown-lint.yml(already scoped to markdown paths only),chart.yml/release.yml/setup-release.yml(tag/workflow_calltriggers only, no branch push/PR).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.