Skip to content

Automate SENSITIVE_PATHS drift check for claude-code-action bumps - #153

Merged
d-morrison merged 3 commits into
mainfrom
claude/gha-pr-comment-explain-jvtcw1
Jul 2, 2026
Merged

d-morrison merged 3 commits into
mainfrom
claude/gha-pr-comment-explain-jvtcw1

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Closes #152

Summary

Test plan

  • Verified the extraction/diff logic locally against the current pinned
    SHA (fad22eb3fa582b7357fc0ea48af6645851b884fd) and the current local
    list — matches.
  • CI's new sensitive-paths job passes on this PR.

Generated by Claude Code

…ion drift

Automates the manual SENSITIVE_PATHS re-check called for in claude.yml's
comment (and done by hand in PR #150's review): diff the pinned
claude-code-action SHA's restore-config.ts SENSITIVE_PATHS list against
claude.yml's local mirror on every PR. Closes #152.
The manual re-check note is superseded by the sensitive-paths job in
_selftest.yml. Part of #152.
Copilot AI review requested due to automatic review settings July 1, 2026 21:35
@github-actions
github-actions Bot removed the request for review from Copilot July 1, 2026 21:35
@claude

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)

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.

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)

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.

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.
Copilot AI review requested due to automatic review settings July 1, 2026 21:40

Copy link
Copy Markdown
Collaborator Author

Addressed: the non-blocking robustness note on _selftest.yml:206 — added an inline comment documenting the sed range-terminator assumption (bare ]; closing the upstream block), so a future red run caused by an upstream reformat is easy to diagnose (b801039).

No other findings from the review.


Generated by Claude Code

@github-actions
github-actions Bot removed the request for review from Copilot July 1, 2026 21:40
@claude

claude Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 46s —— View job


Code review: PR #153 (re-review after latest push)

  • Gather context (diff, prior review, latest commit)
  • Check whether the prior non-blocking finding was addressed
  • Review latest diff for new issues
  • Post findings

Verdict: no new findings — prior confirming review still stands.

This round only adds commit b801039, which addresses the one non-blocking robustness note from the prior review (inline comment on _selftest.yml:212, about the sed -n '/const SENSITIVE_PATHS/,/];/p' range terminator assuming a bare ]; closing line). The commit adds a 6-line comment documenting exactly that assumption and its failure mode (lines 206–211 of .github/workflows/_selftest.yml), which is a purely additive, comment-only change — no new logic, no behavior change, nothing to introduce a fresh bug.

Everything else from the prior review summary still holds: the sensitive-paths job fits the existing _selftest.yml pattern, the SHA/list extraction regexes are each verified to match exactly one line in claude.yml, both sides of the comparison are sorted before diffing, and the updated comment in claude.yml (now lines 613–619) accurately points at the new automated check with a correct gha#152 reference.

No blocking issues.

@d-morrison
d-morrison merged commit 38a3f20 into main Jul 2, 2026
15 checks passed
@d-morrison
d-morrison deleted the claude/gha-pr-comment-explain-jvtcw1 branch July 2, 2026 06:51
d-morrison added a commit that referenced this pull request Jul 2, 2026
…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.
d-morrison added a commit that referenced this pull request Jul 2, 2026
…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.
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.

Automate SENSITIVE_PATHS drift check for claude-code-action bumps

1 participant