Compare commits
1 Commits
7e80226bf2
..
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| d832e748ec |
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user