diff --git a/entrypoint.sh b/entrypoint.sh index fb85c65..3c0c14d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -55,20 +55,27 @@ if [[ -n "$INPUT_POSTGRESQL_VERSION" ]]; then exit 1 fi - if [[ "$(uname -s)" == "NT"* ]]; then - echo "/Program Files/PostgreSQL/15/bin" >> "$GITHUB_PATH" - else - echo "/usr/lib/postgresql/15/bin" >> "$GITHUB_PATH" - fi - echo "Installed postgresql" + + echo "Running pg_dump..." + + # Verify installation by running pg_dump directly + if [[ "$(uname -s)" == "NT"* ]]; then + "/Program Files/PostgreSQL/15/bin/pg_dump" --version + # shellcheck disable=SC2086 + "/Program Files/PostgreSQL/15/bin/pg_dump" $INPUT_OPTIONS -d "$INPUT_DATABASE_URL" > "$INPUT_PATH" + else + "/usr/lib/postgresql/15/bin/pg_dump" --version + # shellcheck disable=SC2086 + "/usr/lib/postgresql/15/bin/pg_dump" $INPUT_OPTIONS -d "$INPUT_DATABASE_URL" > "$INPUT_PATH" + fi +else + echo "Running pg_dump..." + + # shellcheck disable=SC2086 + pg_dump $INPUT_OPTIONS -d "$INPUT_DATABASE_URL" > "$INPUT_PATH" fi -echo "Running pg_dump..." - -# shellcheck disable=SC2086 -pg_dump $INPUT_OPTIONS -d "$INPUT_DATABASE_URL" > "$INPUT_PATH" - echo "Complete" echo "::endgroup::"