From 538671d3cc2dc1fa292dbb00185d3cdbef9aa73b Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 21 Oct 2026 00:25:46 +0000 Subject: [PATCH] Handle missing release tags correctly (#64887) --- tools/pipelines/typescript-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/pipelines/typescript-publish.yml b/tools/pipelines/typescript-publish.yml index 9718afd61fd..7dd99d760de 100644 --- a/tools/pipelines/typescript-publish.yml +++ b/tools/pipelines/typescript-publish.yml @@ -370,7 +370,8 @@ extends: ;; esac - existingTagCommit="$(gh api "repos/microsoft/TypeScript/git/ref/tags/$tag" --jq '.object.sha' 2>/dev/null || true)" + existingTagCommit="$(gh api "repos/microsoft/TypeScript/git/matching-refs/tags/$tag" \ + --jq ".[] | select(.ref == \"refs/tags/$tag\") | .object.sha")" if [ -n "$existingTagCommit" ]; then if [ "$existingTagCommit" != "$RELEASE_SOURCE_COMMIT" ]; then echo "Tag $tag points to $existingTagCommit, expected $RELEASE_SOURCE_COMMIT." >&2