PyGithub icon indicating copy to clipboard operation
PyGithub copied to clipboard

Support `properties` for repositories

Open heitorPB opened this issue 2 years ago • 1 comments

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"]

heitorPB avatar Feb 05 '24 16:02 heitorPB

Agree. Just spent 30 minutes figuring out hot to do this. Thanks for the workaround @heitorPB

budbach avatar May 10 '24 21:05 budbach