Last active
February 11, 2021 03:35
-
-
Save tgamblin/ee5b86ab20cd4107bc6263446f249259 to your computer and use it in GitHub Desktop.
Get cards from github project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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