Fetches a GitHub organisation member list and proceeds to gpg --import public GPG key(s) for each member associated against their profile.
Requires:
curlfor GitHub API callsjqfor 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:orgscope. - Fine-grained token: Members
Read-onlyorganization permission.
Next, execute the script:
export GITHUB_TOKEN="INSERT_TOKEN_VALUE_HERE"
ORG_NAME="INSERT_GITHUB_ORG" ./import-github-gpg.shDone!
excellent, works like a charm in 2023, thank you