Skip to content

Commit 644bd59

Browse files
committed
fix(ci): pin setup-go SHA and update migration README
Pin actions/setup-go to SHA 4a3601...c1c06c (v6.4.0) in all three migrate jobs (AWS, GCP, Azure); the pre-existing @v5 tag was unpinned, inconsistent with every other workflow in the repo. Update .github/workflows/README.md to accurately describe the down- migration guards introduced in this PR: replace the stale "warns on prod down migrations" bullet with the actual fail-closed behavior (explicit steps required, rollback-prod confirmation for prod), and add a prod-down example command showing the confirm input.
1 parent 5b4ea67 commit 644bd59

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

‎.github/workflows/README.md‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,14 @@ gh workflow run database-migration.yml \
342342
-f direction=down \
343343
-f steps=2
344344

345+
# Rollback 1 migration on AWS prod (requires typed confirmation)
346+
gh workflow run database-migration.yml \
347+
-f cloud=aws \
348+
-f environment=prod \
349+
-f direction=down \
350+
-f steps=1 \
351+
-f confirm=rollback-prod
352+
345353
# Apply to all clouds
346354
gh workflow run database-migration.yml \
347355
-f cloud=all \
@@ -351,10 +359,11 @@ gh workflow run database-migration.yml \
351359

352360
### Safety Features
353361

354-
- **Validation** - Checks migration files exist
355-
- **Production Warnings** - Warns on prod down migrations
356-
- **Audit Trail** - Records all migrations
357-
- **Step Control** - Apply specific number of migrations
362+
- **Validation** - Checks migration files exist before running
363+
- **Explicit steps required** - `direction=down` requires an explicit positive `steps` value; `steps=0` (the default, which would run `down -all` and drop the entire schema) is rejected
364+
- **Production confirmation** - `direction=down` on `environment=prod` additionally requires typing `rollback-prod` in the `confirm` input; omitting or mistyping it blocks the run
365+
- **Defense in depth** - each migrate job independently re-validates the positive-steps constraint, so a future validate regression cannot reach `down -all`
366+
- **Audit Trail** - Records all migrations in the step summary
358367

359368
---
360369

‎.github/workflows/database-migration.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ jobs:
177177
persist-credentials: false
178178

179179
- name: Set up Go
180-
uses: actions/setup-go@v5
180+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
181181
with:
182182
go-version-file: go.mod
183183

@@ -253,7 +253,7 @@ jobs:
253253
persist-credentials: false
254254

255255
- name: Set up Go
256-
uses: actions/setup-go@v5
256+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
257257
with:
258258
go-version-file: go.mod
259259

@@ -320,7 +320,7 @@ jobs:
320320
persist-credentials: false
321321

322322
- name: Set up Go
323-
uses: actions/setup-go@v5
323+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
324324
with:
325325
go-version-file: go.mod
326326

0 commit comments

Comments
 (0)