Repository navigation
Automate SENSITIVE_PATHS drift check for claude-code-action bumps - #153
Conversation
The manual re-check note is superseded by the sensitive-paths job in _selftest.yml. Part of #152.
This comment has been minimized.
This comment has been minimized.
| set -euo pipefail | ||
| sha=$(grep -oP 'anthropics/claude-code-action@\K[0-9a-f]{40}' .github/workflows/claude.yml | head -n1) | ||
| url="https://raw.githubusercontent.com/anthropics/claude-code-action/${sha}/src/github/operations/restore-config.ts" | ||
| upstream=$(curl -fsSL "$url" | sed -n '/const SENSITIVE_PATHS/,/];/p' | grep -oP '"\K[^"]+(?=")' | sort) |
There was a problem hiding this comment.
Non-blocking robustness note: the upstream extraction depends on restore-config.ts's SENSITIVE_PATHS array literal closing with a bare ]; (the sed -n '/const SENSITIVE_PATHS/,/];/p' range terminator). If a future claude-code-action bump reformats that declaration — e.g. ] as const;, a trailing comment on the closing line, or an earlier unrelated const SENSITIVE_PATHS... match — the range match would silently run past the intended block and pull in unrelated quoted strings, producing a confusing "out of sync" diff rather than a clean signal.
This can't produce a false pass (worst case is a false failure that's easy to debug by hand), and the PR description confirms the extraction currently matches the pinned SHA's content, so this isn't blocking — just worth a short inline comment documenting the assumption for whoever debugs the next red run.
| set -euo pipefail | ||
| sha=$(grep -oP 'anthropics/claude-code-action@\K[0-9a-f]{40}' .github/workflows/claude.yml | head -n1) | ||
| url="https://raw.githubusercontent.com/anthropics/claude-code-action/${sha}/src/github/operations/restore-config.ts" | ||
| upstream=$(curl -fsSL "$url" | sed -n '/const SENSITIVE_PATHS/,/];/p' | grep -oP '"\K[^"]+(?=")' | sort) |
There was a problem hiding this comment.
Non-blocking robustness note: the upstream extraction depends on restore-config.ts's SENSITIVE_PATHS array literal closing with a bare ]; (the sed -n '/const SENSITIVE_PATHS/,/];/p' range terminator). If a future claude-code-action bump reformats that declaration — e.g. ] as const;, a trailing comment on the closing line, or an earlier unrelated const SENSITIVE_PATHS... match — the range match would silently run past the intended block and pull in unrelated quoted strings, producing a confusing "out of sync" diff rather than a clean signal.
This can't produce a false pass (worst case is a false failure that's easy to debug by hand), and the PR description confirms the extraction currently matches the pinned SHA's content, so this isn't blocking — just worth a short inline comment documenting the assumption for whoever debugs the next red run.
…aths Addresses a non-blocking review note on PR #153: the extraction assumes upstream's SENSITIVE_PATHS block closes with a bare `];`. Document that assumption inline so a future red run from a reformat is easy to debug.
|
Addressed: the non-blocking robustness note on No other findings from the review. Generated by Claude Code |
|
Claude finished @d-morrison's task in 46s —— View job Code review: PR #153 (re-review after latest push)
Verdict: no new findings — prior confirming review still stands. This round only adds commit Everything else from the prior review summary still holds: the No blocking issues. |
…l checkout Some remote/web sessions have no local git clone at all, not just a missing gh CLI - every branch/file/PR change goes through the GitHub MCP write tools. Document the get_file_contents -> create_or_update_file pattern (full-file replace, sha required and must be re-fetched per write) and add table rows for create_or_update_file and create_branch, discovered while implementing gha#152/#153.
…l checkout (#167) Some remote/web sessions have no local git clone at all, not just a missing gh CLI - every branch/file/PR change goes through the GitHub MCP write tools. Document the get_file_contents -> create_or_update_file pattern (full-file replace, sha required and must be re-fetched per write) and add table rows for create_or_update_file and create_branch, discovered while implementing gha#152/#153.
Closes #152
Summary
claude.yml's "Push PR branch if Claude committed" step hardcodes a mirrorof
claude-code-action'sSENSITIVE_PATHSlist (fromsrc/github/operations/restore-config.ts), used to protect a PR's ownconfig edits from the auto-commit step (claude.yml auto-commit clobbers PRs that modify CLAUDE.md (restoreConfigFromBase residual gets committed) #39). The list could only be
re-checked by hand on every
claude-code-actionbump — most recently donemanually in PR ci(deps): bump anthropics/claude-code-action from 1.0.159 to 1.0.161 in the github-actions group across 1 directory #150's review.
sensitive-pathsjob to_selftest.ymlthat extracts the pinnedSHA from
claude.yml, fetchesrestore-config.tsfrom that exact commit,and diffs its
SENSITIVE_PATHSarray against the localfor cfg in …list — failing CI with a diff if they've drifted. Runs on every PR/push to
main.for cfg in …loop inclaude.ymlto pointat the new automated check instead of asking for a manual re-check.
Test plan
SHA (
fad22eb3fa582b7357fc0ea48af6645851b884fd) and the current locallist — matches.
sensitive-pathsjob passes on this PR.Generated by Claude Code