Script to fetch a GitHub organisation member list and gpg --import
the public GPG key(s) for each member with GPG key(s) associated against their profile.
Requires curl
for GitHub API calls, jq
for parsing GitHub REST API responses and (obviously) gpg
.
Create a GitHub personal access token (classic or fine-grained) with read access to organisation members:
- Classic token:
read:org
scope. - Fine-grained token: Members
Read-only
organization permission.
Next, run the script:
export GITHUB_TOKEN="INSERT_TOKEN_VALUE_HERE"
ORG_NAME="INSERT_GITHUB_ORG" ./import-github-gpg.sh
Done!
excellent, works like a charm in 2023, thank you