Created
August 26, 2019 16:24
-
-
Save skwashd/b07b4e531b3d1fd305912fd2985c37ec to your computer and use it in GitHub Desktop.
Revisions
-
skwashd created this gist
Aug 26, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ #!/usr/bin/env python3 import json import os import requests token = os.environ.get("GITHUB_TOKEN") org = os.environ.get("GITHUB_ORG") repos = [ # Add list of repos here ] for repo in repos: headers = { "Authorization": f"token {token}", "Accept": "application/vnd.github.dorian-preview+json", } url = f"https://api.github.com/repos/{org}/{repo}/vulnerability-alerts" r = requests.put(url, headers=headers) r.raise_for_status() headers = { "Authorization": f"token {token}", "Accept": "application/vnd.github.london-preview+json", } url = f"https://api.github.com/repos/{org}/{repo}/automated-security-fixes" r = requests.put(url, headers=headers) r.raise_for_status()