Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make sure we received a deployment response before setting deployment…
…Info
  • Loading branch information
James M. Greene authored and James M. Greene committed Mar 9, 2023
1 parent 02bdb05 commit f824564
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/deployment.js
Expand Up @@ -62,13 +62,17 @@ class Deployment {
idToken,
isPreview: this.isPreview
})
this.deploymentInfo = {
...deployment,
id: deployment?.id || deployment?.['status_url']?.split('/')?.pop() || this.buildVersion,
pending: true

if (deployment) {
this.deploymentInfo = {
...deployment,
id: deployment?.id || deployment?.['status_url']?.split('/')?.pop() || this.buildVersion,
pending: true
}
}

core.info(`Created deployment for ${this.buildVersion}, ID: ${this.deploymentInfo.id}`)
core.info(`Created deployment for ${this.buildVersion}, ID: ${this.deploymentInfo?.id}`)

core.debug(JSON.stringify(deployment))

return deployment
Expand Down

0 comments on commit f824564

Please sign in to comment.