From 3f2e122295c2560ac9f89c3f9e9a824f6bbd733e Mon Sep 17 00:00:00 2001 From: Dhairyashil Shinde <93669429+dhairyashiil@users.noreply.github.com> Date: Wed, 4 Mar 2026 17:50:25 +0530 Subject: [PATCH] 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. --- .github/actions/cache-db/action.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/actions/cache-db/action.yml b/.github/actions/cache-db/action.yml index ec5738e426..431e74c67c 100644 --- a/.github/actions/cache-db/action.yml +++ b/.github/actions/cache-db/action.yml @@ -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