From b718c5600d4ef7f0bb44da547c1010f44b84bb57 Mon Sep 17 00:00:00 2001 From: Nhan Phan Date: Thu, 2 Jan 2025 22:38:48 -0800 Subject: [PATCH] use arg for github script --- .github/workflows/deploy-program.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-program.yml b/.github/workflows/deploy-program.yml index 5eeda8f4..0965ef4c 100644 --- a/.github/workflows/deploy-program.yml +++ b/.github/workflows/deploy-program.yml @@ -267,9 +267,9 @@ jobs: uses: actions/github-script@v7 if: github.event.inputs.dry_run == 'false' with: + github-token: ${{ secrets.GH_TAGGER_TOKEN }} script: | - const octokit = github.getOctokit('${{ secrets.GH_TAGGER_TOKEN }}'); - const refData = await octokit.rest.git.getRef({ + const refData = await github.rest.git.getRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'tags/${{ inputs.git_ref }}' @@ -277,14 +277,14 @@ jobs: if (refData.status !== 200) { throw new Error('Failed to fetch existing tag'); } - await octokit.rest.git.createRef({ + await github.rest.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'refs/tags/${{ needs.check_tag.outputs.program }}-${{ inputs.cluster }}', sha: refData.data.object.sha }).catch(err => { if (err.status !== 422) throw err; - octokit.rest.git.updateRef({ + github.rest.git.updateRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'tags/${{ needs.check_tag.outputs.program }}-${{ inputs.cluster }}',