Skip to content

Commit e183f29

Browse files
committed
Check release existence, not just tag, before skipping
The tag may exist from a prior run that lacked the release creation step. Now the job creates the tag if missing, then independently checks if the release exists before deciding to skip.
1 parent 0d5536b commit e183f29

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,15 @@ jobs:
9393
echo "Could not extract version"
9494
exit 1
9595
fi
96-
if git rev-parse "v${ver}" >/dev/null 2>&1; then
97-
echo "Tag v${ver} already exists, skipping"
96+
if ! git rev-parse "v${ver}" >/dev/null 2>&1; then
97+
echo "Creating tag v${ver}"
98+
git tag "v${ver}"
99+
git push origin "v${ver}"
100+
fi
101+
if gh release view "v${ver}" --repo "${{ github.repository }}" >/dev/null 2>&1; then
102+
echo "Release v${ver} already exists, skipping"
98103
exit 0
99104
fi
100-
echo "Creating tag v${ver}"
101-
git tag "v${ver}"
102-
git push origin "v${ver}"
103105
echo "Creating release v${ver}"
104106
gh release create "v${ver}" \
105107
--repo "${{ github.repository }}" \

0 commit comments

Comments
 (0)