From 0c4357abda364756c1b43e4ffcfbecbebc9c0d62 Mon Sep 17 00:00:00 2001 From: Rickard Andersson Date: Wed, 23 Aug 2023 21:27:07 +0300 Subject: [PATCH] fix(ci): use step to get PR number via `gh` CLI --- .github/workflows/ui-tests.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ui-tests.yaml b/.github/workflows/ui-tests.yaml index b5b6bb77..e92201df 100644 --- a/.github/workflows/ui-tests.yaml +++ b/.github/workflows/ui-tests.yaml @@ -2,6 +2,9 @@ name: 'UI tests' on: push +permissions: + pull_requests: read + jobs: cache-dependencies: runs-on: ubuntu-latest @@ -27,6 +30,11 @@ jobs: needs: cache-dependencies steps: - uses: actions/checkout@v2 + - name: Get PR number + id: pull_request + run: echo "::set-output name=number::$(gh pr view --json number -q .number || echo "")" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: actions/setup-node@v2 with: node-version: '18.x' @@ -59,7 +67,7 @@ jobs: const fs = require('fs'); const deploymentUrl = fs.readFileSync('_vercel-deployment-url', 'utf8'); await github.rest.issues.createComment({ - issue_number: context.issue.number, + issue_number: ${{ steps.pull_request.outputs.number }}, owner: context.repo.owner, repo: context.repo.repo, body: `Deployed to ${deploymentUrl}`,