Skip to content

Instantly share code, notes, and snippets.

@dacbd
Created March 8, 2023 22:18
Show Gist options
  • Save dacbd/f509442ac72bf75c78250f54aec46076 to your computer and use it in GitHub Desktop.
Save dacbd/f509442ac72bf75c78250f54aec46076 to your computer and use it in GitHub Desktop.
GitLab Token debugging
GITLAB_API_TOKEN={token} # where {token} is an API token in the form /glpat-.*/
GITLAB_PROJECT_SLUG={user}%2F{project} # where {user} and {project} are placeholders
GITLAB_RUNNERS_TOKEN=$(curl --header "Authorization: Bearer $GITLAB_API_TOKEN" "https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_SLUG" | jq --raw-output .runners_token)
GITLAB_RUNNER_REGISTRATION_TOKEN=$(curl --form token="$GITLAB_RUNNERS_TOKEN" https://gitlab.com/api/v4/runners | jq --raw-output .token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment