mirror of
https://github.com/tj-actions/install-postgresql.git
synced 2024-12-20 01:18:18 +00:00
Updated the PATH regardless of cache hit outcome
This commit is contained in:
parent
e9a9096690
commit
8e47058fa9
3 changed files with 26 additions and 14 deletions
|
@ -48,6 +48,15 @@ runs:
|
||||||
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
|
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
|
||||||
INPUT_POSTGRESQL_VERSION: ${{ inputs.postgresql_version }}
|
INPUT_POSTGRESQL_VERSION: ${{ inputs.postgresql_version }}
|
||||||
|
|
||||||
|
- name: Update PATH
|
||||||
|
run: |
|
||||||
|
bash $GITHUB_ACTION_PATH/update-path.sh
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
|
||||||
|
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
|
||||||
|
INPUT_POSTGRESQL_VERSION: ${{ inputs.postgresql_version }}
|
||||||
|
|
||||||
- name: Verify PostgreSQL
|
- name: Verify PostgreSQL
|
||||||
run: |
|
run: |
|
||||||
# Check the postgresql version
|
# Check the postgresql version
|
||||||
|
|
|
@ -48,18 +48,4 @@ fi
|
||||||
|
|
||||||
echo "Installed postgresql"
|
echo "Installed postgresql"
|
||||||
|
|
||||||
echo "Updating PATH..."
|
|
||||||
|
|
||||||
# Verify installation by running pg_dump directly
|
|
||||||
if [[ "$(uname -s)" == "NT"* ]] || [[ "$(uname -s)" == "MINGW"* ]] || [[ "$(uname -s)" == *"MSYS"* ]]; then
|
|
||||||
# shellcheck disable=SC2028
|
|
||||||
echo "C:\\Program Files\\PostgreSQL\\$INPUT_POSTGRESQL_VERSION\\bin" >> "$GITHUB_PATH"
|
|
||||||
elif [[ "$(uname -s)" == "Darwin" ]]; then
|
|
||||||
echo "/usr/local/opt/postgresql@${INPUT_POSTGRESQL_VERSION}/bin" >> "$GITHUB_PATH"
|
|
||||||
else
|
|
||||||
echo "/usr/lib/postgresql/$INPUT_POSTGRESQL_VERSION/bin" >> "$GITHUB_PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Complete"
|
|
||||||
|
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
17
update-path.sh
Normal file
17
update-path.sh
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
echo "::group::set-postgres-path"
|
||||||
|
|
||||||
|
echo "Updating PATH..."
|
||||||
|
|
||||||
|
# Verify installation by running pg_dump directly
|
||||||
|
if [[ "$(uname -s)" == "NT"* ]] || [[ "$(uname -s)" == "MINGW"* ]] || [[ "$(uname -s)" == *"MSYS"* ]]; then
|
||||||
|
# shellcheck disable=SC2028
|
||||||
|
echo "C:\\Program Files\\PostgreSQL\\$INPUT_POSTGRESQL_VERSION\\bin" >> "$GITHUB_PATH"
|
||||||
|
elif [[ "$(uname -s)" == "Darwin" ]]; then
|
||||||
|
echo "/usr/local/opt/postgresql@${INPUT_POSTGRESQL_VERSION}/bin" >> "$GITHUB_PATH"
|
||||||
|
else
|
||||||
|
echo "/usr/lib/postgresql/$INPUT_POSTGRESQL_VERSION/bin" >> "$GITHUB_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Complete"
|
||||||
|
|
||||||
|
echo "::endgroup::"
|
Loading…
Add table
Reference in a new issue