Skip to content

Advice should suggest adding pages: read for private repositories #188

@jsoref

Description

@jsoref

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: Resource not accessible by integration - https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site
Error: HttpError: Resource not accessible by integration - https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site

GitHub workflows+actions can determine if the repository for which they're running is private (jq -r '.repository.private // empty' "$GITHUB_EVENT_PATH" == true) and this action should check that and suggest adding:

permissions:
  pages: read

instead of just suggesting that the repository needs "Pages enabled" "and configured to build using GitHub actions" or whatever an enablement is.

enablement:
description: 'Try to enable Pages for the repository if it is not already enabled. This option requires a token other than `GITHUB_TOKEN` to be provided. In the context of a Personal Access Token, the `repo` scope or Pages write permission is required. In the context of a GitHub App, the `administration:write` and `pages:write` permissions are required.'
default: 'false'
required: false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions