Merge pull request #8009 from Bo98/actions_job

Adjust container checks for GitHub Actions changes
This commit is contained in:
Michka Popoff 2020-07-15 20:47:49 +02:00 committed by GitHub
commit 8328f51542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ begin
ENV.delete("HOMEBREW_HELP") if help_flag
tap_commands = []
cgroup = Utils.popen_read("cat", "/proc/1/cgroup")
if !cgroup.include?("azpl_job") && !cgroup.include?("docker")
if %w[azpl_job actions_job docker garden kubepods].none? { |container| cgroup.include?(container) }
brew_uid = HOMEBREW_BREW_FILE.stat.uid
tap_commands += %W[/usr/bin/sudo -u ##{brew_uid}] if Process.uid.zero? && !brew_uid.zero?
end

View File

@ -433,8 +433,8 @@ fi
check-run-command-as-root() {
[[ "$(id -u)" = 0 ]] || return
# Allow Azure Pipelines/Docker/Concourse/Kubernetes to do everything as root (as it's normal there)
[[ -f /proc/1/cgroup ]] && grep -E "azpl_job|docker|garden|kubepods" -q /proc/1/cgroup && return
# Allow Azure Pipelines/GitHub Actions/Docker/Concourse/Kubernetes to do everything as root (as it's normal there)
[[ -f /proc/1/cgroup ]] && grep -E "azpl_job|actions_job|docker|garden|kubepods" -q /proc/1/cgroup && return
# Homebrew Services may need `sudo` for system-wide daemons.
[[ "$HOMEBREW_COMMAND" = "services" ]] && return