Skip to content

feat(auth): support CI JOB TOKEN

Description

This feature enables to login via the CI JOB TOKEN. Example: glab auth login --hostname gitlab.example.org --job-token $CI_JOB_TOKEN

Related Issues

Resolves #1220 (closed)

How has this been tested?

  1. For an easy test, I am simply copying the executable to /usr/local/bin;
    • ~glab: make && sudo cp ./bin/glab /usr/local/bin/glab
  2. An example .gitlab-ci.yml for a component project;
test:
  script:
    - glab auth login --job-token $CI_JOB_TOKEN --hostname $CI_SERVER_FQDN --api-protocol $CI_SERVER_PROTOCOL
    - GITLAB_HOST=$CI_SERVER_URL glab release list -R $CI_PROJECT_PATH
  1. Result;

Screenshot_2024-11-15_at_11.36.29

Types of changes

  • [] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • [] Chore (Related to CI or Packaging to platforms)
  • [] Test gap

Merge request reports

Loading