Skip to content

Instantly share code, notes, and snippets.

@holysugar
Created May 22, 2012 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holysugar/2768208 to your computer and use it in GitHub Desktop.
Save holysugar/2768208 to your computer and use it in GitHub Desktop.
Get github access token
#!/bin/sh
# Get github access_token in API v3
# see http://developer.github.com/v3/#authentication
#
# requirements:
# * curl
# * sed
read -p "User: " user
read -p "Password: " password
curl 2>/dev/null -d '{"scopes": ["repo"], "note": "Jenkins Automation"}' -u "$user:$password" https://api.github.com/authorizations | sed -ne '/token/s/.*"\([0-9a-f]*\)".*/\1/p'
@aratta2020
Copy link

hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment