Skip to content

fix: don't read instance from config file if found from repo

Simon Ser requested to merge emersion/gitlab-cli:default-host-repo into main

Description

Running "glab release attach" from a repository directory not hosted on gitlab.com still creates release links with "gitlab.com" in them. This happens because the config file overwrites the hostname detected from the repository.

Fix this by only allowing the env var to overwrite the default host.

Related Issues

Resolves #7427 (closed)

How has this been tested?

Try to run glab release attach on a gitlab.freedesktop.org repository.

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

Merge request reports