fix(ci): publish the try-bindgen preview from the PR's branch, not the reset worktree - #136
Merged
Merged
Conversation
…tree `publish_preview` ran `npx pkg-pr-new publish` straight after `create-pull-request`. That action commits the regenerated files to its own branch and pushes, then restores the local repository to its pre-action state — so the working tree is back to the BASE bindings by the time the publish runs. The published preview would have contained the OLD output while the PR sitting next to it showed the new one: a silent mismatch, and exactly the "looks convincing, is wrong" failure the fingerprint step exists to prevent. Fetch and check out the PR's branch before publishing. That also pins the pkg.pr.new URL to a commit that actually CONTAINS the content, instead of to the dispatched ref's SHA. The full branch name is now emitted once as a step output and consumed by both the PR step and the publish step — two copies of the same expression are two chances to drift, and a drifted publish step would fetch a branch that does not exist. Not caught before merge because the publish path can only be exercised on Actions; the YAML, slugify, bucket-delta and fingerprint snippets were all validated locally. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jagguji
added a commit
that referenced
this pull request
Aug 6, 2026
Reverts #135 and #136. Removes .github/workflows/try-bindgen.yml; no other file was ever touched by either PR, so main returns to exactly its pre-#135 state. Reverted at the author's request — the workflow is not wanted on main. Nothing else depends on it: it was dispatch-only, never referenced by another workflow, and never ran. The two paths it was built to serve remain available: - reviewing an unreleased bindgen: install it locally with `npm i --no-save <spec>` and run `npm run generate` - an installable preview of this package: `preview.yml`, dispatched against any branch Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Follow-up to #135.
publish_preview=truewould have published a preview containing the old bindings.The bug
The publish step ran immediately after
peter-evans/create-pull-request:The action leaves the working tree back at the base state, so the published tarball would carry the pre-regeneration
src/while the draft PR right next to it showed the new one. You'd install the link, see no change, and have no signal why — the same "looks convincing, is wrong" class the fingerprint step was added to eliminate.The fix
Fetch and check out the PR's branch before publishing:
This also pins the pkg.pr.new URL to a commit that actually contains the content, rather than to the dispatched ref's SHA — so the preview's provenance is checkable, which is the whole point of the workflow.
node_modulesis gitignored and survives the checkout, so no reinstall is needed.Also
The full branch name is now emitted once as a step output and consumed by both the PR step and the publish step. It was previously written out twice as the same inline expression — two chances to drift, and a drifted publish step would
git fetcha branch that doesn't exist.Why it wasn't caught before merge
The publish path can only be exercised on Actions. Everything testable locally was tested — YAML parse, step-reference resolution, the slugify sed against all three input forms, the bucket-delta script against this repo's real
_bindgen-summary.json, and the fingerprint snippet against an actually-installed pkg.pr.new build. #135 said as much: "Not exercised end-to-end on Actions — that needs it on the default branch first." This is that gap closing.Still not end-to-end verified —
publish_previewneeds a real run with the input on. The non-publish path (the diff PR, which is the main use) is unaffected either way.🤖 Generated with Claude Code