Skip to content

Commit de6e1f9

Browse files
committed
Fix E2E task in Action workflow, target the actual Postgres container instead of the Postgres-meta sidecar
1 parent d038880 commit de6e1f9

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,15 @@ jobs:
206206
bash <<'BASH'
207207
set -euo pipefail
208208
209-
db_container_line=$(docker ps --format '{{.ID}} {{.Names}} {{.Image}}' | awk '$3 ~ /supabase\/postgres/ {print $1" "$2; exit}')
209+
find_db_container() {
210+
docker ps --format '{{.ID}} {{.Names}} {{.Image}}' | awk '$3 ~ /^supabase\/postgres(:|$)/ {print $1" "$2; exit}'
211+
}
212+
213+
db_container_line=$(find_db_container)
214+
if [ -z "${db_container_line}" ]; then
215+
db_container_line=$(docker ps --format '{{.ID}} {{.Names}} {{.Image}}' | awk '$2 ~ /_db_/ {print $1" "$2; exit}')
216+
fi
217+
210218
if [ -z "${db_container_line}" ]; then
211219
echo "Supabase database container not found; cannot verify migrations" >&2
212220
exit 1
@@ -220,7 +228,7 @@ jobs:
220228
missing=0
221229
222230
for table in "${required_tables[@]}"; do
223-
if ! docker exec "${container_id}" psql -U postgres -d postgres -At -c "select to_regclass('public.${table}');" | grep -q "public.${table}"; then
231+
if ! docker exec -e PGPASSWORD=postgres "${container_id}" psql -U postgres -d postgres -At -c "select to_regclass('public.${table}');" | grep -q "public.${table}"; then
224232
echo "❌ Missing table public.${table}"
225233
missing=1
226234
else

0 commit comments

Comments
 (0)