Compare commits

2 Commits

Author SHA1 Message Date
Faris Laptop 6cdcdd2d29 merge dev into production
Release / release (push) Failing after 25s
2026-07-20 16:15:36 +05:00
Faris Laptop d832e748ec ci: guard on the tag itself, not the release object
CI / build (push) Successful in 34s
A tag can exist without a release (pushed by hand), and that still means
the version is taken. Checking the tag makes the failure say 'bump the
version' instead of surfacing a raw NuGet duplicate error.
2026-07-20 16:14:53 +05:00
+4 -2
View File
@@ -36,6 +36,8 @@ jobs:
# A published NuGet version can never be replaced, so refuse to re-run an # A published NuGet version can never be replaced, so refuse to re-run an
# already released version instead of silently doing nothing. # already released version instead of silently doing nothing.
# Checks the tag itself: a tag can exist without a release object (e.g. it
# was pushed by hand), and that still means the version is spoken for.
- name: Refuse to release an existing version - name: Refuse to release an existing version
env: env:
TOKEN: ${{ secrets.GITEA_TOKEN }} TOKEN: ${{ secrets.GITEA_TOKEN }}
@@ -44,9 +46,9 @@ jobs:
TAG="v${{ steps.version.outputs.value }}" TAG="v${{ steps.version.outputs.value }}"
CODE=$(curl -s -o /dev/null -w '%{http_code}' \ CODE=$(curl -s -o /dev/null -w '%{http_code}' \
-H "Authorization: token $TOKEN" \ -H "Authorization: token $TOKEN" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/tags/$TAG") "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/tags/$TAG")
if [ "$CODE" = "200" ]; then if [ "$CODE" = "200" ]; then
echo "::error::$TAG is already released. Bump <Version> in the csproj on dev, then merge again." echo "::error::$TAG already exists — version ${{ steps.version.outputs.value }} is already released. Bump <Version> in src/CertifiEd.Client/CertifiEd.Client.csproj on dev, then merge into production again."
exit 1 exit 1
fi fi