Skip to content

Instantly share code, notes, and snippets.

@lukasjoc
Last active December 12, 2023 10:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukasjoc/0da4ef61a7288733f150609d97274b8a to your computer and use it in GitHub Desktop.
Save lukasjoc/0da4ef61a7288733f150609d97274b8a to your computer and use it in GitHub Desktop.
Export GitHub Projects Data to JSON

gh_projects_export

Export GitHub Projects Data to JSON

Needs:

export gh_user=USER
export gh_token=USER_ACCESS_TOKEN

Run:

chmod u+x export
./export
#!/bin/bash
mkdir boards
curl \
-u "$gh_user:$gh_token" \
https://api.github.com/users/$gh_user/projects > boards/boards.json
for id in $(cat boards/boards.json | jq -c ".[].id"); do
mkdir -p "boards/$id"
curl \
-u "$gh_user:$gh_token" \
"https://api.github.com/projects/$id/columns" > "boards/$id/cols.json"
for card_url in $(cat "boards/$id/cols.json" | jq -r '.[].cards_url'); do
curl \
-u "$gh_user:$gh_token" \
"$card_url" >> "boards/$id/cards.json"
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment