ci: scope workflow triggers to relevant paths#37898
Conversation
Reviewed all non-lock GitHub Actions workflows and added path filters so they only run when impacted files change. - ci.yml: scope push(main) to Go/scripts/Makefile/setup/release config - cgo.yml: scope push(main) to Go-relevant paths (mirror PR filter) - cjs.yml: scope push(main) to JS-relevant paths (mirror PR filter) - license-check.yml: scope push(main) to go.mod/go.sum - integration-agentics.yml: add Go/scripts/Makefile paths to push & PR (previously ran on every PR regardless of impact) - CWI.yml: restrict push to main + add PR trigger with paths; previously triggered on push to any branch on pkg/** - cpi.yml: fix stale self-path reference (chi.yml -> cpi.yml) The remaining non-lock workflows already have well-scoped triggers (path filters, workflow_dispatch only, schedule, or event-driven such as issues/PR labeled), so no changes were needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The pi-extension-integration job has been failing on every run since at least 2026-05 because '@pi/cli' is not published on the public npm registry (404). The workflow was effectively dead — it only ran when actions/setup/js/pi_*.cjs changed, and never produced a useful signal when it did. Restoring the self-path filter in the previous commit caused it to trigger on this PR and surface as a failing required check. Rather than work around it with a stale self-reference, drop the workflow. The pi engine and its provider/steering modules are still exercised by unit tests in pkg/workflow and actions/setup/js. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR narrows GitHub Actions workflow triggers by adding paths filters so workflows only run when relevant files change, reducing unnecessary CI runs for unrelated PRs/commits.
Changes:
- Added path filters to multiple workflows’
pushand/orpull_requesttriggers to scope executions to Go/JS/license-related changes. - Fixed a self-path reference in
cpi.ymlso workflow file changes re-trigger the workflow. - Added a
pull_requesttrigger forCWI.ymland restricted itspushtrigger tomain.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/license-check.yml | Restricts push runs via paths to go.mod/go.sum and the workflow file. |
| .github/workflows/integration-agentics.yml | Adds paths filters for push and pull_request to avoid running on irrelevant changes. |
| .github/workflows/CWI.yml | Restricts push to main, adds pull_request, and scopes both with paths. |
| .github/workflows/cpi.yml | Fixes the workflow self-path filter to reference cpi.yml correctly. |
| .github/workflows/cjs.yml | Adds push.paths to align with the existing PR path scoping for JS-related files. |
| .github/workflows/ci.yml | Adds push.paths to scope CI runs to relevant Go/scripts/setup/release-config changes. |
| .github/workflows/cgo.yml | Adds push.paths to scope CGO runs to relevant Go/scripts/setup/release-config changes. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
.github/workflows/cgo.yml:26
pathsuses**.go, which does not match the repo’s established pattern for Go file globs (e.g.**/*.goin.github/workflows/error-message-lint.yml). This can cause the workflow to miss Go changes and not run when it should.
paths:
- '**.go'
- 'cmd/**'
- Files reviewed: 7/7 changed files
- Comments generated: 7
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'go.mod' | ||
| - 'go.sum' | ||
| push: |
There was a problem hiding this comment.
Fixed in 3b8b633 — added .github/workflows/license-check.yml to the pull_request paths filter so PR changes to the workflow file also trigger a run.
|
@copilot apply pr-finisher skill |
|
✅ smoke-ci: safeoutputs CLI comment + comment-memory run (27160382098)
|
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
…-check.yml to PR paths Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot review all comments and address unresolved review feedback.
|
|
Please refresh the branch and rerun checks after the path filter fix lands.
|
Summary
This PR optimises CI/CD trigger efficiency across the repository by adding explicit
pathsfilters topushandpull_requestevents in six workflow files, so each workflow only fires when files it actually depends on change. It also fixes a non-standard glob (**.go→**/*.go) in path filters, and permanently removes the broken CHI/Pi integration workflow (cpi.yml).Motivation
Without path filters, every push to
main(or any PR) triggers all workflows regardless of what changed — a doc edit fires the full Go build, a JS change triggers the license checker, etc. Scoping triggers to relevant paths cuts unnecessary workflow runs, reduces CI cost, and decreases noise in the Actions tab.Changes by File
.github/workflows/CWI.ymlbranches: [main]constraint and comprehensive path filters to thepushtrigger; added a fullpull_requesttrigger with matching path filters; addedworkflow_dispatch..github/workflows/cgo.ymlpushtrigger (Go sources, scripts, config, workflow files); normalised thepull_requestglob from**.go→**/*.goand expanded its path list..github/workflows/ci.yml.github/workflows/cjs.ymlpushtrigger, scoping it to JS action sources, markdown, scripts, and the workflow file itself..github/workflows/cpi.ymlpiCLI using anANTHROPIC_API_KEYsecret. Workflow was broken..github/workflows/integration-agentics.ymlpushandpull_requesttriggers; fires only when Go sources, scripts, Makefile, or the workflow file itself change..github/workflows/license-check.ymlpull_requestpaths filter; added a newpushpaths filter (go.mod,go.sum, workflow file) to avoid unnecessary runs.Notable Fix:
**.go→**/*.go**.go(no slash) is a non-standard pattern that behaves inconsistently across glob implementations. The correct recursive Go source glob is**/*.go. This is corrected incgo.ymland applied consistently in all newly added path filters.Breaking Changes
cpi.ymldeletedScope
All changes are confined to
.github/workflows/— no production Go code, scripts, schemas, or documentation are modified.Verification
Path-filter correctness is observable in the Actions tab after the next push:
ci.yml,cgo.yml, andintegration-agentics.yml, but notcjs.yml.cjs.ymlonly.go.modshould triggerlicense-check.ymlon push, but nothing else.