fix broken test cases

This commit is contained in:
yimysty
2022-06-28 18:18:42 -07:00
parent 72b116b825
commit e2219a89b1
5 changed files with 35 additions and 11 deletions

View File

@@ -62,8 +62,10 @@ class Deployment {
})
this.requestedDeployment = true
core.info(`Created deployment for ${this.buildVersion}`)
core.info(JSON.stringify(response.data))
this.deploymentInfo = response.data
if (response && response.data) {
core.info(JSON.stringify(response.data))
this.deploymentInfo = response.data
}
} catch (error) {
core.info(error.stack)
@@ -75,7 +77,13 @@ class Deployment {
if (error.response) {
let errorMessage = `Failed to create deployment (status: ${error.response.status}) with build version ${this.buildVersion}. `
if (error.response.status == 400) {
errorMessage += `Responded with: ${error.response.data?.message}`
let message = ""
if (error.response.data && error.response.data.message) {
message = error.response.data.message
} else {
message = error.response.data
}
errorMessage += `Responded with: ${message}`
}
else if (error.response.status == 403) {
errorMessage += `Ensure GITHUB_TOKEN has permission "pages: write".`