verify-action-build: detect the tarball root instead of assuming package/ - #1174
Open
potiuk wants to merge 1 commit into
Open
verify-action-build: detect the tarball root instead of assuming package/#1174potiuk wants to merge 1 commit into
potiuk wants to merge 1 commit into
Conversation
…age/ DefinitelyTyped roots @types/* tarballs at the bare package name (estree/index.d.ts), not package/. _tarball_files stripped only a literal "package/", so no extracted path lined up with node_modules/@types/<pkg>/<rel>, nothing was accounted for, and every file of every vendored @types package was reported as injected code -- even though the tarball had already passed integrity verification. Surfaced by #1171 (github-pages-deploy-action v4.9.0), whose yarn -> npm migration added node_modules/.package-lock.json and so switched this check on for the first time. With the fix that commit verifies clean: 116 packages, 0 extra. Generated-by: Claude Code (Opus 5)
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.
Code change
Summary
_tarball_files()stripped a literalpackage/prefix from npm tarball members. DefinitelyTyped roots@types/*tarballs at the bare package name instead (estree/index.d.ts,json-schema/LICENSE), so no extracted path lined up withnode_modules/@types/<pkg>/<rel>, nothing was accounted for, and every file of every vendored@typespackage was reported as injected code - after that tarball had already passed integrity verification.The root directory is now detected rather than assumed, and
./-prefixed member names are normalised. A tarball whose files do not all share one root is left untouched.Surfaced by #1171 (
JamesIves/github-pages-deploy-actionv4.9.0), whose yarn -> npm migration addednode_modules/.package-lock.jsonand so switched this check on for the first time. It reported 13 extra files across@types/esrecurse,@types/estreeand@types/json-schema.Type of change
Testing
uv run pytest utils/tests/- 329 passed../package/root, multi-root and root-level tarballs left untouched, and a precision guard that an injected file inside a bare-name-rooted package is still flagged.verify_vendored_node_modules('JamesIves', 'github-pages-deploy-action', 'fa24774553152dd7873cd16ebd8d959b010c5445')now reports 116 packages verified, 0 extra, 0 mismatched, 0 errors (previously 116 verified plus 13 extra).Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting