mirror of
https://github.com/actions/deploy-pages.git
synced 2025-12-09 12:26:11 +00:00
set output page_url
This commit is contained in:
@@ -18,6 +18,7 @@ class Deployment {
|
||||
this.githubToken = context.githubToken
|
||||
this.workflowRun = context.workflowRun
|
||||
this.requestedDeployment = false
|
||||
this.deploymentInfo = null
|
||||
}
|
||||
|
||||
// Ask the runtime for the unsigned artifact URL and deploy to GitHub Pages
|
||||
@@ -56,6 +57,7 @@ class Deployment {
|
||||
this.requestedDeployment = true
|
||||
core.info(`Created deployment for ${this.buildVersion}`)
|
||||
core.info(JSON.stringify(response.data))
|
||||
this.deploymentInfo = response.data
|
||||
} catch (error) {
|
||||
core.info(`Failed to create deployment for ${this.buildVersion}.`)
|
||||
if (error.response && error.response.data) {
|
||||
@@ -69,7 +71,10 @@ class Deployment {
|
||||
// Poll the deployment endpoint for status
|
||||
async check() {
|
||||
try {
|
||||
const statusUrl = `https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
|
||||
const statusUrl = this.deploymentInfo != null ?
|
||||
this.deploymentInfo["status_url"] :
|
||||
`https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
|
||||
core.setOutput('page_url', this.deploymentInfo != null ? this.deploymentInfo["page_url"] : "");
|
||||
const timeout = core.getInput('timeout')
|
||||
const reportingInterval = core.getInput('reporting_interval')
|
||||
const maxErrorCount = core.getInput('error_count')
|
||||
|
||||
Reference in New Issue
Block a user