You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/release-please.yml
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -210,6 +210,8 @@ jobs:
210
210
211
211
- name: Verify release commit produced a tag (ghost-release guard)
212
212
if: github.ref == 'refs/heads/main'
213
+
env:
214
+
GH_TOKEN: ${{ github.token }}
213
215
run: |
214
216
# `github-release` exits 0 even when it finds nothing to release ([]).
215
217
# If the commit that triggered this run is a merged `release: X.Y.Z`
@@ -223,7 +225,11 @@ jobs:
223
225
exit 0
224
226
fi
225
227
if git ls-remote --exit-code --tags origin "v$VER" >/dev/null 2>&1; then
226
-
echo "Tag v$VER exists - release verified"
228
+
if ! gh api "repos/${{ github.repository }}/releases/tags/v$VER" >/dev/null 2>&1; then
229
+
echo "::error::Tag v$VER exists but there is no GitHub Release for it - the publish workflow (release: published) will never fire. Create it: gh release create v$VER --generate-notes"
230
+
exit 1
231
+
fi
232
+
echo "Tag v$VER and its GitHub Release exist - release verified"
227
233
else
228
234
echo "::error::Merged release commit for $VER but no v$VER tag exists. github-release silently no-opped (merged release PR likely missing the autorelease pending label). Add the label to the merged PR and re-run this workflow."
0 commit comments