Skip to content

Commit

Permalink
prevent replacing release on draft action
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool authored Feb 10, 2024
1 parent 032f133 commit a46edf4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit a46edf4

Please sign in to comment.