Skip to content

Instantly share code, notes, and snippets.

@dgoeke
Last active March 13, 2019 18:16
Show Gist options
  • Save dgoeke/a742c323bec065e191d6bd518c15a19e to your computer and use it in GitHub Desktop.
Save dgoeke/a742c323bec065e191d6bd518c15a19e to your computer and use it in GitHub Desktop.
co-authored-by
#!/usr/bin/env sh
get_user() {
URL="https://api.github.com/users/$1"
RESULT=$(curl -s "$URL")
ID=$(echo "$RESULT" | sed -En 's/.*"id": ([0-9]+).*/\1/p')
NAME=$(echo "$RESULT" | sed -En 's/.*"name": "(.*)".*/\1/p')
echo "Co-authored-by: $NAME <[email protected]>"
}
for USER in "$@"
do
get_user "$USER"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment