Skip to content

ci: exclude non-code folders from triggering GitHub Actions workflows#540

Draft
Copilot wants to merge 4 commits into
mainfrom
copilot/add-folder-exclusions-to-actions
Draft

ci: exclude non-code folders from triggering GitHub Actions workflows#540
Copilot wants to merge 4 commits into
mainfrom
copilot/add-folder-exclusions-to-actions

Conversation

Copilot AI commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Changes to .pipeline, screenshots, and examples folders should not trigger CI builds, as none of these contain buildable code. Changes to .github are 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 to paths-based filter on both push and pull_request triggers. 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/**, and examples/**.
  • codespell.yml: Converted on: [pull_request] shorthand to structured form to support paths-ignore (excludes .github/**, .pipeline/**, screenshots/**, examples/**)
  • codeql-analysis.yml: Added paths-ignore to both push and pull_request triggers (excludes .pipeline/**, screenshots/**, examples/** only, keeping .github/** so workflow changes are still analyzed)
  • trivy.yml: Added paths-ignore to push trigger (excludes .github/**, .pipeline/**, screenshots/**, examples/**)

paths filter used in CI/test workflows (ci.yml, code-lint.yml, upgrade.yml):

paths:
  - '**'
  - '!.github/**'
  - '.github/workflows/<workflow>.yml'  # re-includes the workflow's own file
  - '!**.md'
  - '!**.mdx'
  - '!**.png'
  - '!**.jpg'
  - '!hack/**'
  - '!.pipeline/**'
  - '!screenshots/**'
  - '!examples/**'

paths-ignore filter used in non-test workflows (codespell.yml, trivy.yml):

paths-ignore:
  - ".github/**"
  - ".pipeline/**"
  - "screenshots/**"
  - "examples/**"

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_call triggers only, no branch push/PR).

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature] Ensure that changes to non-code folders don't cause automatic execution of github actions.</issue_title>
<issue_description>If a change is made in any of the following repository folders, don't trigger a build. Add the folders as exclusions to existing GitHub actions.

./github
./pipeline
./screenshots
./examples</issue_description>

Comments on the Issue (you are Copilot in this section)


💡 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.

Copilot AI changed the title [WIP] Add exclusions for non-code folders in GitHub actions ci: exclude non-code folders from triggering GitHub Actions workflows Mar 23, 2026
Comment thread .github/workflows/ci.yml Outdated
- main
- release-*
paths-ignore:
- ".github/**"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/ci.yml Outdated
- "**.mdx"
- "**.png"
- "**.jpg"
- ".github/**"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Comment thread .github/workflows/ci.yml Outdated
- main
- release-*
paths-ignore: [docs/**, "**.md", "**.mdx", "**.png", "**.jpg"]
paths-ignore:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Copilot ! Consider changing this to the paths based pattern, make sure that:

  • .github directory is ignored, but .github/workflows/ci.yml is included.
  • markdown files + images files are ignored
  • hack/ directory is ignored
  • .pipeline directory 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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Ensure that changes to non-code folders don't cause automatic execution of github actions.

3 participants