From 3b5b98327e466b0b1e7350d5056a0c0fb3b327d2 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 28 Mar 2026 14:25:29 -0700 Subject: [PATCH] [Fix] Use integration-redis-postgres env for Redis workflows since Postgres always starts GHA doesn't support conditional service containers, so the Postgres container always starts even for Redis-only jobs. Use integration-redis-postgres environment for any workflow with enable-redis so the Postgres container gets valid credentials. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/_test-unit-services-base.yml | 5 +++-- .github/workflows/test-unit-caching-redis.yml | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_test-unit-services-base.yml b/.github/workflows/_test-unit-services-base.yml index f5bd0e2ea6..d53a9e8822 100644 --- a/.github/workflows/_test-unit-services-base.yml +++ b/.github/workflows/_test-unit-services-base.yml @@ -61,10 +61,11 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} # Environment is derived from the enable-* flags, not caller-controllable. # This prevents callers from passing arbitrary environment names to bypass secret scoping. + # Note: Postgres service container always starts (GHA limitation), so any Redis job + # also needs Postgres secrets → uses integration-redis-postgres, not integration-redis. environment: >- ${{ - (inputs.enable-redis && inputs.enable-postgres) && 'integration-redis-postgres' || - inputs.enable-redis && 'integration-redis' || + inputs.enable-redis && 'integration-redis-postgres' || inputs.enable-postgres && 'integration-postgres' || '' }} diff --git a/.github/workflows/test-unit-caching-redis.yml b/.github/workflows/test-unit-caching-redis.yml index 4475dbf1b7..ca274324f2 100644 --- a/.github/workflows/test-unit-caching-redis.yml +++ b/.github/workflows/test-unit-caching-redis.yml @@ -33,3 +33,6 @@ jobs: REDIS_HOST: ${{ secrets.REDIS_HOST }} REDIS_PORT: ${{ secrets.REDIS_PORT }} REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }} + DATABASE_URL: ${{ secrets.DATABASE_URL }} + POSTGRES_USER: ${{ secrets.POSTGRES_USER }} + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}