fix(workflow): correct output setting in release-on-tag workflow

Refactored how the release_exists output is set to be compatible with
GitHub Actions syntax. This ensures the workflow reliably detects if
a release already exists, improving the robustness of the release
process.
This commit is contained in:
Yidi 2024-09-26 21:25:56 -04:00
parent a20178fc6e
commit 78bff5adc5

View File

@ -21,15 +21,14 @@ jobs:
repo: context.repo.repo,
tag: context.ref.replace('refs/tags/', ''),
})
return { release_exists: 'true' }
outputs.release_exists = 'true'
} catch (error) {
if (error.status === 404) {
return { release_exists: 'false' }
outputs.release_exists = 'false'
} else {
throw error
}
}
outputs: release_exists
- name: Create Release
if: steps.check_release.outputs.release_exists == 'false'
@ -42,4 +41,4 @@ jobs:
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}