8 months 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:
RAILWAYAPITOKEN: ***
LINKPROJECTID: ***
NEONAPIKEY: ***
NEONPROJECTID: ***
NEONPARENTBRANCH: development
Unauthorized. Please login with railway login
Error: Process completed with exit code 1.
12 Replies
7 months 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 }}
7 months 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
7 months 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?
7 months ago
Railway Link and Railway Variable (Setting a variable)
jeevenmotion
Railway Link and Railway Variable (Setting a variable)
7 months ago
Are you using a user token or project specific token?
7 months ago
User
7 months 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 itsrems • 8 months ago
Status changed to Solved jeevenmotion • 8 months ago