diff --git a/action.yml b/action.yml index 8ddca84..0dada4a 100644 --- a/action.yml +++ b/action.yml @@ -14,11 +14,11 @@ runs: run: | set -x if [[ "${{ runner.os }}" == "Linux" ]]; then - cache_dir="$(apt-cache policy postgresql-${{ inputs.postgresql_version }} | awk '/Filename/ {print $2}')" + cache_dir="/var/cache/apt/archives/" elif [[ "${{ runner.os }}" == "macOS" ]]; then cache_dir="$(brew --cache postgresql@${{ inputs.postgresql_version }})" elif [[ "${{ runner.os }}" == "Windows" ]]; then - cache_dir="~\AppData\Local\Temp\chocolatey\postgresql-${{ inputs.postgresql_version }}" + cache_dir="~\AppData\Local\Temp\chocolatey" fi echo "cache_dir=$cache_dir" >> "$GITHUB_OUTPUT" shell: bash diff --git a/entrypoint.sh b/entrypoint.sh index df9f59d..d3dc836 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -35,9 +35,9 @@ if [[ "$(uname -s)" == "Linux" ]]; then sudo apt-get update # Install PostgreSQL - sudo apt-get apt-get -o Dir::Cache::Archives=/tmp install -y "postgresql-$INPUT_POSTGRESQL_VERSION" + sudo apt-get apt-get install -y "postgresql-$INPUT_POSTGRESQL_VERSION" elif [[ "$(uname -s)" == "NT"* ]] || [[ "$(uname -s)" == "MINGW"* ]] || [[ "$(uname -s)" == *"MSYS"* ]]; then - choco install "postgresql$INPUT_POSTGRESQL_VERSION" -y --no-progress --cache-location="C:\\ProgramData\\chocolatey\\cache" + choco install "postgresql$INPUT_POSTGRESQL_VERSION" -y --no-progress elif [[ "$(uname -s)" == "Darwin" ]]; then brew update brew install "postgresql@$INPUT_POSTGRESQL_VERSION"