Skip to content

Instantly share code, notes, and snippets.

View chrisxaustin's full-sized avatar

Chris Austin chrisxaustin

  • Somerville, MA, US
View GitHub Profile
@chrisxaustin
chrisxaustin / analyze-contrib.py
Last active November 24, 2024 14:46
Analyze the output from github contributors, which I capture with the list-contrib gist
#!/opt/homebrew/bin/python3
import re
import json
import sys
import datetime
for filename in sys.argv[1:]:
with open(filename, 'r') as fh:
repo = re.split(r'/', filename)[-1]
raw = fh.read()
@chrisxaustin
chrisxaustin / list-audit-log
Last active November 24, 2024 14:44
List github audit logs
#!/bin/bash
org=foo
gh api --paginate -H "Accept: application/vnd.github+json" -X GET -F include=git /orgs/$org/audit-log | jq
@chrisxaustin
chrisxaustin / list-clones
Last active November 24, 2024 14:44
List github clone operations
#!/bin/bash
org=foo
gh api --paginate -H "Accept: application/vnd.github+json" -X GET -F include=git /orgs/$org/audit-log | jq -r '.[] | select(.action=="git.clone" and .actor!="github-actions[bot]" and .actor!="dependabot[bot]") | [.actor, .action, .repo, .programmatic_access_type] | @tsv'