Fix GitHub Actions syntax error - replace optional chaining with conditional

This commit is contained in:
km-anthropic
2025-08-19 14:47:27 -07:00
parent 7fc38f28c0
commit d48897c1f8
2 changed files with 2 additions and 2 deletions

View File

@@ -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({

View File

@@ -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({