Skip to content

Commit 3f2e122

Browse files
authored
fix: use docker postgres:18 for pg_dump/psql to fix version mismatch (calcom#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.
1 parent 27515d4 commit 3f2e122

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

.github/actions/cache-db/action.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ runs:
3232
shell: bash
3333
- name: Postgres Dump Backup
3434
if: steps.cache-db.outputs.cache-hit != 'true'
35-
uses: tj-actions/pg-dump@v2.3
36-
with:
37-
database_url: ${{ inputs.DATABASE_URL }}
38-
path: ${{ inputs.path }}
39-
options: "-O"
35+
run: |
36+
mkdir -p $(dirname "${{ inputs.path }}")
37+
docker run --rm --network host \
38+
-v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} \
39+
postgres:18 pg_dump "${{ inputs.DATABASE_URL }}" -O -f ${{ inputs.path }}
40+
shell: bash
4041
- name: Postgres Backup Restore
4142
if: steps.cache-db.outputs.cache-hit == 'true'
42-
uses: tj-actions/pg-restore@v4.5
43-
with:
44-
database_url: ${{ inputs.DATABASE_URL }}
45-
backup_file: ${{ inputs.path }}
43+
run: |
44+
docker run --rm -i --network host \
45+
-v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} \
46+
postgres:18 psql "${{ inputs.DATABASE_URL }}" -f ${{ inputs.path }}
47+
shell: bash

0 commit comments

Comments
 (0)