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
|
on: push
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull_requests: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cache-dependencies:
|
cache-dependencies:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -27,6 +30,11 @@ jobs:
|
||||||
needs: cache-dependencies
|
needs: cache-dependencies
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- 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
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '18.x'
|
node-version: '18.x'
|
||||||
|
@ -59,7 +67,7 @@ jobs:
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const deploymentUrl = fs.readFileSync('_vercel-deployment-url', 'utf8');
|
const deploymentUrl = fs.readFileSync('_vercel-deployment-url', 'utf8');
|
||||||
await github.rest.issues.createComment({
|
await github.rest.issues.createComment({
|
||||||
issue_number: context.issue.number,
|
issue_number: ${{ steps.pull_request.outputs.number }},
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
body: `Deployed to ${deploymentUrl}`,
|
body: `Deployed to ${deploymentUrl}`,
|
||||||
|
|
Loading…
Reference in New Issue