mirror of
https://github.com/actions/deploy-pages.git
synced 2025-12-08 16:16:16 +00:00
Add repo settings URL to help users react to error message
This commit is contained in:
5
dist/index.js
vendored
5
dist/index.js
vendored
@@ -6909,6 +6909,7 @@ function getRequiredVars() {
|
|||||||
actionsId: process.env.GITHUB_ACTION,
|
actionsId: process.env.GITHUB_ACTION,
|
||||||
githubToken: core.getInput('token'),
|
githubToken: core.getInput('token'),
|
||||||
githubApiUrl: process.env.GITHUB_API_URL ?? 'https://api.github.com',
|
githubApiUrl: process.env.GITHUB_API_URL ?? 'https://api.github.com',
|
||||||
|
githubServerUrl: process.env.GITHUB_SERVER_URL ?? 'https://github.com',
|
||||||
artifactName: core.getInput('artifact_name') || 'github-pages',
|
artifactName: core.getInput('artifact_name') || 'github-pages',
|
||||||
isPreview: core.getInput('preview') === 'true'
|
isPreview: core.getInput('preview') === 'true'
|
||||||
}
|
}
|
||||||
@@ -6957,6 +6958,7 @@ class Deployment {
|
|||||||
this.requestedDeployment = false
|
this.requestedDeployment = false
|
||||||
this.deploymentInfo = null
|
this.deploymentInfo = null
|
||||||
this.githubApiUrl = context.githubApiUrl
|
this.githubApiUrl = context.githubApiUrl
|
||||||
|
this.githubServerUrl = context.githubServerUrl
|
||||||
this.artifactName = context.artifactName
|
this.artifactName = context.artifactName
|
||||||
this.isPreview = context.isPreview === true
|
this.isPreview = context.isPreview === true
|
||||||
}
|
}
|
||||||
@@ -7027,7 +7029,8 @@ class Deployment {
|
|||||||
} else if (error.response.status == 403) {
|
} else if (error.response.status == 403) {
|
||||||
errorMessage += `Ensure GITHUB_TOKEN has permission "pages: write".`
|
errorMessage += `Ensure GITHUB_TOKEN has permission "pages: write".`
|
||||||
} else if (error.response.status == 404) {
|
} else if (error.response.status == 404) {
|
||||||
errorMessage += `Ensure GitHub Pages has been enabled.`
|
const pagesSettingsUrl = `${this.githubServerUrl}/${this.repositoryNwo}/settings/pages`
|
||||||
|
errorMessage += `Ensure GitHub Pages has been enabled: ${pagesSettingsUrl}`
|
||||||
} else if (error.response.status >= 500) {
|
} else if (error.response.status >= 500) {
|
||||||
errorMessage += `Server error, is githubstatus.com reporting a Pages outage? Please re-run the deployment at a later time.`
|
errorMessage += `Server error, is githubstatus.com reporting a Pages outage? Please re-run the deployment at a later time.`
|
||||||
}
|
}
|
||||||
|
|||||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -12,6 +12,7 @@ function getRequiredVars() {
|
|||||||
actionsId: process.env.GITHUB_ACTION,
|
actionsId: process.env.GITHUB_ACTION,
|
||||||
githubToken: core.getInput('token'),
|
githubToken: core.getInput('token'),
|
||||||
githubApiUrl: process.env.GITHUB_API_URL ?? 'https://api.github.com',
|
githubApiUrl: process.env.GITHUB_API_URL ?? 'https://api.github.com',
|
||||||
|
githubServerUrl: process.env.GITHUB_SERVER_URL ?? 'https://github.com',
|
||||||
artifactName: core.getInput('artifact_name') || 'github-pages',
|
artifactName: core.getInput('artifact_name') || 'github-pages',
|
||||||
isPreview: core.getInput('preview') === 'true'
|
isPreview: core.getInput('preview') === 'true'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class Deployment {
|
|||||||
this.requestedDeployment = false
|
this.requestedDeployment = false
|
||||||
this.deploymentInfo = null
|
this.deploymentInfo = null
|
||||||
this.githubApiUrl = context.githubApiUrl
|
this.githubApiUrl = context.githubApiUrl
|
||||||
|
this.githubServerUrl = context.githubServerUrl
|
||||||
this.artifactName = context.artifactName
|
this.artifactName = context.artifactName
|
||||||
this.isPreview = context.isPreview === true
|
this.isPreview = context.isPreview === true
|
||||||
}
|
}
|
||||||
@@ -94,7 +95,8 @@ class Deployment {
|
|||||||
} else if (error.response.status == 403) {
|
} else if (error.response.status == 403) {
|
||||||
errorMessage += `Ensure GITHUB_TOKEN has permission "pages: write".`
|
errorMessage += `Ensure GITHUB_TOKEN has permission "pages: write".`
|
||||||
} else if (error.response.status == 404) {
|
} else if (error.response.status == 404) {
|
||||||
errorMessage += `Ensure GitHub Pages has been enabled.`
|
const pagesSettingsUrl = `${this.githubServerUrl}/${this.repositoryNwo}/settings/pages`
|
||||||
|
errorMessage += `Ensure GitHub Pages has been enabled: ${pagesSettingsUrl}`
|
||||||
} else if (error.response.status >= 500) {
|
} else if (error.response.status >= 500) {
|
||||||
errorMessage += `Server error, is githubstatus.com reporting a Pages outage? Please re-run the deployment at a later time.`
|
errorMessage += `Server error, is githubstatus.com reporting a Pages outage? Please re-run the deployment at a later time.`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user