fix(release): correct output handling in release-on-tag workflow
Improved the way outputs are managed in the 'check_release' step by returning values instead of direct assignments. This change ensures better handling of release existence checks and improves code readability. Added 'result-encoding' to specify string encoding for results.
This commit is contained in:
parent
78bff5adc5
commit
c1127051d4
7
.github/workflows/release-on-tag.yml
vendored
7
.github/workflows/release-on-tag.yml
vendored
@ -21,14 +21,15 @@ jobs:
|
|||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
tag: context.ref.replace('refs/tags/', ''),
|
tag: context.ref.replace('refs/tags/', ''),
|
||||||
})
|
})
|
||||||
outputs.release_exists = 'true'
|
return { release_exists: 'true' }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.status === 404) {
|
if (error.status === 404) {
|
||||||
outputs.release_exists = 'false'
|
return { release_exists: 'false' }
|
||||||
} else {
|
} else {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
result-encoding: string
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
if: steps.check_release.outputs.release_exists == 'false'
|
if: steps.check_release.outputs.release_exists == 'false'
|
||||||
@ -41,4 +42,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