Can't run Railway CLI down command with project token
hey , it is possible to run the railway down command with railway project token without logging in. I'd like to use this in a github action workflow after running e2e tests on a staging environment.
Currently it's giving:
Unauthorized. Please login with
railway login
19 Replies
Project ID:
N/A
N/A
I believe you would need to be logged in, I don't think there is a way to use just the project ID, as it needs your auth token to interact with your resources
i see, so it's different to the railway up command?
Honestly, I am not 100% sure, I have not used the CLI for github actions.
- name: Deploy
run:
railway up
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
It's a bit confusing coz the above is working. So it looks like only certain commands are allowed
removing/restarting/re-deploying a service/deployment requires the use of the account token
ohh i didn't know there was an account token. I'll try that. Thank you!
is the account token same as api token?
what's the expected variable name for the account token when running the command
isnt it
RAILWAY_TOKEN
?when I use that, it seems to think I'm referring to project token:
Project Token not found
it doent seem to work:
Unauthorized. Please login with
railway login
and you are giving it the api token from the account page?
yep
you might have to code up something that calls the api yourself
ahh i see, ok. I'll give that a go later. Thanks for your time π
no problem π