Skip to content

Commit c67337e

Browse files
committed
ci(selfhost): single-source the ephemeral PG service container's throwaway password
The scanner flagged the literal in the test step. It is deliberately not a repository secret — the service container is job-scoped, localhost-only, and holds synthetic rows — but the credential now lives in ONE documented job-level env var consumed by both the service definition and the test step, so the two can never drift and the intent is explicit at the definition site.
1 parent 3815b50 commit c67337e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/selfhost.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,17 @@ jobs:
6161
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true }}
6262
runs-on: ubuntu-latest
6363
timeout-minutes: 20
64+
env:
65+
# Throwaway credential for the job-scoped ephemeral Postgres SERVICE CONTAINER below — deliberately
66+
# not a repository secret: the container exists only for this job's lifetime, is reachable only from
67+
# the runner's localhost, and holds nothing but synthetic test rows. Single-sourced here so the
68+
# service env and the test step can never drift.
69+
PG_TEST_PASSWORD: devpw
6470
services:
6571
postgres:
6672
image: postgres:18-alpine
6773
env:
68-
POSTGRES_PASSWORD: devpw
74+
POSTGRES_PASSWORD: ${{ env.PG_TEST_PASSWORD }}
6975
POSTGRES_DB: loopover
7076
ports:
7177
- 5432:5432
@@ -94,7 +100,7 @@ jobs:
94100
run: npm run build --workspace @loopover/engine
95101

96102
- name: Postgres integration test (real PG)
97-
run: PG_TEST_URL=postgres://postgres:devpw@localhost:5432/loopover npx vitest run test/integration/selfhost-pg.test.ts test/integration/selfhost-pg-calibration.test.ts
103+
run: PG_TEST_URL=postgres://postgres:${{ env.PG_TEST_PASSWORD }}@localhost:5432/loopover npx vitest run test/integration/selfhost-pg.test.ts test/integration/selfhost-pg-calibration.test.ts
98104

99105
- name: Build the self-host bundle
100106
run: node --experimental-strip-types scripts/build-selfhost.ts

0 commit comments

Comments
 (0)