1 2 3 4 5 6 7 8 9 10 11 12
#!/bin/bash set -euo pipefail set +x umask 077 : "${GH_TOKEN:?}" printf '%s' "$GH_TOKEN" \ | gh auth login --hostname github.com --with-token unset GH_TOKEN gh auth status || true