diff --git a/action.yml b/action.yml index 11d1f31..28a212d 100644 --- a/action.yml +++ b/action.yml @@ -34,24 +34,6 @@ runs: - run: | bash $GITHUB_ACTION_PATH/entrypoint.sh shell: bash - # Skip if cache hit and it's on Windows - if: | - ( - runner.os == 'Windows' && steps.cache-postgresql.outputs.cache-hit != 'true' - ) - || - ( - runner.os != 'Windows' - ) - env: - # INPUT_ 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: Update PATH - run: | - bash $GITHUB_ACTION_PATH/update-path.sh - shell: bash env: # INPUT_ is not available in Composite run steps # https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611 diff --git a/entrypoint.sh b/entrypoint.sh index db9cef9..351ce61 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -48,4 +48,18 @@ fi 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::" diff --git a/update-path.sh b/update-path.sh deleted file mode 100644 index 2519e37..0000000 --- a/update-path.sh +++ /dev/null @@ -1,17 +0,0 @@ -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::" \ No newline at end of file