Skip to content

Instantly share code, notes, and snippets.

@Ran-Xing
Created August 14, 2022 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ran-Xing/c48e28e931a6c581973a0bb9f3f252aa to your computer and use it in GitHub Desktop.
Save Ran-Xing/c48e28e931a6c581973a0bb9f3f252aa to your computer and use it in GitHub Desktop.
Batch modify github code
TOKEN="ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
USER_NAME="Ran-Xing"
jq '.[].ssh_url' <(curl \
-s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $TOKEN" \
"https://api.github.com/users/$USER_NAME/repos?type=all&sort=&direction=&per_page=100&page=") \
| grep $USER_NAME
ORG="XRSec"
jq '.[].ssh_url' <(curl \
-s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $TOKEN" \
"https://api.github.com/orgs/${ORG}/repos?type=all&sort=&direction=&per_page=100&page=") \
| grep $ORG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment