Skip to content

Commit

Permalink
Merge pull request #83 from WofWca/better-error-message
Browse files Browse the repository at this point in the history
Make "Get Pages failed" error message more helpful
  • Loading branch information
JamesMGreene committed Apr 16, 2023
2 parents 2a4c30e + dbf7935 commit 5549504
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dist/index.js
Expand Up @@ -16013,7 +16013,10 @@ async function findOrCreatePagesSite({ githubToken, enablement = true }) {
pageObject = await getPagesSite({ githubToken })
} catch (error) {
if (!enablement) {
core.error('Get Pages site failed', error)
core.error(
'Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, or consider exploring the `enablement` parameter for this action.',
error
)
throw error
}
core.warning('Get Pages site failed', error)
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/api-client.js
Expand Up @@ -42,7 +42,10 @@ async function findOrCreatePagesSite({ githubToken, enablement = true }) {
pageObject = await getPagesSite({ githubToken })
} catch (error) {
if (!enablement) {
core.error('Get Pages site failed', error)
core.error(
'Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, or consider exploring the `enablement` parameter for this action.',
error
)
throw error
}
core.warning('Get Pages site failed', error)
Expand Down

0 comments on commit 5549504

Please sign in to comment.