#!/usr/bin/env bash set -xe USER=$1 PASSWORD=$2 AUTH="${USER}:${PASSWORD}" curl -i -u $AUTH https://api.github.com curl -i -u $AUTH \ -d '{"scopes":["public_repo"], "note": "Allow listing github repositories"}' \ https://api.github.com/authorizations # note: # - passwords retrieved from swh's credential store # - token ensure working afterwards using # curl --head -u : https://api.github.com/repositories # HTTP/1.1 200 OK # Date: Thu, 16 Jan 2020 12:26:32 GMT # Content-Type: application/json; charset=utf-8 # Content-Length: 461244 # Server: GitHub.com # Status: 200 OK # X-RateLimit-Limit: 5000 # against 60 without authentication # X-RateLimit-Remaining: 4997 # X-RateLimit-Reset: 1579180727