From 5cc1092c4ca1f488359780cf9c3fd0a7aee70e56 Mon Sep 17 00:00:00 2001 From: Nhan Phan Date: Sat, 14 Sep 2024 10:31:40 -0700 Subject: [PATCH] point tag to right place --- .github/workflows/deploy-program.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-program.yml b/.github/workflows/deploy-program.yml index eac1a33..4e4eab9 100644 --- a/.github/workflows/deploy-program.yml +++ b/.github/workflows/deploy-program.yml @@ -219,13 +219,21 @@ jobs: git reset --soft HEAD~1 git stash pop - - name: Create tag + - name: Create env tag uses: actions/github-script@v5 with: script: | + const refData = await github.rest.git.getRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: 'tags/${{ inputs.git_ref }}' + }); + if (refData.status !== 200) { + throw new Error('Failed to fetch existing tag'); + } github.rest.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'refs/tags/${{ needs.check_tag.outputs.program }}-${{ inputs.cluster }}', - sha: '${{ github.sha }}' + sha: refData.data.object.sha });