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?
- For an easy test, I am simply copying the executable to
/usr/local/bin;~glab: make && sudo cp ./bin/glab /usr/local/bin/glab
- An example
.gitlab-ci.ymlfor 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
- Result;
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
