Swap out the Pages Deployment canceling interaction for the wrapped one from api-client

This commit is contained in:
James M. Greene
2023-02-22 08:23:03 -06:00
parent a0faa043a9
commit f577a41201

View File

@@ -192,19 +192,13 @@ class Deployment {
// Cancel the deployment
try {
const pagesCancelDeployEndpoint = `${this.githubApiUrl}/repos/${this.repositoryNwo}/pages/deployment/cancel/${this.buildVersion}`
await axios.put(
pagesCancelDeployEndpoint,
{},
{
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${this.githubToken}`,
'Content-type': 'application/json'
}
}
)
core.info(`Deployment cancelled with ${pagesCancelDeployEndpoint}`)
const deploymentId = this.deploymentInfo?.id || this.buildVersion
await cancelPagesDeployment({
githubToken: this.githubToken,
deploymentId
})
core.info(`Canceled deployment with ID ${deploymentId}`)
if (this.deploymentInfo) {
this.deploymentInfo.pending = false
}