File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,10 +74,26 @@ runs:
7474 echo "$name=" >> $GITHUB_ENV
7575 done
7676
77- choco install postgresql$INPUT_POSTGRES_VERSION \
78- --params "/Password:$INPUT_PASSWORD" \
79- --ia "--enable-components server,commandlinetools --extract-only 1" \
80- --no-progress
77+ # Chocolatey downloads the PostgreSQL installer from
78+ # get.enterprisedb.com, which intermittently responds with HTTP 403
79+ # and aborts the install. Retry a few times to absorb such transient
80+ # download failures.
81+ for attempt in 1 2 3; do
82+ if choco install postgresql$INPUT_POSTGRES_VERSION \
83+ --params "/Password:$INPUT_PASSWORD" \
84+ --ia "--enable-components server,commandlinetools --extract-only 1" \
85+ --no-progress; then
86+ break
87+ fi
88+
89+ if [ "$attempt" -eq 3 ]; then
90+ echo "::error::Failed to install PostgreSQL after $attempt attempts."
91+ exit 1
92+ fi
93+
94+ echo "::warning::choco install failed (attempt $attempt), retrying in 15s..."
95+ sleep 15
96+ done
8197
8298 PG_BINDIR=$("$PROGRAMFILES/PostgreSQL/$INPUT_POSTGRES_VERSION/bin/pg_config.exe" --bindir)
8399 PG_LIBDIR=$("$PROGRAMFILES/PostgreSQL/$INPUT_POSTGRES_VERSION/bin/pg_config.exe" --libdir)
You can’t perform that action at this time.
0 commit comments