Skip to content

fix(action): accept from-version input on publish-ghcr - #41

Merged
BYK merged 1 commit into
mainfrom
fix/action-from-version-input
Aug 1, 2026
Merged

fix(action): accept from-version input on publish-ghcr#41
BYK merged 1 commit into
mainfrom
fix/action-from-version-input

Conversation

@BYK

@BYK BYK commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Closes #40. The publish-ghcr mode re-derived the previous version from the registry independently of the generate-ghcr step that actually downloaded the source binary and ran bsdiff. If the registry state changed between the two steps, the two values could disagree and binpatch consumers would silently hit SHA mismatch (the library only verifies the final output SHA, not the source binary identity — the annotation is a chain pointer, not a content hash).

Fix

Add a new from-version input on publish-ghcr. When set, the annotation on the pushed patch manifest uses THIS value verbatim. When empty (back-compat), the old registry re-derive runs and prints a hint suggesting the caller thread the value from generate-ghcr.

Consumer wiring

- uses: BYK/binpatch/action@vX.Y.Z
  id: gen
  with: { mode: generate-ghcr, ... }

- uses: BYK/binpatch/action@vX.Y.Z
  with:
    mode: publish-ghcr
    from-version: ${{ steps.gen.outputs.from-version }}

Files

  • action/action.yml: add from-version input, thread to push_patches via env, use input when set else re-derive
  • action/README.md: document the new input and the gen→publish wiring

Relationship to other fixes

Combined, the chain-side fixes (binpatch fd-close + getsentry/cli CI workflow) and this action-side fix mean the consumer can stop running its own hand-rolled patch generation/publish and consume the binpatch action directly.

Verification

  • pnpm test: 58 passed
  • pnpm build: clean
  • pnpm typecheck: clean
  • pnpm lint: (no script)

Closes #40. The publish-ghcr mode re-derived the previous version
from the registry independently of the generate-ghcr step that
actually downloaded the source binary and ran bsdiff. If the
registry state changed between the two steps (concurrent push,
semver re-ordering with a cross-major nightly), the two values
could disagree and `binpatch` consumers would silently hit SHA
mismatch (the library only verifies the final output SHA, not the
source binary identity — the annotation is a chain pointer, not a
content hash).

Add a new `from-version` input on publish-ghcr. When set, the
annotation on the pushed patch manifest uses THIS value verbatim.
When empty (back-compat), the old registry re-derive runs and
prints a hint suggesting the caller thread the value from
generate-ghcr.

The consumer-side wiring change is trivial:

```yaml
- uses: BYK/binpatch/action@vX.Y.Z
  id: gen
  with: { mode: generate-ghcr, ... }

- uses: BYK/binpatch/action@vX.Y.Z
  with:
    mode: publish-ghcr
    from-version: ${{ steps.gen.outputs.from-version }}
```

Files:
- action/action.yml: add `from-version` input, thread to push_patches
  via env, use input when set else re-derive
- action/README.md: document the new input and the gen→publish wiring
@BYK
BYK merged commit 490bbb6 into main Aug 1, 2026
3 checks passed
@BYK
BYK deleted the fix/action-from-version-input branch August 1, 2026 00:04
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-01 00:05 UTC

BYK added a commit that referenced this pull request Aug 1, 2026
The 0.4.0 release was cut on the `release/0.4.0` branch but that branch
was never merged back to `main`. The 0.4.0 git tag points at a commit
(`d5e8341`) that is NOT reachable from current main, which breaks
Craft's auto-versioning (it relies on `git describe` walking back from
HEAD to find the most recent release tag).

The next release workflow run after this fix should produce 0.4.1 (one
new commit since 0.4.0: the from-version input fix from PR #41).
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.

fix(action): publish-ghcr re-derives from-version independently of generate-ghcr

1 participant