Skip to content

Commit 538671d

Browse files
authored
Handle missing release tags correctly (#64887)
1 parent 5733ab0 commit 538671d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎tools/pipelines/typescript-publish.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@ extends:
370370
;;
371371
esac
372372
373-
existingTagCommit="$(gh api "repos/microsoft/TypeScript/git/ref/tags/$tag" --jq '.object.sha' 2>/dev/null || true)"
373+
existingTagCommit="$(gh api "repos/microsoft/TypeScript/git/matching-refs/tags/$tag" \
374+
--jq ".[] | select(.ref == \"refs/tags/$tag\") | .object.sha")"
374375
if [ -n "$existingTagCommit" ]; then
375376
if [ "$existingTagCommit" != "$RELEASE_SOURCE_COMMIT" ]; then
376377
echo "Tag $tag points to $existingTagCommit, expected $RELEASE_SOURCE_COMMIT." >&2

0 commit comments

Comments
 (0)