fix(workflow): simplify release process by removing redundant checks

The release-on-tag workflow has been streamlined by eliminating the
redundant steps checking for existing releases. This change reduces
complexity and speeds up the release process by directly creating a
release on every tag push without prior existence verification.
This commit is contained in:
Yidi 2024-09-26 21:39:51 -04:00
parent 051042f593
commit 3beb944d1e

View File

@ -10,32 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check if Release Exists
id: check_release
uses: actions/github-script@v7
with:
script: |
try {
await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: context.ref.replace('refs/tags/', ''),
})
return 'true'
} catch (error) {
if (error.status === 404) {
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 - name: Create Release
if: steps.check_release.outputs.result == 'false'
uses: actions/create-release@v1 uses: actions/create-release@v1
with: with:
tag_name: ${{ github.ref_name }} tag_name: ${{ github.ref_name }}