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.
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 FoundDiagnose 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.
- 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
- In Settings > Pages, set Source to GitHub Actions.
- Add pages: write and id-token: write permissions to the deploy job.
- Use enablement: true on configure-pages to auto-enable where supported.
permissions:
pages: write
id-token: write
steps:
- uses: actions/configure-pages@v5
with:
enablement: trueGrant 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.
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 runsHow 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.