Skip to content

fix: Mention all available token environment variables in warning

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

Description

The cli accepts GITLAB_TOKEN, GITLAB_ACCESS_TOKEN or OAUTH_TOKEN as environment variable and will prefer that over the configuration for authentication.

A coworker and I were struggling a lot to get the cli working after tokens expired and had a lot of problems with that, because GITLAB_ACCESS_TOKEN is not mentioned in the warning message.
Therefore we did not think that this variable would interfere with our tries to perform a new login. Only after looking through the code, I discovered that GITLAB_ACCESS_TOKEN is a valid environment variable and after unsetting it, the login worked without any problems again.

Related Issues

Relates to #7568 (comment 1944353039)

How has this been tested?

make
bin/glab auth status
bin/glab auth login
make test

Screenshots (if appropriate):

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
Edited by Niklas van Schrick

Merge request reports