diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae6469d..f2c08da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -206,14 +206,14 @@ jobs: - name: Check if release already exists id: check + env: + GH_TOKEN: ${{ github.token }} run: | - if gh release view "${{ github.ref_name }}" &>/dev/null; then + if gh release view "$GITHUB_REF_NAME" &>/dev/null; then echo "exists=true" >> "$GITHUB_OUTPUT" else echo "exists=false" >> "$GITHUB_OUTPUT" fi - env: - GH_TOKEN: ${{ github.token }} - name: Validate tag matches source version run: | @@ -358,7 +358,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - TAG="${{ github.ref_name }}" + TAG="$GITHUB_REF_NAME" VERSION="${TAG#v}" if gh release view "$TAG" >/dev/null 2>&1; then echo "::notice::GitHub Release ${TAG} already exists; editing it instead of creating a duplicate." @@ -404,7 +404,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - TAG="${{ github.ref_name }}" + TAG="$GITHUB_REF_NAME" VERSION="${TAG#v}" SAFE_TAG="${VERSION//./\\.}" @@ -454,7 +454,7 @@ jobs: - name: Summary run: | - TAG="${{ github.ref_name }}" + TAG="$GITHUB_REF_NAME" VERSION="${TAG#v}" { echo "## Release ${VERSION}" diff --git a/templates/universal/release.yml b/templates/universal/release.yml index b86749a..fe06560 100644 --- a/templates/universal/release.yml +++ b/templates/universal/release.yml @@ -182,7 +182,7 @@ jobs: - name: Extract version from tag id: version run: | - TAG="${{ github.ref_name }}" + TAG="$GITHUB_REF_NAME" VERSION="${TAG#v}" echo "tag=$TAG" >> "$GITHUB_OUTPUT" echo "version=$VERSION" >> "$GITHUB_OUTPUT"