From 49a191eb60f3e7d5e927842174be0f4fcdd73a3e Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Wed, 18 Nov 2026 16:26:07 -0300 Subject: [PATCH] release: a module tag that is not there is told by gh's status, not its output gh api prints a 404's body on stdout and exits 1, so the release of 1974d6e read the error's JSON as the commit v0.20261118.2 names and refused to tag it (release run of 2026-11-18 19:23). The status says whether the tag is there; the output is read only when it is. Co-Authored-By: Claude Opus 5.5 --- Taskfile.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index e2df1c4..1876d33 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -183,9 +183,9 @@ tasks: requires: vars: [SHA, MODULE] cmds: + # gh prints a 404's body on stdout and exits 1: its status says there is no tag, not its output. - | - at=$(gh api "repos/{owner}/{repo}/git/ref/tags/{{.MODULE}}" --jq .object.sha 2>/dev/null || true) - if [ -z "$at" ]; then + if ! at=$(gh api "repos/{owner}/{repo}/git/ref/tags/{{.MODULE}}" --jq .object.sha 2>/dev/null); then gh api "repos/{owner}/{repo}/git/refs" -f ref="refs/tags/{{.MODULE}}" -f sha="{{.SHA}}" > /dev/null elif [ "$at" != "{{.SHA}}" ]; then echo "{{.MODULE}} names $at, not {{.SHA}}" >&2