Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling for GitHub Pages is disabled (especially forks) #386

Open
jsoref opened this issue Jan 2, 2025 · 0 comments
Open

Comments

@jsoref
Copy link

jsoref commented Jan 2, 2025

Here's a fairly typical run:
https://github.com/jsoref/trippy/actions/runs/12583591554

Annotations
3 errors and 2 warnings
deploy

Creating Pages deployment failed

deploy

HttpError: Not Found
    at /home/runner/work/_actions/actions/deploy-pages/v4/node_modules/@octokit/request/dist-node/index.js:124:1
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at createPagesDeployment (/home/runner/work/_actions/actions/deploy-pages/v4/src/internal/api-client.js:125:1)
    at Deployment.create (/home/runner/work/_actions/actions/deploy-pages/v4/src/internal/deployment.js:74:1)
    at main (/home/runner/work/_actions/actions/deploy-pages/v4/src/index.js:30:1)

deploy

Error: Failed to create deployment (status: 404) with build version a1ea16db01f25d44559533ab7018626dca0205d2. Request ID 8881:29425A:2B2F8E0:5630B9F:67769CBB Ensure GitHub Pages has been enabled: https://github.com/jsoref/trippy/settings/pages

If this is expected outcome for anyone who forks a repository that uses this action to get a failure, it'd be nice if it was a single pretty failure. If it is too long to fit into a single error box, then it'd be better for it to not have any error boxes and use a github step summary instead.

What this action is doing today is generating 3 error boxes:

  1. Mostly content free
  2. Incredibly long and not terribly helpful
  3. Hard to read (because it doesn't use line feeds) and buries the main problem behind a bunch of very long hex runs

Ideally the second wouldn't be present if the system can determine that GitHub Pages aren't enabled. And ideally the first and last would be unified into a single message:

GitHub Pages does not appear to be enabled.
Visit https://github.com/$GITHUB_REPOSITORY/settings/pages and ensure
- Source: Deploy from a branch
- Branch: $GITHUB_BRANCH

Technical details:
Failed to create deployment (status: 404) for $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/commit/$GITHUB_SHA.
Request ID: $REQUEST_ID

(where $GITHUB_SERVER_URL, $GITHUB_REPOSITORY, $GITHUB_SHA and $GITHUB_BRANCH are filled in appropriately based on the current run... and $REQUEST_ID is whatever that random set of hex runs is...)

Note that using a url instead of a random hex run improves readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant