Skip to content

Commit

Permalink
Add repo settings URL to help users react to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMGreene committed Nov 17, 2022
1 parent af875e2 commit 3ffff52
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function getRequiredVars() {
actionsId: process.env.GITHUB_ACTION,
githubToken: core.getInput('token'),
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',
isPreview: core.getInput('preview') === 'true'
}
Expand Down
4 changes: 3 additions & 1 deletion src/deployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Deployment {
this.requestedDeployment = false
this.deploymentInfo = null
this.githubApiUrl = context.githubApiUrl
this.githubServerUrl = context.githubServerUrl
this.artifactName = context.artifactName
this.isPreview = context.isPreview === true
}
Expand Down Expand Up @@ -94,7 +95,8 @@ class Deployment {
} else if (error.response.status == 403) {
errorMessage += `Ensure GITHUB_TOKEN has permission "pages: write".`
} 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) {
errorMessage += `Server error, is githubstatus.com reporting a Pages outage? Please re-run the deployment at a later time.`
}
Expand Down

0 comments on commit 3ffff52

Please sign in to comment.