Skip to content
Latchkey

GitHub Actions actions/configure-pages "Pages not enabled"

actions/configure-pages queries the repository Pages configuration. If Pages is disabled, or its build source is not set to GitHub Actions, the lookup fails before deploy.

What this error means

A configure-pages step fails getting the Pages site, suggesting Pages is not enabled or the source is wrong.

github-actions
Error: Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, rather than from a branch.
Error: HttpError: Not Found

Diagnose it: what token do you actually have?

Permission failures in Actions are almost never about your repository settings alone. Three things combine: the default GITHUB_TOKEN permission set for the repo or organization, the permissions: block in the workflow, and whether the event is a fork pull request, which downgrades the token to read-only regardless of everything else.

.github/workflows/ci.yml
- name: Show the token scopes actually granted
  run: |
    curl -sI -H "Authorization: Bearer $GITHUB_TOKEN" \
      https://api.github.com/ | grep -i "^x-oauth-scopes\|^x-accepted"
    echo "event: ${{ github.event_name }}"
    echo "fork PR: ${{ github.event.pull_request.head.repo.fork }}"
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Common causes

Pages disabled for the repo

configure-pages needs Pages turned on in repository settings.

Source set to a branch, not Actions

When the Pages build source is a branch, the Actions deploy flow cannot configure it.

How to fix it

Enable Pages with the Actions source

  1. In Settings > Pages, set Source to GitHub Actions.
  2. Add pages: write and id-token: write permissions to the deploy job.
  3. Use enablement: true on configure-pages to auto-enable where supported.
.github/workflows/pages.yml
permissions:
  pages: write
  id-token: write
steps:
  - uses: actions/configure-pages@v5
    with:
      enablement: true

Grant the narrowest permission that works

Declaring a permissions: block switches the job from the repository default to exactly what you list, so an incomplete block is a common cause of a new failure right after someone tightened security. List every scope the job needs, not just the one that failed.

.github/workflows/ci.yml
permissions:
  contents: read        # checkout
  packages: write       # push to GHCR
  id-token: write       # OIDC to a cloud provider
  pull-requests: write  # comment on or label a PR
  checks: write         # publish check runs

How to prevent it

  • Set the Pages source to GitHub Actions before running the deploy workflow.
  • Keep pages: write and id-token: write on the deploy job.

Frequently asked questions

What causes GitHub Actions actions/configure-pages "Pages not enabled"?
There are 2 common causes: pages disabled for the repo and source set to a branch, not actions. configure-pages needs Pages turned on in repository settings.
How do I fix GitHub Actions actions/configure-pages "Pages not enabled"?
Enable Pages with the Actions source. In Settings > Pages, set Source to GitHub Actions.
What does GitHub Actions actions/configure-pages "Pages not enabled" actually mean?
A configure-pages step fails getting the Pages site, suggesting Pages is not enabled or the source is wrong.
How do I stop GitHub Actions actions/configure-pages "Pages not enabled" happening again?
Set the Pages source to GitHub Actions before running the deploy workflow. The prevention section lists 2 changes that keep it from recurring.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card