Skip to content

fix(release): pass --repo to gh release upload + bump rand to 0.9.4#50

Merged
williajm merged 2 commits intomainfrom
fix/release-upload-repo-flag
Apr 18, 2026
Merged

fix(release): pass --repo to gh release upload + bump rand to 0.9.4#50
williajm merged 2 commits intomainfrom
fix/release-upload-repo-flag

Conversation

@williajm
Copy link
Copy Markdown
Owner

@williajm williajm commented Apr 17, 2026

Summary

Two fixes bundled into one small PR:

1. Release workflow: gh release upload needs --repo

Second failure on the v0.4.0 re-release: the two `gh release upload` steps errored with `fatal: not a git repository`. The publish job has no `actions/checkout`, so `gh` can't infer the target repo. Pass `--repo "${{ github.repository }}"` explicitly to both steps.

2. Bump `rand` 0.9.2 → 0.9.4 (closes Dependabot alert #6, GHSA-cq8v-f236-94qc)

`rand` < 0.9.3 is unsound when used with a custom `log` logger that calls `rand::rng()` and hits a reseed during the log call. We don't trigger that path (we use `rand_chacha::ChaCha8Rng` directly, no custom logger, no `log` feature), so the bug is not reachable in forgery — but this is a free lockfile-only fix and the alert was open on the repo.

`Cargo.toml` pin (`rand = "0.9"`) unchanged; `cargo update -p rand` pulls 0.9.4 under that constraint.

Context on v0.4.0

  • PyPI upload itself succeeded on v0.4.0 — `forgery==0.4.0` is live (https://pypi.org/project/forgery/0.4.0/).
  • Only the post-publish asset uploads to the GitHub Release failed, leaving the v0.4.0 release page with empty assets (no sbom.cdx.json or SHA256SUMS.txt).
  • Leaving v0.4.0 as-is (no re-tag). These fixes take effect for v0.4.1 onward.

Test plan

🤖 Generated with Claude Code

The v0.4.0 re-release hit a second failure in the same workflow: the
`Upload SBOM to GitHub Release` and `Upload SHA256SUMS to GitHub Release`
steps both errored with:

    failed to run git: fatal: not a git repository
    (or any of the parent directories): .git

The `publish` job has no `actions/checkout` step, so `gh release upload`
cannot infer the target repository from `.git/config` and bails out
before the API call.

Pass the repo explicitly via `--repo "${{ github.repository }}"` on both
upload steps so they work without a checkout.

Context: the v0.4.0 wheels and sdist DID make it to PyPI (the publish
step itself succeeded). Only the GitHub Release asset uploads failed,
which is why the 0.4.0 release page has empty assets. Leaving v0.4.0
as-is; this fix takes effect for the next tagged release.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Closes Dependabot alert #6.

Versions < 0.9.3 are unsound when used with a custom `log` logger that
calls `rand::rng()` and hits a reseed during the log call. We don't
trigger that path (we use `rand_chacha::ChaCha8Rng` directly, no custom
logger, no `log` feature), so the bug is not reachable in forgery — but
this is a free lockfile-only fix and the current version was flagged on
the repo.

`Cargo.toml` pin (`rand = "0.9"`) unchanged; `cargo update -p rand`
pulls 0.9.4 under that constraint. All 832 Rust tests still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@williajm williajm changed the title fix(release): pass --repo to gh release upload in publish job fix(release): pass --repo to gh release upload + bump rand to 0.9.4 Apr 17, 2026
@sonarqubecloud
Copy link
Copy Markdown

@williajm williajm merged commit 82ea0bc into main Apr 18, 2026
13 checks passed
@williajm williajm deleted the fix/release-upload-repo-flag branch April 18, 2026 00:07
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.

1 participant