fix(ci): use step to get PR number via `gh` CLI

This commit is contained in:
Rickard Andersson 2023-08-23 21:27:07 +03:00
parent 3a85149d55
commit 0c4357abda
1 changed files with 9 additions and 1 deletions

View File

@ -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}`,