Skip to content

Instantly share code, notes, and snippets.

@kkashyap1707
Forked from miketheman/enable_alerting.py
Created June 30, 2021 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkashyap1707/ce12a58eb5f5133d75cc1cfa2518d69f to your computer and use it in GitHub Desktop.
Save kkashyap1707/ce12a58eb5f5133d75cc1cfa2518d69f to your computer and use it in GitHub Desktop.
A simple script to enable GitHub's Data Services & Vulnerability Scanning on a given Organization's Repositories
from github import Github
gh = Github('SET_GITHUB_ACCESS_TOKE_HERE')
org = gh.get_organization('SET_ORG_NAME_HERE')
repos = org.get_repos()
for repo in repos:
if repo.archived:
continue
if not repo.get_vulnerability_alert():
repo.enable_vulnerability_alert()
print(repo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment