Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support properties for repositories #2895

Open
heitorPB opened this issue Feb 5, 2024 · 1 comment
Open

Support properties for repositories #2895

heitorPB opened this issue Feb 5, 2024 · 1 comment

Comments

@heitorPB
Copy link

heitorPB commented Feb 5, 2024

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

@budbach
Copy link

budbach commented May 10, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants