prevent replacing release on draft action

This commit is contained in:
mat 2024-02-10 09:01:03 -03:00 committed by GitHub
parent 032f133189
commit a46edf400f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,7 +20,20 @@ jobs:
- name: Declare Version Variable
id: ref
shell: bash
run: echo "version=$(unzip -p ${{ github.workspace }}/dev/geode-nightly.zip geode-sdk-geode-*/VERSION | xargs)" >> $GITHUB_OUTPUT
run: |
VERSION=$(unzip -p ${{ github.workspace }}/dev/geode-nightly.zip geode-sdk-geode-*/VERSION | xargs)
echo "version=$VERSION" >> $GITHUB_OUTPUT
# test if release already exists
set +e
curl --fail "https://api.github.com/repos/geode-sdk/geode/releases/tags/v$VERSION" --silent --output /dev/null
RESULT=$?
set -e
if [ $RESULT -eq 0 ]; then
echo "Release $VERSION already exists! Not replacing it.."
exit 1
else
- name: Move Files
run: |