fix(ci): exit early if we have no PR number in CI

This commit is contained in:
Rickard Andersson 2023-08-25 12:43:30 +03:00
parent f160bd3816
commit 3d0eea506a
1 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,7 @@ jobs:
- 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 "")"
run: echo "::set-output name=number::$(gh pr view --json number -q .number || echo "null")"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v2
@ -66,6 +66,10 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pullRequestNumber = ${{ steps.pull_request.outputs.number }};
if (pullRequestNumber === null) {
return;
}
const fs = require('fs');
const deploymentUrl = fs.readFileSync('_vercel-deployment-url', 'utf8');
await github.rest.issues.createComment({