From 82bcd5e897b5e8f5434d32cda949ebb645e57266 Mon Sep 17 00:00:00 2001 From: Rory Z <16801068+Rory-Z@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:27:39 +0800 Subject: [PATCH] ci: fix workflow dispath have no correct tag Signed-off-by: Rory Z <16801068+Rory-Z@users.noreply.github.com> --- .github/workflows/release.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5589941f..71fecb73 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,13 +15,16 @@ on: required: true default: HEAD +env: + GIT_TAG: ${{ github.event_name == 'push' && github.ref || inputs.tag }} + jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event_name == 'push' && github.ref || inputs.tag }} + ref: ${{ env.GIT_TAG }} - name: Check helm if: github.event_name == 'push' run: | @@ -56,8 +59,8 @@ jobs: type=ref,event=branch type=ref,event=pr type=ref,event=tag - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{version}},value=${{ env.GIT_TAG }} + type=semver,pattern={{major}}.{{minor}},value=${{ env.GIT_TAG }} - uses: docker/build-push-action@v5 with: platforms: linux/amd64,linux/arm64,linux/arm/v7 @@ -81,6 +84,7 @@ jobs: fi - uses: softprops/action-gh-release@v1 with: + tag_name: ${{ env.GIT_TAG }} prerelease: ${{ steps.prerelease.outputs.prerelease }} generate_release_notes: true ## When you use the repository's GITHUB_TOKEN to perform tasks,