From 0fdf1dab201ee2abd7a0ce1b87cbd5b35346f0fd Mon Sep 17 00:00:00 2001 From: Ihor Kalnytskyi Date: Wed, 23 Oct 2024 00:31:43 +0300 Subject: [PATCH] Suppress Homebrew warnings When `brew` is used by this action, it generates a bunch of warnings which are picked up by the github actions capture system and are shown to end users. They are noisy and most of them are expected. In order to avoid alerting end users, this patch suppresses them by passing 'quiet' parameter to the `brew` binary, unlinking linked keg and suppressing env hints. --- action.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 7a824f0..1f2d22c 100644 --- a/action.yml +++ b/action.yml @@ -82,15 +82,20 @@ runs: echo "PQ_LIB_DIR=$PG_LIBDIR" >> $GITHUB_ENV elif [ "$RUNNER_OS" == "macOS" ]; then + export HOMEBREW_NO_ENV_HINTS=1 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 export HOMEBREW_NO_INSTALL_CLEANUP=1 export HOMEBREW_NO_INSTALL_UPGRADE=1 - brew install --skip-post-install postgresql@${{ inputs.postgres-version }} + brew install --quiet --skip-post-install postgresql@${{ inputs.postgres-version }} # Link PostgreSQL binaries from /usr/local/bin in order to make them - # available globally. The overwrite option is required since some - # GitHub runners come with preinstalled PostgreSQL binaries. - brew link --overwrite postgresql@${{ inputs.postgres-version }} + # available globally. The --overwrite option is required since some + # GitHub runners come with preinstalled PostgreSQL binaries, and we + # have to link the required version of PostgreSQL. The unlinking step + # is needed to suppress "Already linked" warning which is propagated + # back to users. + brew unlink --quiet postgresql@${{ inputs.postgres-version }} + brew link --quiet --overwrite postgresql@${{ inputs.postgres-version }} fi shell: bash