mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 06:54:13 +08:00
Fix GitHub Actions syntax error - replace optional chaining with conditional
This commit is contained in:
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 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 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) {
|
if (issueNumber) {
|
||||||
await github.rest.issues.createComment({
|
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 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 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) {
|
if (issueNumber) {
|
||||||
await github.rest.issues.createComment({
|
await github.rest.issues.createComment({
|
||||||
|
|||||||
Reference in New Issue
Block a user