Skip to content

ci: scope workflow triggers to relevant paths#37898

Merged
pelikhan merged 4 commits into
mainfrom
pelikhan/optimize-workflow-triggers
Jun 8, 2026
Merged

ci: scope workflow triggers to relevant paths#37898
pelikhan merged 4 commits into
mainfrom
pelikhan/optimize-workflow-triggers

Conversation

@pelikhan

@pelikhan pelikhan commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR optimises CI/CD trigger efficiency across the repository by adding explicit paths filters to push and pull_request events 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

File Type What changed
.github/workflows/CWI.yml modified Added branches: [main] constraint and comprehensive path filters to the push trigger; added a full pull_request trigger with matching path filters; added workflow_dispatch.
.github/workflows/cgo.yml modified Added path filters to the push trigger (Go sources, scripts, config, workflow files); normalised the pull_request glob from **.go**/*.go and expanded its path list.
.github/workflows/ci.yml modified Added path filters to the push-on-main trigger: Go sources, scripts, Makefile, setup actions, release/compat JSON schemas, install script.
.github/workflows/cjs.yml modified Added path filters to the push trigger, scoping it to JS action sources, markdown, scripts, and the workflow file itself.
.github/workflows/cpi.yml deleted Removed the entire CHI/Pi integration workflow that ran steering-extension tests via the pi CLI using an ANTHROPIC_API_KEY secret. Workflow was broken.
.github/workflows/integration-agentics.yml modified Added path filters to both push and pull_request triggers; fires only when Go sources, scripts, Makefile, or the workflow file itself change.
.github/workflows/license-check.yml modified Added the workflow file itself to the pull_request paths filter; added a new push paths 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 in cgo.yml and applied consistently in all newly added path filters.

Breaking Changes

Change Breaking? Notes
cpi.yml deleted Yes The CHI/Pi integration workflow is permanently removed. Any external references to it (e.g. branch-protection rules or required status checks) will no longer resolve.
All other path-filter additions No Purely additive constraints; no job logic, secrets, or outputs are modified.

Scope

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:

  • A change to a Go source file should trigger ci.yml, cgo.yml, and integration-agentics.yml, but not cjs.yml.
  • A change to a JS action file should trigger cjs.yml only.
  • A change to go.mod should trigger license-check.yml on push, but nothing else.

Generated by PR Description Updater for issue #37898 · 119.5 AIC · ⌖ 12.7 AIC · ⊞ 19.6K ·

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>
Copilot AI review requested due to automatic review settings June 8, 2026 18:58
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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’ push and/or pull_request triggers to scope executions to Go/JS/license-related changes.
  • Fixed a self-path reference in cpi.yml so workflow file changes re-trigger the workflow.
  • Added a pull_request trigger for CWI.yml and restricted its push trigger to main.
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

  • paths uses **.go, which does not match the repo’s established pattern for Go file globs (e.g. **/*.go in .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

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/integration-agentics.yml
Comment thread .github/workflows/integration-agentics.yml
Comment thread .github/workflows/CWI.yml
Comment thread .github/workflows/CWI.yml
Comment thread .github/workflows/cgo.yml
Comment on lines 3 to 8
on:
pull_request:
paths:
- 'go.mod'
- 'go.sum'
push:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@pelikhan

pelikhan commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot apply pr-finisher skill

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

✅ smoke-ci: safeoutputs CLI comment + comment-memory run (27160382098)

Generated by 🧪 Smoke CI for issue #37898 ·

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

CI lights the path
Green checks bloom at dawn
Quiet bots still sing

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

Generated by 🧪 Smoke CI for issue #37898 ·

…-check.yml to PR paths

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@copilot apply pr-finisher skill

Done in 3b8b633. Fixed all **.go**/*.go across ci.yml, integration-agentics.yml, CWI.yml, and cgo.yml, and added .github/workflows/license-check.yml to the pull_request paths in license-check.yml. make fmt, make lint, and make test-unit all pass.

@pelikhan pelikhan merged commit eb2a3c6 into main Jun 8, 2026
@pelikhan pelikhan deleted the pelikhan/optimize-workflow-triggers branch June 8, 2026 19:13
Copilot stopped work on behalf of pelikhan due to an error June 8, 2026 19:13
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@copilot review all comments and address unresolved review feedback.

Generated by 👨‍🍳 PR Sous Chef · 68.4 AIC · ⌖ 0.952 AIC · ⊞ 17.1K ·

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Please refresh the branch and rerun checks after the path filter fix lands.

Generated by 👨‍🍳 PR Sous Chef · 68.4 AIC · ⌖ 0.952 AIC · ⊞ 17.1K ·

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.

3 participants