Skip to content

Commit 06a2993

Browse files
mmckyCopilot
andauthored
Update .github/workflows/ci.yml
Co-authored-by: Copilot <[email protected]>
1 parent a16c7d5 commit 06a2993

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,15 @@ jobs:
147147
const deployUrl = '${{ steps.netlify-deploy.outputs.DEPLOY_URL }}';
148148
const state = '${{ job.status }}' === 'success' ? 'success' : 'failure';
149149
150-
await github.rest.repos.createDeploymentStatus({
151-
owner: context.repo.owner,
152-
repo: context.repo.repo,
153-
deployment_id: context.payload.deployment?.id || 0,
154-
state: state,
155-
environment_url: deployUrl,
156-
description: state === 'success' ? 'Preview deployed successfully' : 'Preview deployment failed'
157-
});
150+
if (context.payload.deployment?.id) {
151+
await github.rest.repos.createDeploymentStatus({
152+
owner: context.repo.owner,
153+
repo: context.repo.repo,
154+
deployment_id: context.payload.deployment.id,
155+
state: state,
156+
environment_url: deployUrl,
157+
description: state === 'success' ? 'Preview deployed successfully' : 'Preview deployment failed'
158+
});
159+
} else {
160+
console.log('No deployment ID found; skipping deployment status update.');
161+
}

0 commit comments

Comments
 (0)