Make sure we received a deployment response before setting deploymentInfo

This commit is contained in:
James M. Greene
2023-03-09 08:19:19 -06:00
parent 02bdb05bdf
commit f824564d16

View File

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