diff options
| author | Mike McQuaid | 2017-11-07 08:12:53 +0000 |
|---|---|---|
| committer | GitHub | 2017-11-07 08:12:53 +0000 |
| commit | 3ad4dcafd76dfe6b1b4aedba528eb85a20852803 (patch) | |
| tree | 2ae0a3ead18c6a36d6527db109cfe020d1678b11 /Library | |
| parent | b96ded7ca4c260dad29a47b91f3b8d398c3b1af8 (diff) | |
| parent | 127bdfdc71310ff237ea20d6bbc008ce252aecf3 (diff) | |
| download | brew-3ad4dcafd76dfe6b1b4aedba528eb85a20852803.tar.bz2 | |
Merge pull request #3427 from MikeMcQuaid/bump-formula-pr-env-filtering-github
bump-formula-pr: use GitHub vars under env filter.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/dev-cmd/bump-formula-pr.rb | 11 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ENV.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/system_config.rb | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 9fe70da6b..380bb464d 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -117,6 +117,17 @@ module Homebrew # user path, too. ENV["PATH"] = ENV["HOMEBREW_PATH"] + # Use the user's browser, too. + ENV["BROWSER"] = ENV["HOMEBREW_BROWSER"] + + # Setup GitHub environment variables + %w[GITHUB_USER GITHUB_PASSWORD GITHUB_TOKEN].each do |env| + homebrew_env = ENV["HOMEBREW_#{env}"] + next unless homebrew_env + next if homebrew_env.empty? + ENV[env] = homebrew_env + end + formula = ARGV.formulae.first if formula diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index ea1b99501..374be49b9 100644 --- a/Library/Homebrew/extend/ENV.rb +++ b/Library/Homebrew/extend/ENV.rb @@ -29,7 +29,7 @@ module EnvActivation def clear_sensitive_environment! ENV.each_key do |key| - next unless /(cookie|key|token)/i =~ key + next unless /(cookie|key|token|password)/i =~ key ENV.delete key end end diff --git a/Library/Homebrew/system_config.rb b/Library/Homebrew/system_config.rb index e7e60c985..86b7051fa 100644 --- a/Library/Homebrew/system_config.rb +++ b/Library/Homebrew/system_config.rb @@ -207,7 +207,7 @@ class SystemConfig next unless key.start_with?("HOMEBREW_") next if boring_keys.include?(key) next if defaults_hash[key.to_sym] == value - value = "set" if key =~ /(cookie|key|token)/i + value = "set" if key =~ /(cookie|key|token|password)/i f.puts "#{key}: #{value}" end f.puts hardware if hardware |
