简体   繁体   中英

python github library - listing security alerts on a repo

I am working on a python script that gets a specific repository by name, ultimately I want to see if there are any security alerts associated with it.

Thus far I can get the repo using the python git library, however I can seem to find a way to get information about the alerts [I have created a repo that intentionally has a vulnerable dependency in it, and in the UI it has been flagged.]

This is what my script looks like at the moment:

from github import Github

# create a github instance with my test token
github_instance = Github("my_token_is_here")

# get a specific repository
repo = github_instance.get_repo("name/test_sec_alerts")

does get_repo have the ability to bubble up information about security alerts?

This data is currently only available in the Repository Vulnerability Alerts Schema Preview , part of the broader Schema Preview feature which is not well supported in PyGithub as of today.

Dynamic (non-hardcoded) consumption of Schema Previews is a feature that's been requested before but seems to have ultimately failed to gain enough traction to warrant a full pull request. You may want to consider filing for a feature request in the PyGithub issue tracker.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM