Repository navigation
ci: 🎡 judge a pull request by its own changes - #52
Closed
ChenYilong wants to merge 3 commits into
Closed
ChenYilong wants to merge 3 commits into
ChenYilong wants to merge 3 commits into
Conversation
PR #50 changed only documents but ran the full CI: its base had no finished run yet, so the nearest-green rule fell back to an older master commit and counted the base's newer code as the pull request's. On a pull_request event, ci-changes.sh now skips when the pull request changes only documents since its merge base, whatever the base's state; pushes keep the nearest-green rule. By @ChenYilong <luohanchenyilong@163.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017y7XP2P2UnTvzHG1KZL67A
From an advisor review of the documents-only rule: the green list counted pull request runs, including skipped documents runs on untested code, so it now counts only push and manual runs; pushes to claude/** ran the push rule next to the pull request run on the same commit, so the workflows now run on pushes to master only; Markdown shipped in the package's resources counts as code. The rule text in ci-cd.md, ios.yml and the script header says which rule applies to pushes and which to pull requests. By @ChenYilong <luohanchenyilong@163.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017y7XP2P2UnTvzHG1KZL67A
From CYLSearchViewController's report. ci-changes.sh searched only the first-parent history, stopped at the first green commit, and treated identical files as code. It now searches all parents, takes the first green commit whose files equal the head's or differ only in documents, and counts an empty diff as a match. sync-spm-mirror.sh gives its fresh clone the Actions bot identity when none is set, so a release on a runner no longer stops with "Author identity unknown". New tests: scripts/test-ci-changes.sh (12 cases; 8 passed before, 12 after), run by the shellcheck job. By @ChenYilong <luohanchenyilong@163.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017y7XP2P2UnTvzHG1KZL67A
ChenYilong
pushed a commit
that referenced
this pull request
Dec 4, 2026
By @ChenYilong <luohanchenyilong@163.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017y7XP2P2UnTvzHG1KZL67A
Owner
Author
|
Merged into #53 ( Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes why documents-only pull requests still ran the full CI.
Evidence: PR #50 changes documents only, yet its
Changesjob decidedRun the CI jobs: true (code changed since aae5ea24…, the nearest commit with a successful ios.yml run). Its base, master5da2db61, had no finished iOS run yet, so the script fell back to an older green master commit. PR #48's code, merged into master in between, then counted as PR #50's.Logic hole: the nearest-green rule is right for pushes, so a branch head never looks green over untested code. It was also applied to pull requests, though, and because macOS runs take hours, the base's newest commit is almost never green when a documents PR is opened.
Fix (
scripts/ci-changes.sh): on apull_requestevent, if the PR changes only documents since its merge base, its jobs are skipped, whatever state the base is in. The base's own push runs still report the base. Pushes keep the nearest-green rule.Tested locally on real commits:
docs/The rule text is updated in
docs/instructions/ci-cd.md, AGENTS.md, CLAUDE.md anddocs/prompts/ci-documents-only.md.Generated by Claude Code