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:
parent
a20178fc6e
commit
78bff5adc5
7
.github/workflows/release-on-tag.yml
vendored
7
.github/workflows/release-on-tag.yml
vendored
@ -21,15 +21,14 @@ jobs:
|
|||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
tag: context.ref.replace('refs/tags/', ''),
|
tag: context.ref.replace('refs/tags/', ''),
|
||||||
})
|
})
|
||||||
return { release_exists: 'true' }
|
outputs.release_exists = 'true'
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.status === 404) {
|
if (error.status === 404) {
|
||||||
return { release_exists: 'false' }
|
outputs.release_exists = 'false'
|
||||||
} else {
|
} else {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outputs: release_exists
|
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
if: steps.check_release.outputs.release_exists == 'false'
|
if: steps.check_release.outputs.release_exists == 'false'
|
||||||
@ -42,4 +41,4 @@ jobs:
|
|||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
x
Reference in New Issue
Block a user