mirror of
https://github.com/actions/deploy-pages.git
synced 2025-12-09 12:26:11 +00:00
fix broken test cases
This commit is contained in:
@@ -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".`
|
||||
|
||||
Reference in New Issue
Block a user