From dcfed628ae8b121d2c5bdae0f85c1e9e4d9b7102 Mon Sep 17 00:00:00 2001 From: mposolda Date: Thu, 23 Jan 2025 09:30:51 +0100 Subject: [PATCH] The draft nightly untagged release is incorrectly created by 'Release nightly' GH action closes #558 Signed-off-by: mposolda --- .github/workflows/x-release.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/x-release.yml b/.github/workflows/x-release.yml index f8332575..f276dd9c 100644 --- a/.github/workflows/x-release.yml +++ b/.github/workflows/x-release.yml @@ -55,20 +55,14 @@ jobs: - name: Push changes run: git push --force origin refs/tags/${{ inputs.tag }} - - name: Check if release exists - id: release-exists - run: > - echo "release-exists=$( - if ( gh release view ${{ inputs.tag }} --repo ${{ inputs.gh-org }}/keycloak-nodejs-connect &> /dev/null ); then - echo 'true' - else - echo 'false' - fi - )" >> "$GITHUB_OUTPUT" - - - name: Create a github release - if: steps.release-exists.outputs.release-exists == 'false' - run: gh release create ${{ inputs.tag }} --repo ${{ inputs.gh-org }}/keycloak-nodejs-connect --title ${{ inputs.tag }} --draft ${{ inputs.nightly && '--prerelease' || '' }} + - name: Create a github release if does not exists + id: create-release-if-not-exists + run: | + if ( gh release view ${{ inputs.tag }} --repo ${{ inputs.gh-org }}/keycloak-nodejs-connect &> /dev/null ); then + echo "Release ${{ inputs.tag }} already exists" + else + gh release create ${{ inputs.tag }} --repo ${{ inputs.gh-org }}/keycloak-nodejs-connect --title ${{ inputs.tag }} --draft ${{ inputs.nightly && '--prerelease' || '' }} + fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}