Skip to content

fix(ci): match all .changeset/ files for CI skip#2876

Merged
amikofalvy merged 5 commits intomainfrom
feat/changeset-only-skip-ci-fix
Mar 27, 2026
Merged

fix(ci): match all .changeset/ files for CI skip#2876
amikofalvy merged 5 commits intomainfrom
feat/changeset-only-skip-ci-fix

Conversation

@amikofalvy
Copy link
Copy Markdown
Collaborator

Summary

  • Follows up on fix(ci): skip CI when PR only changes .changeset/ files #2874 — the review auto-fixer narrowed the changeset-only CI skip pattern to only .md files
  • Restores the broader pattern to match all .changeset/ files (including config.json), per the original intent
  • Keeps the improved error handling from the review fix (better gh pr diff failure logging)

Test plan

  • PR with only .changeset/config.json changed → CI skipped
  • PR with only .changeset/*.md files → CI skipped
  • PR with .changeset/ + code changes → CI runs

🤖 Generated with Claude Code

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 27, 2026

⚠️ No Changeset found

Latest commit: d459ab7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Mar 27, 2026 9:55pm
agents-docs Ready Ready Preview, Comment Mar 27, 2026 9:55pm
agents-manage-ui Ready Ready Preview, Comment Mar 27, 2026 9:55pm

Request Review

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented Mar 27, 2026

TL;DR — Fixes the changeset-only CI skip logic to match all .changeset/ files (not just .md), so PRs that only touch files like config.json also bypass expensive CI runs. Adds improved error handling for gh pr diff failures and ::warning:: annotations when the GitHub App token is unavailable.

Key changes

  • Broaden .changeset/ skip pattern in ci.yml, cypress.yml — the grep filter now excludes all .changeset/ paths instead of only markdown files, matching the original intent of the feature
  • Add changeset-only detection to ci.yml E2E job — the create-agents-e2e job now has its own changeset-check step with the same gh pr diff logic, so E2E tests are also skipped for changeset-only PRs
  • Add ::warning:: when GitHub App token is unavailableauto-format.yml and ci.yml now log a warning if the App token step produced no token, making silent CI-trigger failures visible
  • Pass PR_NUMBER env var to changeset-check steps — all three workflows now expose github.event.pull_request.number so the gh pr diff call works for pull_request events
  • Capture gh pr diff errors with 2>&1 — failures are surfaced as ::warning:: annotations instead of silently swallowed, keeping CI fail-safe
  • Add SPEC document — includes the original spec for the changeset-only skip feature (updated to reflect the broader .changeset/ matching)

Summary | 4 files | 5 commits | base: mainfeat/changeset-only-skip-ci-fix


Broader .changeset/ file matching

Before: The grep filter used '^\\.changeset/.*\\.md$', so non-markdown files like config.json inside .changeset/ would not trigger a CI skip.
After: The filter uses '^\\.changeset/', matching any file under the directory — aligning with the intent that changeset-only PRs never need a full CI run.

The same changeset-check block is replicated across three jobs: CI main, CI E2E, and Cypress. Each instance fetches changed files via gh pr diff, captures errors with 2>&1, and surfaces them as ::warning:: annotations rather than silently swallowing failures. The PR_NUMBER env var is now passed through so the API call works for pull_request events (merge group events already had PR_NUM extracted from the ref).

ci.yml · cypress.yml · SPEC.md


App token fallback warning

Before: If the GitHub App token step failed or was skipped, the push silently used the default GITHUB_TOKEN — which does not trigger downstream CI workflows.
After: An else branch emits a ::warning:: annotation so the silent failure is visible in the workflow log.

Added to both auto-format.yml and the OpenAPI snapshot commit step in ci.yml.

auto-format.yml · ci.yml

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Claude Opus𝕏

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

Two issues — one is an accidental file commit, the other is a stale SPEC that now contradicts the implementation.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Claude Opus𝕏

Comment thread .agents/skills/pr-context/SKILL.md Outdated
@@ -0,0 +1,289 @@
---
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.

This is a generated local-review artifact (note the local:manual event, LOCAL review state, and stale SHA 7ad17dd). .claude/skills/pr-context/ is already in .gitignore but the .agents/skills/pr-context/ source directory isn't — so it slipped through.

Remove this file and add .agents/skills/pr-context/ to .gitignore alongside the existing .claude/ entry.

Comment thread specs/changeset-only-skip-ci/SPEC.md Outdated
- **Push to main:** Skip this check entirely — pushes to main should always run CI
- **Empty diff:** If `gh pr diff` returns nothing, do NOT skip CI (fail-safe)
- **Mixed changes:** If any file outside `.changeset/` is changed, run full CI
- **Only `.changeset/*.md` files skip CI:** Non-markdown files like `config.json` should still trigger CI
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.

The SPEC still says .changeset/config.json changes should trigger CI, but the implementation now uses grep -v '^\.changeset/' which matches all files under .changeset/ — including config.json.

This contradicts acceptance criteria 5 (line 72: ".changeset/config.json changes are NOT treated as changeset-only"), test case 4 (line 81), and the code example on line 47 which uses grep -v '^\.changeset/.*\.md$'.

Since the intent of this PR is explicitly to widen the pattern, the SPEC should be updated to match: change the code sample, remove the config.json exception from edge cases/acceptance criteria, and update test case 4.

Comment thread .github/workflows/ci.yml
fi

if [ -n "$CHANGED_FILES" ]; then
NON_CHANGESET=$(echo "$CHANGED_FILES" | grep -v '^\.changeset/' || true)
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.

This pattern (grep -v '^\.changeset/') now matches any file under .changeset/, which is the stated intent. Worth noting that .changeset/config.json is a real configuration file — changes to it can affect how changesets are versioned and published. Skipping CI for config changes is a deliberate trade-off (low risk since the release workflow still runs on merge). Just flagging for awareness since this reverses the SPEC's original design choice.

Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

(2) Total Issues | Risk: Medium

🟠⚠️ Major (2) 🟠⚠️

Inline Comments:

  • 🟠 Major: specs/changeset-only-skip-ci/SPEC.md:72 SPEC contradicts implementation — document states config.json should trigger CI but code skips ALL .changeset/ files
  • 🟠 Major: .agents/skills/pr-context/SKILL.md:25 Auto-generated local review artifact accidentally committed

💭 Consider (1) 💭

💭 1) multi-file Extract duplicated changeset detection logic

Issue: The 22-line changeset-only detection block is copied identically across 3 locations: ci.yml (lines 61-82, 370-391) and cypress.yml (lines 79-100).

Why: Code duplication creates maintenance burden — any bug fix or behavior change must be applied to 3 locations. This PR demonstrates the risk since all 3 locations must stay in sync.

Fix: Consider extracting to a reusable composite action at .github/composite-actions/changeset-check/action.yml. The repo already uses composite actions (e.g., cypress-e2e/action.yml). This could be a follow-up improvement.


🚫 REQUEST CHANGES

Summary: The CI skip logic implementation looks correct and the error handling improvements are solid. However, two issues need attention before merge:

  1. SPEC/implementation mismatch — The SPEC says config.json changes should trigger CI, but the implementation (intentionally) skips all .changeset/ files. Either the SPEC needs updating or the implementation should be reverted to match the SPEC.

  2. Accidentally committed generated file — The .agents/skills/pr-context/SKILL.md file contains auto-generated content from a local review session with embedded diffs and stale commit SHAs. This should be removed.

Reviewers (2)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-devops 6 0 1 0 2 0 3
pr-review-standards 2 0 0 0 0 0 2
Total 8 0 1 0 2 0 5
Discarded (5)
Location Issue Reason Discarded
ci.yml:64-66 Error handling captures stderr to CHANGED_FILES Not an issue — this is intentional and correct behavior for debugging
auto-format.yml:136-139 Warning added when APP_TOKEN unavailable Good defensive logging, not an issue
pr-context/SKILL.md:1-289 File is generated artifact Covered by Major inline comment
SPEC.md:47 Pattern mismatch Covered by Major inline comment
SPEC.md:58 Edge case documentation mismatch Covered by Major inline comment

2. PRs that modify `.changeset/*.md` AND other files still run full CI
3. The `changeset-release/main` branch detection continues to work as before
4. Push events to main always run full CI
5. `.changeset/config.json` changes are NOT treated as changeset-only
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.

🟠 MAJOR: SPEC contradicts implementation

Issue: The SPEC states .changeset/config.json changes should NOT skip CI (line 72, also lines 47, 58), but the implementation uses grep -v '^\.changeset/' which matches all .changeset/ files including config.json.

Why: The PR description says this is intentional ("Restores the broader pattern to match all .changeset/ files (including config.json), per the original intent"). However, the SPEC document was not updated to reflect this decision change. Documentation drift creates confusion for future maintainers who will read the SPEC and expect different behavior.

Fix: Update the SPEC to match the implementation:

  • Line 47: Change pattern from '^\.changeset/.*\.md$' to '^\.changeset/'
  • Line 58: Remove "Non-markdown files like config.json should still trigger CI"
  • Line 72: Change to "All .changeset/ files (including config.json) are treated as changeset-only"
  • Test case readme clarity #4 (line 81): Update to "PR with .changeset/config.json changed → CI skipped"

Refs:

Comment thread .agents/skills/pr-context/SKILL.md Outdated
| **Author** | Andrew Mikofalvy |
| **Base** | `main` |
| **Repo** | inkeep/agents |
| **Head SHA** | `7ad17dd61c66ea12b129c2d1c72da22fd8797e49` |
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.

🟠 MAJOR: Generated local review artifact accidentally committed

Issue: This file contains auto-generated content from a local review session, including:

  • Specific commit SHA (842304ff52ec4a5e62502c0eabe7c4fce4c78b42)
  • Embedded diff content from an earlier state of this PR
  • References to "local review" mode that doesn't match the actual PR context

Why: Unlike other skills in .agents/skills/ which provide reusable guidance templates, this file contains ephemeral generated output. The content is already stale (references older commits) and will only become more so. Committing generated artifacts creates repository noise and confusion about what should be version-controlled.

Fix: Remove this file from the commit. If pr-context is intended as a skill, it should contain template/guidance content — not generated review output.

git rm .agents/skills/pr-context/SKILL.md

Refs:

amikofalvy and others added 5 commits March 27, 2026 14:48
The review fixer narrowed the pattern to only .md files, but per user
request all .changeset/ file changes (including config.json) should
skip CI. Also keeps the improved error handling from the review fix.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Drop auto-format.yml and ci.yml App token warning changes that the
review auto-fixer added — not part of the changeset-only skip feature.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

(5) Total Issues | Risk: Medium

🟠⚠️ Major (2) 🟠⚠️

Inline Comments:

  • 🟠 Major: SPEC.md:72 Acceptance Criteria #5 contradicts Edge Cases (line 58) and implementation — says config.json should trigger CI
  • 🟠 Major: SPEC.md:81 Test Case #4 contradicts implementation — expects config.json to trigger CI

🟡 Minor (3) 🟡

Inline Comments:

  • 🟡 Minor: SPEC.md:32 Description mentions only .md files but implementation matches all .changeset/ files
  • 🟡 Minor: SPEC.md:47 Code example shows '^\.changeset/.*\.md$' pattern but implementation uses '^\.changeset/'
  • 🟡 Minor: SPEC.md:68 Acceptance Criteria #1 mentions only .md files

💭 Consider (1) 💭

💭 1) multi-file Extract duplicated changeset detection logic

Issue: The 22-line changeset-only detection block is copied identically across 3 locations: ci.yml (lines 61-82, 368-389) and cypress.yml (lines 79-100).

Why: Code duplication creates maintenance burden — any bug fix or behavior change must be applied to 3 locations. This PR demonstrates the risk since all 3 locations must stay in sync.

Fix: Consider extracting to a reusable composite action at .github/composite-actions/changeset-check/action.yml. The repo already uses composite actions (e.g., cypress-e2e/action.yml). This could be a follow-up improvement.

✅ What's Good

  • Error handling improvement — Capturing gh pr diff failures with 2>&1 and emitting ::warning:: annotations is a solid fail-safe pattern
  • Shell logic is correct — The grep -v '^\.changeset/' pattern, empty-check guards, and || true for grep are all properly implemented
  • PR_NUMBER env var — Correctly passed through for pull_request events

🕐 Pending Recommendations (1)

  • 🟠 Previous review flagged SPEC/implementation mismatch — partially addressed (line 58 updated) but lines 32, 47, 68, 72, 81 still contradict the implementation

📝 Note on Prior False Positive

The previous review flagged .agents/skills/pr-context/SKILL.md as accidentally committed. This was a false positive — that file exists on main branch and was not introduced by this PR. The changed files list correctly shows only 3 files: ci.yml, cypress.yml, and SPEC.md.


🚫 REQUEST CHANGES

Summary: The CI workflow changes (error handling, broader changeset pattern) are implemented correctly. However, the SPEC document has internal contradictions that need to be resolved before merge. The author updated line 58 to reflect the new "all .changeset/ files" behavior, but missed updating 5 other locations that still reference the old .md-only behavior. All fixes have 1-click suggestion blocks in the inline comments.

Reviewers (2)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-devops 2 0 1 0 5 0 0
pr-review-standards 0 0 0 0 0 0 0
Total 2 0 1 0 5 0 0

Note: pr-review-standards returned no new findings — shell logic is correct, and SPEC issues were already covered by devops reviewer.

Discarded (1)
Location Issue Reason Discarded
.agents/skills/pr-context/SKILL.md Prior review flagged as accidentally committed False positive — file exists on main branch, not introduced by this PR

2. PRs that modify `.changeset/*.md` AND other files still run full CI
3. The `changeset-release/main` branch detection continues to work as before
4. Push events to main always run full CI
5. `.changeset/config.json` changes are NOT treated as changeset-only
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.

🟠 MAJOR: Acceptance Criteria contradicts Edge Cases and implementation

Issue: This line says config.json changes should NOT skip CI, but line 58 says "All .changeset/ files skip CI: Both .md changeset entries and config.json are changeset-only changes". The implementation (using grep -v '^\.changeset/') matches line 58's intent.

Why: Internal contradictions in specs create confusion about intended behavior. Future maintainers may "fix" the implementation to match this incorrect criterion.

Fix: (1-click apply)

Suggested change
5. `.changeset/config.json` changes are NOT treated as changeset-only
5. All `.changeset/` files (including `config.json`) ARE treated as changeset-only — CI skipped

Refs:

1. **PR with only `.changeset/foo.md` added** -> CI skipped
2. **PR with `.changeset/foo.md` + `src/index.ts` changed** -> CI runs
3. **PR on `changeset-release/main` branch** -> CI skipped (existing behavior)
4. **PR with `.changeset/config.json` changed** -> CI runs
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.

🟠 MAJOR: Test case contradicts implementation

Issue: This test case expects config.json changes to trigger CI, but the implementation skips CI for all .changeset/ files.

Why: Test cases that contradict implementation will cause incorrect pass/fail judgments during manual testing and future CI validation.

Fix: (1-click apply)

Suggested change
4. **PR with `.changeset/config.json` changed** -> CI runs
4. **PR with `.changeset/config.json` changed** -> CI skipped

Refs:


Then check:
```bash
NON_CHANGESET_FILES=$(echo "$CHANGED_FILES" | grep -v '^\.changeset/.*\.md$' || true)
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.

🟡 Minor: Code example shows wrong grep pattern

Issue: The pattern '^\.changeset/.*\.md$' only matches .md files, but the implementation uses '^\.changeset/' to match all files in .changeset/.

Why: Code examples in specs should match the actual implementation to avoid confusion when developers reference this document.

Fix: (1-click apply)

Suggested change
NON_CHANGESET_FILES=$(echo "$CHANGED_FILES" | grep -v '^\.changeset/.*\.md$' || true)
NON_CHANGESET_FILES=$(echo "$CHANGED_FILES" | grep -v '^\.changeset/' || true)

Refs:


### Enhanced Detection Logic

Add a second check after the existing one: if `IS_CHANGESET` is still `false` and the event is not a `push` to main, use the GitHub API to list changed files and check if ALL of them match `.changeset/*.md`.
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.

🟡 Minor: Description mentions only .md files

Issue: This line says "check if ALL of them match .changeset/*.md" but the implementation matches all files in .changeset/, not just .md files.

Why: The prose should accurately describe what the implementation does.

Fix: (1-click apply)

Suggested change
Add a second check after the existing one: if `IS_CHANGESET` is still `false` and the event is not a `push` to main, use the GitHub API to list changed files and check if ALL of them match `.changeset/*.md`.
Add a second check after the existing one: if `IS_CHANGESET` is still `false` and the event is not a `push` to main, use the GitHub API to list changed files and check if ALL of them are under `.changeset/`.


## Acceptance Criteria

1. PRs that only add/modify `.changeset/*.md` files skip all CI steps in `ci.yml` and `cypress.yml`
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.

🟡 Minor: Acceptance criteria mentions only .md files

Issue: This criterion says "PRs that only add/modify .changeset/*.md files" but the implementation skips CI for all .changeset/ files.

Why: Acceptance criteria should accurately describe the implemented behavior.

Fix: (1-click apply)

Suggested change
1. PRs that only add/modify `.changeset/*.md` files skip all CI steps in `ci.yml` and `cypress.yml`
1. PRs that only add/modify files under `.changeset/` skip all CI steps in `ci.yml` and `cypress.yml`

@github-actions github-actions Bot deleted a comment from claude Bot Mar 27, 2026
@amikofalvy amikofalvy added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit eb59460 Mar 27, 2026
28 checks passed
@amikofalvy amikofalvy deleted the feat/changeset-only-skip-ci-fix branch March 27, 2026 22:09
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.

1 participant