Skip to content

Instantly share code, notes, and snippets.

@seisvelas
Created June 5, 2021 21:49
Show Gist options
  • Save seisvelas/522f95e23bb48e6523ee3c8c92ef2f5a to your computer and use it in GitHub Desktop.
Save seisvelas/522f95e23bb48e6523ee3c8c92ef2f5a to your computer and use it in GitHub Desktop.
Check FlowCrypt repos for outdated versions of GitHub Action
import requests
def has_new_gh_action(repo):
raw_url = f'https://raw.githubusercontent.com/FlowCrypt/{repo}/master/.github/workflows/check-for-emails.yml'
raw_action_request = requests.get(raw_url)
if raw_action_request.status_code != 200:
print(f'error checking repo {repo}, status code {raw_action_request.status_code}')
return False
return 'exemptions' in raw_action_request.text
url = 'https://api.github.com/orgs/FlowCrypt/repos?type=all'
flowcrypt_public_repos = requests.get(url).json()
bad_repo_found = False
for repo_json in flowcrypt_public_repos:
repo = repo_json['html_url'].split('/')[-1]
if not has_new_gh_action(repo):
bad_repo_found = True
print(f'{repo} does not have the new action')
if not bad_repo_found:
print('all public repos have the newest action!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment