Skip to content

Instantly share code, notes, and snippets.

@luoling8192
Created March 25, 2025 16:07
Show Gist options
  • Select an option

  • Save luoling8192/321a582729efa11eb25b7029bb7afc5d to your computer and use it in GitHub Desktop.

Select an option

Save luoling8192/321a582729efa11eb25b7029bb7afc5d to your computer and use it in GitHub Desktop.
#!/bin/bash
account=$1
data=$(curl -s https://api.github.com/users/$account)
id=$(echo $data | jq .id)
name=$(echo $data | jq --raw-output '.name // .login')
printf "Co-authored-by: %s <%d+%[email protected]>\n" "$name" $id $account
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment