From e40f203768d4aa2d5eb87e3f2c6bc478a6234ade Mon Sep 17 00:00:00 2001 From: Ruslan Lukoyanov <105169805+rLukoyanov@users.noreply.github.com> Date: Thu, 8 Aug 2024 00:18:53 +0300 Subject: [PATCH] Update Deploy Preview.yml --- .github/workflows/Deploy Preview.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Deploy Preview.yml b/.github/workflows/Deploy Preview.yml index 83e247d..c4248bc 100644 --- a/.github/workflows/Deploy Preview.yml +++ b/.github/workflows/Deploy Preview.yml @@ -37,13 +37,15 @@ jobs: - name: Comment on Pull Request uses: actions/github-script@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: script: | - github.issues.createComment({ - issue_number: context.issue.number, + const { DEPLOY_URL } = process.env; + const issue_number = context.payload.pull_request.number; + github.rest.issues.createComment({ + issue_number, owner: context.repo.owner, repo: context.repo.repo, - body: `Deployed to Vercel: ${process.env.DEPLOY_URL}` - }) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + body: `Deployed to Vercel: ${DEPLOY_URL}` + });