Skip to content

Commit 8b6184f

Browse files
committed
ci(migrations): map optional direct-connection DSN secrets
1 parent c277a59 commit 8b6184f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/migrations.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ jobs:
5252
# The expression maps the explicit environment input to exactly one repo
5353
# secret, so the job never holds another environment's database URL. An
5454
# unknown environment resolves to empty and the guard below fails the job.
55+
# MIGRATION_DATABASE_URL is the optional direct (non-pooled) DSN preferred
56+
# by migrate.ts; when the secret is unset it resolves to empty and the
57+
# script falls back to DATABASE_URL.
5558
- name: Apply database schema changes
5659
working-directory: ./packages/db
5760
env:
5861
DATABASE_URL: ${{ inputs.environment == 'production' && secrets.DATABASE_URL || inputs.environment == 'staging' && secrets.STAGING_DATABASE_URL || inputs.environment == 'dev' && secrets.DEV_DATABASE_URL || '' }}
62+
MIGRATION_DATABASE_URL: ${{ inputs.environment == 'production' && secrets.MIGRATION_DATABASE_URL || inputs.environment == 'staging' && secrets.STAGING_MIGRATION_DATABASE_URL || '' }}
5963
ENVIRONMENT: ${{ inputs.environment }}
6064
run: |
6165
if [ -z "$DATABASE_URL" ]; then

0 commit comments

Comments
 (0)