Last active
February 17, 2026 21:33
-
-
Save forivall/77a5961d3030aa13c253968e9f6a5612 to your computer and use it in GitHub Desktop.
script to pull all of the gpg keys for a github repository
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 characters
| #!/usr/bin/env zsh | |
| OUT_DIR=.tmp/gpg-keys | |
| mkdir -p $OUT_DIR | |
| for user in web-flow $(gh api repos/${1:-$(gh repo view --json nameWithOwner --jq .nameWithOwner)}/contributors --jq '.[].login'); do | |
| for k in $(gh api "users/$user/gpg_keys" --jq '.[]|@base64'); do | |
| echo $k | jq -Rr '@base64d|fromjson|.raw_key' > "$OUT_DIR/$user-$(echo $k | jq -Rr '@base64d|fromjson|.key_id').gpg" | |
| done | |
| echo $OUT_DIR/$user-*.gpg | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment