From 62b1e93ce9c0017469ae47436c00b4e1c110d92b Mon Sep 17 00:00:00 2001 From: Abdullah Yasir <56272322+teckmk@users.noreply.github.com> Date: Thu, 8 Aug 2024 13:07:48 +0500 Subject: [PATCH] fix: tag push in manual wf --- .github/workflows/manual_deploy.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/manual_deploy.yml b/.github/workflows/manual_deploy.yml index ba6f7c8..3b023e5 100644 --- a/.github/workflows/manual_deploy.yml +++ b/.github/workflows/manual_deploy.yml @@ -20,14 +20,22 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Git user - run: | - git config user.name "GitHub Actions" - git config user.email "actions@github.com" - - name: Create and push tag env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git tag -a "${{ github.event.inputs.tag_name }}" -m "${{ github.event.inputs.tag_message }}" - git push origin "${{ github.event.inputs.tag_name }}" + const tag = '${{ inputs.tag_name }}'; + const msg = '${{ inputs.tag_message }}'; + await github.rest.git.createTag({ + owner: context.repo.owner, + repo: context.repo.repo, + tag: tag, + sha: context.sha, + message: msg, + }); + await github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: `refs/tags/${tag}`, + sha: context.sha, + });