Skip to content

Commit fbaf414

Browse files
jasonvargaclaude
andcommitted
Fail the tag-existence check on ls-remote errors
Captures the ls-remote output first so a transient failure aborts the run instead of being read as "tag absent". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ac249fe commit fbaf414

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ jobs:
5252

5353
- name: Assert tag does not already exist
5454
run: |
55-
if git ls-remote --tags origin "$TAG" | grep -q .; then
56-
echo "::error::Tag $TAG already exists on remote. Aborting."
57-
exit 1
58-
fi
55+
existing="$(git ls-remote --tags origin "$TAG")"
56+
[ -z "$existing" ] || { echo "::error::Tag $TAG already exists on remote. Aborting."; exit 1; }
5957
6058
- name: Use Node.js 20.19.0
6159
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0

0 commit comments

Comments
 (0)