PyGithub
PyGithub copied to clipboard
Support `properties` for repositories
GitHub API has an endpoint to retrieve the properties of a repository:
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/properties/values
Example output:
[
{
"property_name": "environment",
"value": "production"
},
{
"property_name": "service",
"value": "web"
},
{
"property_name": "team",
"value": "octocat"
}
]
This is possible to get via raw_data, but feels like a hack: my_repo.raw_data["custom_properties"]
Agree. Just spent 30 minutes figuring out hot to do this. Thanks for the workaround @heitorPB