Skip to content

Scheduling infrastructure for absolutely everyone.

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

Dhairyashil Shinde3f2e122295c2
diff --git a/.github/actions/cache-db/action.yml b/.github/actions/cache-db/action.yml
index ec5738e4267..431e74c67c2 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/[email protected]
- 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/[email protected]
- 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