From 8a3dcafc41285abcbbbcd26f55814d5669c54690 Mon Sep 17 00:00:00 2001 From: Jon Langevin Date: Sun, 17 May 2026 08:06:23 -0400 Subject: [PATCH] ci: fix notify-registry draft-state release lookup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause (recurring across plugin repos): the "Publish GitHub release" step in notify-registry job uses github.rest.repos.getReleaseByTag which returns 404 for DRAFT releases — drafts are NOT accessible by tag name, only by release ID. GoReleaser config creates releases as draft → step fails on every release. Symptoms observed: - workflow-plugin-authz run 25950232345 (v0.5.4, 2026-05-16) — flagged - workflow-plugin-azure run 25989195581 (v1.2.1, 2026-05-17) — Phase 2.5+ cleanup bundle hit this; defensive `gh release edit --draft=false` applied post-fact - workflow-plugin-azure v1.2.0 (Phase 2 cascade, 2026-05-16) — same - Likely affects every release in repos with this workflow pattern Fix: replace getReleaseByTag with listReleases + find by tag (drafts ARE returned by listReleases). Single deterministic API call; no 404-on-draft race. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b26519..27b1276 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -100,7 +100,13 @@ jobs: script: | const tag = context.ref.replace('refs/tags/', ''); const { owner, repo } = context.repo; - const { data: release } = await github.rest.repos.getReleaseByTag({ owner, repo, tag }); + // listReleases returns drafts; getReleaseByTag 404s on drafts. GoReleaser + // creates releases as draft; this step flips them to non-draft post-publish. + const { data: releases } = await github.rest.repos.listReleases({ owner, repo, per_page: 100 }); + const release = releases.find(r => r.tag_name === tag); + if (!release) { + throw new Error(`release for tag ${tag} not found in repo listing (latest 100 releases)`); + } if (release.draft) { await github.rest.repos.updateRelease({ owner,