Custom properties API - admin rights needed? #180841
Replies: 3 comments
-
|
Hey, can you accept this answer? |
Beta Was this translation helpful? Give feedback.
-
|
This is a common point of confusion when working with Github Custom Repository Properties and FineGrained Access Tokens PATs Since you want to avoid granting blanket admin access to your machine user, the most secure and scalable solution is to switch from a Machine User PAT to a Github App. Hope this helps :) |
Beta Was this translation helpful? Give feedback.
-
|
I ran into the same issue and confirmed that this is expected behavior — updating repository custom properties via the GitHub REST API currently requires admin-level permissions on the repository. This happens because the endpoint POST /repos/{owner}/{repo}/properties/values is limited to repository administrators only (see the GITHUB API DOCS) Workarounds |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
I want to use custom properties on my repositories to be able to automatically (via github api) and manually (workflow trigger) set the tag to deploy in. Once for STAG and once for PROD (2 custom properties). This allows me to use the webhook feature to trigger deployments to x different targets decoupled from the pipeline code.
This would already work except for a permission problem.
I created a fine grained access token on my machine user and set the organization as the owner. The token has all the necessary permissions (i even tried with ALL permissions) and the machine user has write access to alle repositories in the organization.
If i try to update a custom property via the github API (does not matter if postman or curl inside the pipeline) i get the following response:
It only works if i grant admin access to the machine user on the repository i want to set the custom property. Does anyone experience the same? Is there a solution? I do not want to give admin rights to my machine user.
Beta Was this translation helpful? Give feedback.
All reactions