Repository navigation
ci: drop 'shortlink' fallback for D1_DATABASE_NAME in deploy.yml (ONE-505) - #154
Merged
Merged
Conversation
…-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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ONE-505 / ONE-506
D1_DATABASE_NAMEin the deploy workflow's "Inject resource IDs" step used a shortlink-era local fallback (|| 'shortlink').shortlinkis not the shared database name (that isworkerhub, taken from the org variable), so a missing or renamedvars.D1_DATABASE_NAMEwould not error — the deploy would quietly target a database namedshortlinkinstead (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_NAMEmust 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.Verification
actionlint .github/workflows/deploy.yml→ exit 0, no findings.git diffis exactly one line in one file.check(): empty →::error::Variable D1_DATABASE_NAME is missing or malformed,workerhub→ pass,work erhub→ fail.