Skip to content

ci: drop 'shortlink' fallback for D1_DATABASE_NAME in deploy.yml (ONE-505) - #154

Merged
mapxn merged 1 commit into
mainfrom
agent/daniel/7c562ab9c4c8
Oct 26, 2026
Merged

mapxn merged 1 commit into
mainfrom
agent/daniel/7c562ab9c4c8

Conversation

@mapxn

@mapxn mapxn commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

ONE-505 / ONE-506

D1_DATABASE_NAME in the deploy workflow's "Inject resource IDs" step used a shortlink-era local fallback (|| 'shortlink'). shortlink is not the shared database name (that is workerhub, taken from the org variable), so a missing or renamed vars.D1_DATABASE_NAME would not error — the deploy would quietly target a database named shortlink instead (failing midway if it does not exist, or connecting to the wrong one if it does).

The same step already has a fail-closed check(): D1_DATABASE_NAME must match ^[A-Za-z0-9_-]+$, and an empty value cannot match. Removing the fallback therefore makes a missing variable fail immediately and visibly at the injection step.

Change (one line)

           D1_DATABASE_ID: ${{ secrets.D1_DATABASE_ID }}
-          D1_DATABASE_NAME: ${{ vars.D1_DATABASE_NAME || 'shortlink' }}
+          D1_DATABASE_NAME: ${{ vars.D1_DATABASE_NAME }}
           CF_ACCESS_CLIENT_ID: ${{ secrets.CF_ACCESS_CLIENT_ID }}

Not changed

  • check D1_DATABASE_NAME '^[A-Za-z0-9_-]+$' left as-is.
  • No other variables, secrets, or steps touched; no other files touched.

Verification

  • actionlint .github/workflows/deploy.yml → exit 0, no findings.
  • git diff is exactly one line in one file.
  • Fail-closed behavior exercised locally against the step's check(): empty → ::error::Variable D1_DATABASE_NAME is missing or malformed, workerhub → pass, work erhub → fail.

…-505)

An empty/renamed vars.D1_DATABASE_NAME now fails closed at the Inject
resource IDs step via the existing check() regex instead of silently
pointing the deploy at a database literally named shortlink.
@mapxn
mapxn merged commit 6b9fa59 into main Oct 26, 2026
2 checks passed
@mapxn
mapxn deleted the agent/daniel/7c562ab9c4c8 branch November 8, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant