Skip to content

fix(release): download release assets without git checkout#7

Merged
rabii-chaarani merged 2 commits into
mainfrom
codex/fix-release-download-repo
May 28, 2026
Merged

fix(release): download release assets without git checkout#7
rabii-chaarani merged 2 commits into
mainfrom
codex/fix-release-download-repo

Conversation

@rabii-chaarani
Copy link
Copy Markdown
Owner

@rabii-chaarani rabii-chaarani commented May 28, 2026

Summary

  • Pass --repo "$GITHUB_REPOSITORY" to gh release download in the checkout-free PyPI publish job.
  • Add a protected publish-existing-tag workflow dispatch path to recover an already-created strict tag such as v0.2.0.
  • Update release workflow regression assertions so future edits keep the repository explicit and preserve the recovery path.

Root cause

publish-pypi does not check out the repository. Without --repo, GitHub CLI tried to infer the repository from .git and failed with fatal: not a git repository before PyPI publishing.

Recovery after merge

Dispatch the Release workflow from main with publish-existing-tag set to v0.2.0. The manual path still runs through the protected pypi environment, validates strict vX.Y.Z, runs the production release gate, downloads the GitHub Release assets, and publishes them to PyPI with Trusted Publishing.

Do not rely on rerunning the old failed job after this merges; that run was created from the old workflow attempt.

Verification

  • .venv/bin/python -m pytest tests/test_release_workflows.py -q
  • .venv/bin/ruff check tests/test_release_workflows.py
  • .venv/bin/python scripts/check_release_gate.py
  • .venv/bin/ruff check .
  • .venv/bin/python -m pytest -q

The PyPI publish job intentionally does not check out the repository, but gh release download tried to infer the repository from .git and failed before publishing. Pass GITHUB_REPOSITORY explicitly so the job can retrieve release assets in a checkout-free workspace.

Constraint: Publish job should stay minimal and use trusted publishing without requiring a checkout.

Rejected: Add actions/checkout to publish-pypi | unnecessary workspace state for a release asset download.

Confidence: high

Scope-risk: narrow

Directive: Keep checkout-free release jobs explicit about their repository when using gh.

Tested: .venv/bin/python -m pytest tests/test_release_workflows.py -q

Tested: .venv/bin/ruff check tests/test_release_workflows.py

Tested: .venv/bin/python scripts/check_release_gate.py

Tested: .venv/bin/ruff check .

Tested: .venv/bin/python -m pytest -q

Not-tested: Live PyPI publish rerun after merge.
A failed publish job cannot reliably be recovered by rerunning an old workflow attempt after the workflow file is fixed. Add a protected manual path for strict vX.Y.Z tags so an existing GitHub Release can be gated and published from the current workflow without creating another release.

Constraint: The v0.2.0 release already exists with uploaded artifacts, but the publish job failed before PyPI upload.

Rejected: Rely on rerunning the old failed job | it uses the original workflow attempt and still lacks the repository-explicit gh call.

Confidence: high

Scope-risk: moderate

Directive: Existing-tag publishing must remain behind the pypi environment and production release gate.

Tested: .venv/bin/python -m pytest tests/test_release_workflows.py -q

Tested: .venv/bin/ruff check tests/test_release_workflows.py

Tested: .venv/bin/python scripts/check_release_gate.py

Tested: .venv/bin/ruff check .

Tested: .venv/bin/python -m pytest -q

Not-tested: Live workflow_dispatch publish-existing-tag=v0.2.0.
@rabii-chaarani rabii-chaarani merged commit 05d046d into main May 28, 2026
36 checks passed
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