Fetches a GitHub organisation member list and proceeds to gpg --import
public GPG key(s) for each member associated against their profile.
Requires:
curl
for GitHub API callsjq
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, execute 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