Last active
March 18, 2024 13:38
-
-
Save lorenzleutgeb/38a589f700bdbe84ef55f94b1fe96eef to your computer and use it in GitHub Desktop.
This file contains 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
#! /usr/bin/env nix-shell | |
#! nix-shell -i bash -p bash gh curl jq | |
set -euo pipefail | |
REV="main" # 2c50fffdcecb245836ed02cb5c2480a57bdcfef7 as of 2024-03-18 | |
URL_BASE="https://github.com/starknet-io/provisions-data/raw/${REV}/github" | |
if [ $# == 1 ] | |
then # use GitHub username passed via commandline argument. | |
LOGIN=$1 | |
else # try to get to currently logged in user via `gh`. | |
LOGIN="$(gh api user --jq .login)" | |
fi | |
jq \ | |
--arg login "$LOGIN" \ | |
'reduce .[] as $x ([]; . + $x.eligibles) | .[] | select(.identity == $login)' \ | |
--slurp \ | |
<(curl -L "$URL_BASE/github-0.json") \ | |
<(curl -L "$URL_BASE/github-1.json") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment