From 051042f5930a19f909e4a3faac2bef94b3e7b7ec Mon Sep 17 00:00:00 2001 From: Yidi Date: Thu, 26 Sep 2024 21:32:34 -0400 Subject: [PATCH] fix(workflow): correct release existence check and add debug output Refactored the release existence check to return a simple boolean string ('true'/'false') rather than an object. Added a step to print the release existence status for debugging purposes. This ensures correct conditional evaluation and aids in troubleshooting workflow issues. --- .github/workflows/release-on-tag.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index da5bcb32..dae1d9af 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -21,18 +21,21 @@ jobs: repo: context.repo.repo, tag: context.ref.replace('refs/tags/', ''), }) - return { release_exists: 'true' } + return 'true' } catch (error) { if (error.status === 404) { - return { release_exists: 'false' } + return 'false' } else { throw error } } result-encoding: string + - name: Print release_exists output + run: echo "release_exists is ${{ steps.check_release.outputs.result }}" + - name: Create Release - if: steps.check_release.outputs.release_exists == 'false' + if: steps.check_release.outputs.result == 'false' uses: actions/create-release@v1 with: tag_name: ${{ github.ref_name }}