Between the 1Password breach starting with a hijacked employee GitHub account and PolinRider force-pushing with stolen tokens, it’s a good week to look at your own GitHub account. Here’s my quick pass with the GitHub CLI.
1. What is gh logged in as, with what scopes?
gh auth status
If you see scopes you don’t need (like delete_repo or admin:org), trim them: gh auth refresh --remove-scopes delete_repo drops one.
2. List your SSH and signing keys
gh ssh-key list
gh gpg-key list
# remove one you don't recognize
gh ssh-key delete <KEY_ID>
3. Look for force-pushes you didn’t make
# replace OWNER/REPO
gh api "repos/OWNER/REPO/activity?activity_type=force_push" \
--jq '.[] | [.timestamp, .actor.login, .ref] | @tsv'
Run that across the repos you care about. Any force-push you can’t explain is worth a closer look at the diff.
4. The parts gh can’t show you
Personal access tokens and authorized OAuth/GitHub apps live in the web settings: check Settings → Developer settings → Personal access tokens and Settings → Applications, and revoke anything old or unknown. Give tokens expiration dates and the narrowest repo access you can.
My take
Ten minutes, once a month. Your GitHub account is a key to everything you ship.
God Bless, and Happy hacking!