cmd/update-report: tweak messages for CI

This commit is contained in:
Bo Anderson 2023-07-06 17:33:49 +01:00
parent cf180bbc96
commit 623eeb4e47
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
3 changed files with 17 additions and 8 deletions

View File

@ -77,4 +77,5 @@ RUN mkdir -p \
&& brew cleanup \
&& { git -C .linuxbrew/Homebrew config --unset gc.auto; true; } \
&& { git -C .linuxbrew/Homebrew config --unset homebrew.devcmdrun; true; } \
&& rm -rf .cache
&& rm -rf .cache \
&& touch .linuxbrew/.homebrewdocker

View File

@ -376,16 +376,17 @@ module Homebrew
api_auto_update_secs = Homebrew::EnvConfig.api_auto_update_secs.to_i
api_auto_update_secs_default = Homebrew::EnvConfig::ENVS.fetch(:HOMEBREW_API_AUTO_UPDATE_SECS).fetch(:default)
auto_update_secs_set = api_auto_update_secs.positive? && api_auto_update_secs != api_auto_update_secs_default
if !Homebrew::EnvConfig.no_auto_update? && !Homebrew::EnvConfig.no_install_from_api? && !auto_update_secs_set
return
end
no_auto_update_set = Homebrew::EnvConfig.no_auto_update? &&
!ENV["HOMEBREW_GITHUB_HOSTED_RUNNER"] &&
!ENV["GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED"]
no_install_from_api_set = Homebrew::EnvConfig.no_install_from_api? &&
!Homebrew::EnvConfig.automatically_set_no_install_from_api?
return if !no_auto_update_set && !no_install_from_api_set && !auto_update_secs_set
ohai "You have set:"
puts " HOMEBREW_NO_AUTO_UPDATE" if Homebrew::EnvConfig.no_auto_update?
puts " HOMEBREW_NO_AUTO_UPDATE" if no_auto_update_set
puts " HOMEBREW_API_AUTO_UPDATE_SECS" if auto_update_secs_set
if Homebrew::EnvConfig.no_install_from_api? && !Homebrew::EnvConfig.automatically_set_no_install_from_api?
puts " HOMEBREW_NO_INSTALL_FROM_API"
end
puts " HOMEBREW_NO_INSTALL_FROM_API" if no_install_from_api_set
puts "but we have dramatically sped up and fixed many bugs in the way we do Homebrew updates since."
puts "Please consider unsetting these and tweaking the values based on the new behaviour."
puts "\n\n"
@ -397,6 +398,8 @@ module Homebrew
def untap_message
return if Homebrew::EnvConfig.no_install_from_api?
return if Homebrew::EnvConfig.developer? || ENV["HOMEBREW_DEV_CMD_RUN"]
return if ENV["HOMEBREW_GITHUB_HOSTED_RUNNER"] || ENV["GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED"]
return if (HOMEBREW_PREFIX/".homebrewdocker").exist?
core_tap = CoreTap.instance
cask_tap = Tap.default_cask_tap

View File

@ -139,6 +139,11 @@ then
export CI="1"
fi
if [[ -n "${GITHUB_ACTIONS:-}" && -n "${ImageOS:-}" && -n "${ImageVersion:-}" ]]
then
export HOMEBREW_GITHUB_HOSTED_RUNNER=1
fi
# filter the user environment
PATH="/usr/bin:/bin:/usr/sbin:/sbin"