'How can I check if Dependabot is enabled for a Repo using Github APIs?

I've gone through Github Rest API v3 and Github GraphQL API v4 but I'm unable to find a resource/endpoint to check if dependabot is enabled via the API? I've gone through loads of documentation but was unable to find anything helpful. Could someone please point me to the correct document or tell me which resource to use? Thanks!



Solution 1:[1]

There was a dependabot API docs that could have helped, but it was deprecated in August 3rd 2021.

However, a workaround would be to check if the dependabot.yml file is present in your repository or not using a GET request to api.github.com/repos/name/repo/contents/fileNameOrPath.

Reference about the dependabot.yml file

Solution 2:[2]

Answer by @epopisces is to the point , I was also looking for the same thing. Now addition to what he said. Checking the status of Dependabot security updates is possible via GET request (GET /repos/{owner}/{repo}) to a particular repo , which can have security and analysis tag in response(only if we have Advanced security license). No other way to know the status yet via API.

https://docs.github.com/en/rest/reference/repos#get-a-repository

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 GuiFalourd
Solution 2 Malacophonous