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

Add support for setting custom properties of a repository #9254

Open
gberche-orange opened this issue Jun 25, 2024 · 2 comments
Open

Add support for setting custom properties of a repository #9254

gberche-orange opened this issue Jun 25, 2024 · 2 comments
Labels
enhancement a request to improve CLI needs-triage needs to be reviewed

Comments

@gberche-orange
Copy link

Describe the feature or problem you’d like to solve

I need to set in batch custom properties on a set of repositories

Proposed solution

How will it benefit CLI and its users?

Collaborate with other org users on using custom properties (e.g. flag some repos as candidate for archiving or deletion)

Additional context

https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization

@gberche-orange gberche-orange added the enhancement a request to improve CLI label Jun 25, 2024
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label Jun 25, 2024
@benelan
Copy link

benelan commented Jun 27, 2024

You could use gh api in the meantime. GitHub's REST API reference includes gh usage snippets, for example:

gh api \
  --method PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/OWNER/REPO/properties/values \
   -f "properties[][property_name]=environment" -f "properties[][value]=production" -f "properties[][property_name]=service" -f "properties[][value]=web" -f "properties[][property_name]=team" -f "properties[][value]=octocat"

https://docs.github.com/en/rest/repos/custom-properties?apiVersion=2022-11-28#create-or-update-custom-property-values-for-a-repository

@andyfeller
Copy link
Contributor

@gberche-orange : could you share how you are using the custom properties as part of your overall gh workflow?

Beyond setting the value of a custom property for a given repository, there are likely several ways that custom properties should be incorporated into gh more broadly:

  1. Custom property management
    1. Listing custom properties at the organization level
    2. View specific custom property at the organization level including property values
    3. Create custom properties at the organization level as a single or batch
    4. Remove custom property at the organization level
  2. Applying custom properties on repositories
    1. View custom property set for a given repository
    2. Set custom property value for a given repository### Extended custom property support into other commands
  3. Leveraging custom properties
    1. gh search repos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request to improve CLI needs-triage needs to be reviewed
Projects
None yet
Development

No branches or pull requests

4 participants