Skip to content

fix(release): use explicit GitHub Release repository context - #176

Merged
Teakowa merged 7 commits into
mainfrom
agent/fix-release-state-handling
Aug 18, 2026
Merged

Teakowa merged 7 commits into
mainfrom
agent/fix-release-state-handling

Conversation

@Teakowa

@Teakowa Teakowa commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • remove the post-Release-Please draft creation/normalization step added by fix(release): ensure draft GitHub Release before distribution #174;
  • keep Release Please as the sole owner of the canonical tag and draft GitHub Release;
  • make every downstream gh release operation explicitly target ${GITHUB_REPOSITORY};
  • replace the misleading retry loop with a direct draft-state verification before asset upload.

Root cause

The failed v0.2.5 distribution job (32158864584 / 95784980760) ran gh release view "${RELEASE_TAG}" from upload-artifacts, a job that never checks out the repository. With no local .git and no --repo, GitHub CLI cannot resolve a repository. The workflow redirected stderr to /dev/null, retried for a minute, and misreported that as a missing draft Release.

A temporary PR-only diagnostic reproduced the exact condition on the current hosted runner:

gh release view v0.2.6 ...
failed to run git: fatal: not a git repository

The same job with --repo "$GITHUB_REPOSITORY" immediately resolved the existing draft and returned isDraft=true.

The v0.2.6 failure (32160766803 / 95788845067) was a second bug introduced by #174: gh ... --jq .publishedAt renders JSON null as an empty string, so the guard compared "" with the literal "null" and rejected a valid draft. Diagnostics confirmed both v0.2.5 and v0.2.6 are valid drafts and are visible through both the workflow token and the dedicated token.

Release contract

Release Please
  -> version + canonical tag + draft GitHub Release
repository distribution workflow
  -> verify canonical draft
  -> native archives/checksums
  -> package-manager manifests
  -> npm / GitHub Packages / Homebrew
  -> publish completed GitHub Release

A published Release is never moved back to draft. This preserves the draft -> assets -> publish lifecycle required for immutable-release compatibility.

Retry behavior

  • a distribution failure leaves the Release as a draft;
  • GitHub Actions re-run failed jobs can rerun the failed/dependent distribution jobs without recreating the Release Please release;
  • native/npm/manifest uploads use --clobber;
  • npm and GitHub Packages publication check whether the version already exists;
  • the Homebrew step skips when the formula is already current.

Validation

  • exact no-checkout/no---repo failure reproduced in a PR-only diagnostic workflow;
  • exact --repo lookup succeeds against the real v0.2.5 and v0.2.6 drafts;
  • publishedAt null rendering reproduced (publishedAt=<>), proving the fix(release): ensure draft GitHub Release before distribution #174 guard was invalid;
  • current GitHub CLI source confirms draft lookup by pending tag and supports explicit --repo for release commands;
  • final PR diff contains only .github/workflows/release-please.yml and .github/workflows/release.yml; temporary diagnostics were removed;
  • normal Wright CI/distribution validation is green except for any still-running unrelated jobs at review time.

The next real patch release remains the final end-to-end production proof.

@Teakowa Teakowa changed the title fix(release): normalize GitHub Release state before distribution fix(release): use explicit GitHub Release repository context Aug 18, 2026
@Teakowa
Teakowa marked this pull request as ready for review August 18, 2026 17:29
@Teakowa
Teakowa force-pushed the agent/fix-release-state-handling branch from 047956f to 44c051a Compare August 18, 2026 17:46
@Teakowa
Teakowa merged commit 752bb58 into main Aug 18, 2026
12 checks passed
@Teakowa
Teakowa deleted the agent/fix-release-state-handling branch August 18, 2026 18:00
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Make Workshop Great Again Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant