fix: use docker postgres:18 for pg_dump/psql to fix version mismatch (#28260)

The recent upgrade to PostgreSQL 18 in CI (commit 27515d4) caused the
Setup Database job to fail because the runner's host pg_dump (v16) refuses
to dump a Postgres 18 server.

Replace tj-actions/pg-dump and tj-actions/pg-restore with docker run
commands using the postgres:18 image, ensuring the client version always
matches the server. This aligns with the fix already applied in the
internal cal repo.
This commit is contained in:
Dhairyashil Shinde
2026-03-04 09:20:25 -03:00
committed by GitHub
parent 27515d42f0
commit 3f2e122295
+11 -9
View File
@@ -32,14 +32,16 @@ runs:
shell: bash
- name: Postgres Dump Backup
if: steps.cache-db.outputs.cache-hit != 'true'
uses: tj-actions/pg-dump@v2.3
with:
database_url: ${{ inputs.DATABASE_URL }}
path: ${{ inputs.path }}
options: "-O"
run: |
mkdir -p $(dirname "${{ inputs.path }}")
docker run --rm --network host \
-v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} \
postgres:18 pg_dump "${{ inputs.DATABASE_URL }}" -O -f ${{ inputs.path }}
shell: bash
- name: Postgres Backup Restore
if: steps.cache-db.outputs.cache-hit == 'true'
uses: tj-actions/pg-restore@v4.5
with:
database_url: ${{ inputs.DATABASE_URL }}
backup_file: ${{ inputs.path }}
run: |
docker run --rm -i --network host \
-v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} \
postgres:18 psql "${{ inputs.DATABASE_URL }}" -f ${{ inputs.path }}
shell: bash