Get a repo's community profile
Read a repository’s community-health percentage and which of GitHub’s standard community files it has.
-
Call
get_community_profilewith the repository’s owner and name:get_community_profile { owner: "octocat", repo: "example" } -
Read the health percentage and the file-presence flags off the response:
{"healthPercentage": 87,"description": "A repository doing repository things.","hasReadme": true,"hasLicense": true,"hasContributing": true,"hasCodeOfConduct": false,"hasIssueTemplate": true,"hasPullRequestTemplate": true}Each
has*field istruewhen GitHub reports that file as present for the repository (a plain boolean derived from GitHub’sfiles.*entries, not the file’s content).descriptionis the repository description as GitHub’s community-profile endpoint reports it, and may benull.
If it fails
Section titled “If it fails”missing_scope: no GitHub token was resolvable. SetGITHUB_TOKENor rungh auth login.github_api_error: check the message for the underlying HTTP status — a nonexistent or inaccessibleowner/reposurfaces as a 404 here.
See also
Section titled “See also”- reference/tools.md for the exact response schema.