fix(ci): use step to get PR number via `gh` CLI
This commit is contained in:
parent
3a85149d55
commit
0c4357abda
|
@ -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}`,
|
||||
|
|
Loading…
Reference in New Issue