mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
refactor: remove unnecessary release existence check
This commit is contained in:
parent
3b027b836f
commit
468c31a994
17
.github/workflows/scheduled-release.yml
vendored
17
.github/workflows/scheduled-release.yml
vendored
@ -28,29 +28,12 @@ jobs:
|
|||||||
# Checkout the latest tag
|
# Checkout the latest tag
|
||||||
git checkout $LATEST_TAG
|
git checkout $LATEST_TAG
|
||||||
|
|
||||||
- name: Check if release exists
|
|
||||||
id: check_release
|
|
||||||
run: |
|
|
||||||
TAG_NAME=${{ env.latest_tag }}
|
|
||||||
echo "Checking for existing release for tag: $TAG_NAME"
|
|
||||||
RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GH_PAT_TOKEN }}" \
|
|
||||||
"https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG_NAME")
|
|
||||||
|
|
||||||
if echo "$RESPONSE" | grep -q '"id":'; then
|
|
||||||
echo "Release already exists for tag $TAG_NAME."
|
|
||||||
echo "release_exists=true" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "No release found for tag $TAG_NAME."
|
|
||||||
echo "release_exists=false" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: "1.22"
|
go-version: "1.22"
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
if: env.release_exists == 'false'
|
|
||||||
uses: goreleaser/goreleaser-action@v6
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
distribution: goreleaser-pro
|
distribution: goreleaser-pro
|
||||||
|
Loading…
x
Reference in New Issue
Block a user