mirror of
https://github.com/actions/deploy-pages.git
synced 2026-02-09 03:45:15 +00:00
Swap out the Pages Deployment status check interaction for the wrapped one from api-client
This commit is contained in:
@@ -97,19 +97,18 @@ class Deployment {
|
|||||||
|
|
||||||
// Poll the deployment endpoint for status
|
// Poll the deployment endpoint for status
|
||||||
async check() {
|
async check() {
|
||||||
try {
|
const deploymentId = this.deploymentInfo?.id || this.buildVersion
|
||||||
const statusUrl =
|
const timeout = Number(core.getInput('timeout'))
|
||||||
this.deploymentInfo != null
|
const reportingInterval = Number(core.getInput('reporting_interval'))
|
||||||
? this.deploymentInfo['status_url']
|
const maxErrorCount = Number(core.getInput('error_count'))
|
||||||
: `${this.githubApiUrl}/repos/${this.repositoryNwo}/pages/deployment/status/${this.buildVersion}`
|
|
||||||
const timeout = Number(core.getInput('timeout'))
|
|
||||||
const reportingInterval = Number(core.getInput('reporting_interval'))
|
|
||||||
const maxErrorCount = Number(core.getInput('error_count'))
|
|
||||||
var startTime = Date.now()
|
|
||||||
var errorCount = 0
|
|
||||||
|
|
||||||
// Time in milliseconds between two deployment status report when status errored, default 0.
|
let startTime = Date.now()
|
||||||
var errorReportingInterval = 0
|
let errorCount = 0
|
||||||
|
|
||||||
|
// Time in milliseconds between two deployment status report when status errored, default 0.
|
||||||
|
let errorReportingInterval = 0
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
/*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
|
/*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -117,10 +116,9 @@ class Deployment {
|
|||||||
await new Promise(r => setTimeout(r, reportingInterval + errorReportingInterval))
|
await new Promise(r => setTimeout(r, reportingInterval + errorReportingInterval))
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
var res = await axios.get(statusUrl, {
|
let res = await getPagesDeploymentStatus({
|
||||||
headers: {
|
githubToken: this.githubToken,
|
||||||
Authorization: `token ${this.githubToken}`
|
deploymentId
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if (res.data.status == 'succeed') {
|
if (res.data.status == 'succeed') {
|
||||||
|
|||||||
Reference in New Issue
Block a user