ci: fix notify-registry draft-state release lookup#26
Merged
Conversation
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) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a recurring failure in the release workflow by avoiding getReleaseByTag, which returns 404 for draft releases created by GoReleaser, and instead locating the release via the releases list so the workflow can flip the draft to published.
Changes:
- Replaced
repos.getReleaseByTagwithrepos.listReleasesand a tag-name lookup to handle draft releases. - Added an explicit error when the release tag isn’t found in the fetched release list.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+105
to
+108
| 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)`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes recurring notify-registry failure across plugin release workflows:
Publish GitHub releasestep usesgithub.rest.repos.getReleaseByTagwhich returns 404 for DRAFT releases. GoReleaser config creates releases as draft → step fails on every release.Root cause
getReleaseByTagonly returns published (non-draft) releases. Drafts have no tag indexing — accessible only by release ID. GoReleaser-created draft race the post-release script.Fix
Replace with
listReleases(which DOES return drafts) + find by tag. Single deterministic API call; no 404-on-draft race.Affected workflow files (this PR)
.github/workflows/release.ymlnotify-registry job,Publish GitHub releasestep.Sibling PRs (same fix, ~9 repos affected)
This is one of 9 coordinated PRs fixing the identical bug pattern across plugin repos. Other repos: workflow-plugin-{gcp, azure, authz, authz-ui, bento, security, supply-chain, agent, tofu}.
Test plan
Rollback
Revert commit. Defensive change; no other code paths touched.