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.
This commit is contained in:
Yidi 2024-09-26 21:32:34 -04:00
parent c1127051d4
commit 051042f593

View File

@ -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 }}