Commit bebc54d
fix(release): find an existing draft by listing, upload to it by id (#535)
* fix(release): find an existing draft by listing, upload to it by id
GitHub's releases/tags/<tag> endpoint never returns drafts, so re-pointing
an unpublished tag took the "no release yet" path and created a second
2.3.0 draft instead of updating the first. The workflow now lists releases
to find the tag's release, fails if more than one exists, and updates a
draft's notes and assets by release id; `gh release upload <tag>` misses
drafts the same way, so assets are replaced through the uploads API.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(release): tag as jq data, per-tag concurrency, keep the draft's tag
- Pass the tag (and asset names) to jq with --arg instead of splicing them
into the filter text.
- Serialize runs per tag, queued rather than cancelled, so two pushes of
the same tag can't both find no release and each create a draft.
- Paginate the asset lookup.
- Restate tag_name when PATCHing the draft's notes: a PATCH without it
renames a draft's tag to untagged-<hash> (verified against a draft on an
existing tag), which would detach the draft from its tag and send the
next run down the create path. Likely also how 2.1.1 was published as
untagged-<hash>.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(release): pipefail on the release lookup; only the tag's current build uploads
- set -o pipefail in the create/update step (run steps default to bash -e
without it), so a failed release listing fails the step instead of
reading as "no release" and creating a duplicate draft.
- Before touching the release, check that the tag still points at the
commit this run built; if it was re-pointed since, exit without
uploading. GitHub keeps only the newest pending run per concurrency
group and doesn't promise push order, so this, not the queue, is what
keeps an older build off the draft.
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3e414ca commit bebc54d
1 file changed
Lines changed: 54 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
| |||
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
79 | | - | |
80 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
85 | 97 | | |
86 | 98 | | |
| 99 | + | |
87 | 100 | | |
88 | | - | |
89 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
90 | 126 | | |
91 | 127 | | |
92 | 128 | | |
93 | | - | |
| 129 | + | |
94 | 130 | | |
95 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
96 | 134 | | |
97 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
98 | 144 | | |
99 | 145 | | |
100 | 146 | | |
101 | 147 | | |
102 | 148 | | |
103 | | - | |
| 149 | + | |
104 | 150 | | |
105 | 151 | | |
106 | 152 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | 153 | | |
0 commit comments