Compare commits
2 Commits
7e80226bf2
...
production
| Author | SHA1 | Date | |
|---|---|---|---|
| 6cdcdd2d29 | |||
| d832e748ec |
@@ -36,6 +36,8 @@ jobs:
|
||||
|
||||
# A published NuGet version can never be replaced, so refuse to re-run an
|
||||
# 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
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
@@ -44,9 +46,9 @@ jobs:
|
||||
TAG="v${{ steps.version.outputs.value }}"
|
||||
CODE=$(curl -s -o /dev/null -w '%{http_code}' \
|
||||
-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
|
||||
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
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user