Does a Rest API endpoint exist for enabling the dependency graph on a per repo basis? #180308
-
Select Topic AreaQuestion BodyI'm trying to enable the dependency graph on a per repo basis, rather then at a global org or enterprise level. I can't seem to see it in the repo settings when I call |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Hi! You can enable the dependency graph on a per-repo basis, but it's not exposed as a field on You can do it via REST with something like: This requires admin permissions on the repo and a token with Administration (write) rights. One caveat: if your org or enterprise has dependency graph / security and analysis disabled at the org level, you won’t be able to override that per-repo (you'd need an org/enterprise admin to change the global settings first). Hope that clears it up! 😊 |
Beta Was this translation helpful? Give feedback.
As far as I can tell, the REST API doesn't currently offer a separate switch for "dependency graph only." The only available endpoint is:
PUT /repos/{owner}/{repo}/vulnerability-alertsAnd per the docs, that endpoint enables both the dependency graph and dependabot alerts together: https://docs.github.com/en/rest/repos/repos#enable-vulnerability-alerts
In the UI, you can enable the graph without alerts, but I haven't seen an API equivalent for that.
So for now, it looks like "graph only" is UI-only. If you need programmatic control, a feature request might be the way to go ?