Skip to content

Commit 0fdf1da

Browse files
committed
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.
1 parent 7a757a6 commit 0fdf1da

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

action.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,20 @@ runs:
8282
echo "PQ_LIB_DIR=$PG_LIBDIR" >> $GITHUB_ENV
8383
8484
elif [ "$RUNNER_OS" == "macOS" ]; then
85+
export HOMEBREW_NO_ENV_HINTS=1
8586
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
8687
export HOMEBREW_NO_INSTALL_CLEANUP=1
8788
export HOMEBREW_NO_INSTALL_UPGRADE=1
88-
brew install --skip-post-install postgresql@${{ inputs.postgres-version }}
89+
brew install --quiet --skip-post-install postgresql@${{ inputs.postgres-version }}
8990
9091
# Link PostgreSQL binaries from /usr/local/bin in order to make them
91-
# available globally. The overwrite option is required since some
92-
# GitHub runners come with preinstalled PostgreSQL binaries.
93-
brew link --overwrite postgresql@${{ inputs.postgres-version }}
92+
# available globally. The --overwrite option is required since some
93+
# GitHub runners come with preinstalled PostgreSQL binaries, and we
94+
# have to link the required version of PostgreSQL. The unlinking step
95+
# is needed to suppress "Already linked" warning which is propagated
96+
# back to users.
97+
brew unlink --quiet postgresql@${{ inputs.postgres-version }}
98+
brew link --quiet --overwrite postgresql@${{ inputs.postgres-version }}
9499
fi
95100
shell: bash
96101

0 commit comments

Comments
 (0)