Skip to content

ci(staging): no workspace-scoped Railway token in staging; guard against it - #91

Open
jlwaugh wants to merge 1 commit into
stagingfrom
ci/no-workspace-token
Open

jlwaugh wants to merge 1 commit into
stagingfrom
ci/no-workspace-token

Conversation

@jlwaugh

@jlwaugh jlwaugh commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@@ -29,9 +29,6 @@ jobs:
BOS_STORAGE_ORIGIN: ${{ vars.BOS_STORAGE_ORIGIN || 'https://upload.everything.dev' }}
BOS_STORAGE_API_KEY: ${{ secrets.BOS_STAGING_STORAGE_API_KEY }}
RAILWAY_TOKEN: ${{ secrets.RAILWAY_STAGING_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to keep the workspace token out of staging. One side effect: without it the deploy leg can't repoint the service source, so staging falls back to a plain redeploy with the "service source was not repointed" notice (the run before c768e66 shows it). The source is still pinned to rc.29 from last night's run, so when the rc.30 bump lands, staging will publish rc.30 config but keep pulling the rc.29 image until someone repoints it in Railway. Could you note that in the PR, or add "repoint staging's source by hand" to the upgrade steps? cc @itexpert120 since he added these lines yesterday.

if (file === "staging.yml" && /secrets\.RAILWAY_TOKEN\b/.test(text)) {
problems.push(`${file}: reads secrets.RAILWAY_TOKEN, production's Railway token`);
}
if (file === "staging.yml" && /^\s*RAILWAY_API_TOKEN\s*:/m.test(text)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only catches the unquoted RAILWAY_API_TOKEN: key. "RAILWAY_API_TOKEN": …, echo "RAILWAY_API_TOKEN=${{ secrets.RAILWAY_STAGING_API_TOKEN }}" >> $GITHUB_ENV, or an inline RAILWAY_API_TOKEN=… pnpm run bos deploy would all get through. Maybe also match the secret, like the secrets.RAILWAY_TOKEN rule above, e.g. /secrets\.RAILWAY_\w*API_TOKEN\b|\bRAILWAY_API_TOKEN\b/, with a test for the = form?

BOS_STORAGE_ORIGIN: ${{ vars.BOS_STORAGE_ORIGIN || 'https://upload.everything.dev' }}
BOS_STORAGE_API_KEY: ${{ secrets.BOS_STAGING_STORAGE_API_KEY }}
RAILWAY_TOKEN: ${{ secrets.RAILWAY_STAGING_TOKEN }}
RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_STAGING_API_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RAILWAY_STAGING_API_TOKEN secret is still in the repo; last night's run shows it's set. Worth deleting it, and revoking the token in Railway, so nothing can pick it up again.

This branch has not been deployed

No deployments
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.

2 participants