THE GITHTML FIELD GUIDE
What GitHub Contents read permission allows an integration
For GitHub’s repository-contents read endpoint, supported fine-grained tokens require the Contents repository permission at read level. That permission must apply to the requested repository through the token or app’s access selection. It does not grant access to every private repository, and permission to read content is distinct from permission to create, update, or delete files.
Separate capability from repository selection
A permission answers what an integration may do, while repository selection answers where it may do it. An app installation with Contents read access to one selected repository cannot infer access to another private repository simply because the same user can browse both. Organization approval and user authorization can add further boundaries depending on the credential type.
The exact endpoint matters. Reading file content, reading issues, reviewing pull requests, and administering settings are different capabilities. Do not treat a generic request for repository access as a precise description. Consult the endpoint’s documented token support and required permissions, then ask why any additional write capability is necessary for the stated task.
Evaluate a concrete read request
For a file-reading integration, identify the owner, repository, path, and optional ref. The contents endpoint can return a file or directory representation, with format and size constraints described in its documentation. A successful metadata listing does not automatically prove every large file or external LFS object can be retrieved through the same request.
- Record the exact operation, such as reading src/config.json at a selected commit, and map it to the documented read endpoint.
- Confirm the token’s resource owner or app installation includes the repository, then verify Contents is read rather than write when no mutation is needed.
- Check organization approval and credential expiration separately before broadening permissions in response to an access error.
Keep authorization and data handling distinct
Read-only access can still expose confidential source to the integration. Review the service’s data handling, retention, and account controls as well as the GitHub permission screen. A read permission reduces mutation capability; it is not a promise that no data leaves GitHub or that the service stores nothing.
If access fails, use sanitized request context and response status to diagnose the boundary. Never paste a token into a public issue or a URL. Public repository reading may work without authentication in some endpoint contexts, but that does not validate private-repository authorization. The appropriate result is the smallest documented capability over the intended repositories, with an accurate understanding of what content the integration can receive.
- If a directory listing succeeds but one file request fails, compare the requested path, ref, media type, and documented size handling before changing authorization. The credential has already demonstrated some repository access. A representation or path mismatch should not be treated automatically as evidence that Contents write permission is needed.
- For a reader that needs one private repository, test a known file at a recorded commit within that repository. A successful request to a public example does not demonstrate the private grant. Confirm that the integration can read the intended content without expanding its selection to unrelated repositories.
Sources and further reading
AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.