Skip to content

Instantly share code, notes, and snippets.

@tgamblin
Last active February 11, 2021 03:35
Show Gist options
  • Save tgamblin/ee5b86ab20cd4107bc6263446f249259 to your computer and use it in GitHub Desktop.
Save tgamblin/ee5b86ab20cd4107bc6263446f249259 to your computer and use it in GitHub Desktop.
Get cards from github project
#!/bin/sh
version="$1"
docurl() {
curl \
-u "tgamblin:$(cat ~/.github/analysis-token)" \
-H 'Accept: application/vnd.github.inertia-preview+json' \
"$@"
}
projects_url="https://api.github.com/repos/spack/spack/projects"
columns_url=$(docurl $projects_url \
| jq -r ".[] | select(.name | contains(\"$version\")) | .columns_url")
cards_url=$(docurl "$columns_url" | jq -r '.[] | select(.name == "Done") | .cards_url')
content_urls=$(docurl $cards_url | jq -r ".[] | select(.content_url != null) | .content_url")
for url in $content_urls; do
docurl $url
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment