From 082faae0ae65a4e29540a6fd5c1b84324f5cc19f Mon Sep 17 00:00:00 2001 From: Loong Date: Thu, 30 Nov 2023 20:46:07 +0800 Subject: [PATCH] ci: set GH_REPO and GH_TOKEN for release job --- .github/workflows/release.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c9b7fed..6de32279 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -180,6 +180,8 @@ jobs: permissions: contents: write env: + GH_REPO: ${{ github.repository }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} CHANNEL: ${{ needs.meta.outputs.channel }} VERSION: ${{ needs.meta.outputs.version }} TAG: ${{ needs.meta.outputs.tag }} @@ -251,11 +253,11 @@ jobs: - name: Check existing release if: ${{ fromJson(needs.meta.outputs.publish) }} run: | - if [ "$TAG" == "nightly" ]; then - echo "Release as nightly, clear existing release and tag" - gh release delete "$TAG" --yes --cleanup-tag - else - if gh release view "$TAG" &> /dev/null; then + if gh release view "$TAG" &> /dev/null; then + if [ "$TAG" == "nightly" ]; then + echo "Release as nightly, clear existing release and tag" + gh release delete "$TAG" --yes --cleanup-tag + else echo "Release $TAG already exists, abort" exit 1 fi