a year ago
Hi everyone,
Attached is my github workflow.
Nothing crazy, just trying to create a neon branch on pr and then update environment variable in Railway and delete on close. The issue i am running into is here:
Run railway link
railway link
--project ***
--environment "pr-55"
shell: /usr/bin/bash -e {0}
env:
RAILWAY_API_TOKEN: ***
LINK_PROJECT_ID: ***
NEON_API_KEY: ***
NEON_PROJECT_ID: ***
NEON_PARENT_BRANCH: development
Unauthorized. Please login with railway login
Error: Process completed with exit code 1.
12 Replies
a year ago
Hey there! So the exact env variable you are sending is RAILWAYAPITOKEN? Thats incorrect, Railway expects RAILWAY_TOKEN. You can alias with: RAILWAY_TOKEN: ${{ secrets.RAILWAYAPITOKEN }}
noahd
Hey there! So the exact env variable you are sending is RAILWAYAPITOKEN? Thats incorrect, Railway expects RAILWAY\_TOKEN. You can alias with: RAILWAY\_TOKEN: ${{ secrets.RAILWAYAPITOKEN }}
a year ago
No, for some reason it's not formatting the variables here properly, the variable is RAILWAY_API_TOKEN, NEON_API_KEY, LINK_PROJECT_ID, NEON_PROJECT_ID, NEON_PARENT_BRANCH
jeevenmotion
No, for some reason it's not formatting the variables here properly, the variable is RAILWAY\_API\_TOKEN, NEON\_API\_KEY, LINK\_PROJECT\_ID, NEON\_PROJECT\_ID, NEON\_PARENT\_BRANCH
a year ago
I just checked around, Someone reported:
To run railway up non-interactively in CI:
- Use a Project Token (not an Account/Team token).
- Set it as
RAILWAY_TOKENin your CI environment.
Token types:
RAILWAY_API_TOKEN→ works forrailway whoami,link, etc.RAILWAY_TOKEN(Project Token) → required forrailway up,redeploy, logs.
Fix:
- Go to Railway → Project → Settings → Tokens → Generate Project Token.
- Set it as
RAILWAY_TOKENin your CI. - Run
railway up— no login needed.
Which actions are you doing?
a year ago
Railway Link and Railway Variable (Setting a variable)
jeevenmotion
Railway Link and Railway Variable (Setting a variable)
a year ago
Are you using a user token or project specific token?
a year ago
User
jeevenmotion
User
a year ago
a year ago
For anybody reading this thread, don't bother trying to work with the CLI in CI/CD. Spend your time using the GraphQL API, it'll be a lot easier than trying to get the CI/CD to work at the moment.
Status changed to Open nico • 11 months ago
Status changed to Solved jeevenmotion • 11 months ago