Skip to content

Conversation

@MikeMcQuaid
Copy link
Member

We can use this in more places where we were previously just hardcoding the environment variable.

We can use this in more places where we were previously just hardcoding
the environment variable.
Copilot AI review requested due to automatic review settings November 14, 2025 12: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 refactors GitHub Actions environment checks to use a centralized helper method instead of hardcoded environment variable lookups, improving code maintainability and consistency.

  • Replaces direct ENV["GITHUB_ACTIONS"] checks with GitHub::Actions.env_set? helper method
  • Adds the necessary require "utils/github/actions" statement to test_bot/step.rb
  • Removes the now-redundant in_github_actions? method from the Step class

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Library/Homebrew/test_bot/step.rb Adds require statement for GitHub Actions module, removes local in_github_actions? method, replaces all usages with GitHub::Actions.env_set?
Library/Homebrew/test_bot/test_formulae.rb Replaces ENV["GITHUB_ACTIONS"].blank? and .present? checks with GitHub::Actions.env_set?
Library/Homebrew/test_bot/formulae_detect.rb Replaces direct ENV["GITHUB_ACTIONS"] checks with GitHub::Actions.env_set?
Library/Homebrew/test_bot/formulae_dependents.rb Replaces ENV["GITHUB_ACTIONS"] and .blank? checks with GitHub::Actions.env_set?
Library/Homebrew/test_bot/formulae.rb Replaces ENV["GITHUB_ACTIONS"] and .present? checks with GitHub::Actions.env_set?
Library/Homebrew/test_bot.rb Replaces .present? checks with GitHub::Actions.env_set?
Library/Homebrew/formula_auditor.rb Replaces ENV.fetch("GITHUB_ACTIONS", nil) check with GitHub::Actions.env_set?
Library/Homebrew/dev-cmd/test-bot.rb Replaces .present? check with GitHub::Actions.env_set?

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

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Nov 14, 2025
Merged via the queue into main with commit 6b1d775 Nov 14, 2025
43 checks passed
@MikeMcQuaid MikeMcQuaid deleted the github_actions_env_helper branch November 14, 2025 13:31
@k2s7c4bmwp-a11y
Copy link

Toto můžeme použít na více místech, kde jsme dříve pouze napevno kódovali proměnnou prostředí.

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.

4 participants