Fix GitHub Actions syntax error - replace optional chaining with conditional
This commit is contained in:
parent
7fc38f28c0
commit
d48897c1f8
2
.github/workflows/auto-fix-ci-inline.yml
vendored
2
.github/workflows/auto-fix-ci-inline.yml
vendored
@ -163,7 +163,7 @@ jobs:
|
||||
const baseBranch = '${{ github.event.workflow_run.head_branch }}';
|
||||
const prUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/compare/${baseBranch}...${branchName}?quick_pull=1`;
|
||||
|
||||
const issueNumber = ${{ github.event.workflow_run.pull_requests[0]?.number || 'null' }};
|
||||
const issueNumber = ${{ github.event.workflow_run.pull_requests[0] && github.event.workflow_run.pull_requests[0].number || 'null' }};
|
||||
|
||||
if (issueNumber) {
|
||||
await github.rest.issues.createComment({
|
||||
|
||||
2
.github/workflows/auto-fix-ci.yml
vendored
2
.github/workflows/auto-fix-ci.yml
vendored
@ -105,7 +105,7 @@ jobs:
|
||||
const baseBranch = '${{ github.event.workflow_run.head_branch }}';
|
||||
const prUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/compare/${baseBranch}...${branchName}?quick_pull=1`;
|
||||
|
||||
const issueNumber = ${{ github.event.workflow_run.pull_requests[0]?.number || 'null' }};
|
||||
const issueNumber = ${{ github.event.workflow_run.pull_requests[0] && github.event.workflow_run.pull_requests[0].number || 'null' }};
|
||||
|
||||
if (issueNumber) {
|
||||
await github.rest.issues.createComment({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user