Skip to content

Conversation

@jkroepke
Copy link
Contributor

@jkroepke jkroepke commented Dec 22, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

Hi,

after #21278 was merged, I tested the main branch inside our company.

I can't tell what different since it published my initial PR, but now I got an error if I set HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN to none:

/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/global.rb:38:in 'fetch': key not found: "HOMEBREW_GITHUB_PACKAGES_AUTH" (KeyError)
        from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/global.rb:38:in '<top (required)>'
        from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:18:in 'Kernel#require_relative'
        from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:18:in '<main>'

After configure a default value in ENV.fetch, everything works as expected. (tested internally).

Copilot AI review requested due to automatic review settings December 22, 2025 09:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a KeyError that occurs when HOMEBREW_GITHUB_PACKAGES_AUTH is not set in the environment. The issue arose when HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN is set to the special value "none", which causes brew.sh to unset the HOMEBREW_GITHUB_PACKAGES_AUTH variable (line 1045 in brew.sh). The fix provides a default empty string for this optional authentication variable.

  • Adds a default empty string parameter to ENV.fetch() for HOMEBREW_GITHUB_PACKAGES_AUTH

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 22, 2025
Merged via the queue into Homebrew:main with commit 94bc707 Dec 22, 2025
42 checks passed
@jkroepke jkroepke deleted the patch-1 branch December 22, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants