R
Railwayβ€’13mo ago
Snuzzn

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.
- name: Remove Most Recent Deployment
run: railway down --yes
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
- name: Remove Most Recent Deployment
run: railway down --yes
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
Currently it's giving: Unauthorized. Please login with railway login
19 Replies
Percy
Percyβ€’13mo ago
Project ID: N/A
Snuzzn
Snuzznβ€’13mo ago
N/A
MantisInABox
MantisInABoxβ€’13mo ago
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
Snuzzn
Snuzznβ€’13mo ago
i see, so it's different to the railway up command?
MantisInABox
MantisInABoxβ€’13mo ago
Honestly, I am not 100% sure, I have not used the CLI for github actions.
Snuzzn
Snuzznβ€’13mo ago
- 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
Brody
Brodyβ€’13mo ago
removing/restarting/re-deploying a service/deployment requires the use of the account token
Snuzzn
Snuzznβ€’13mo ago
ohh i didn't know there was an account token. I'll try that. Thank you! is the account token same as api token?
Snuzzn
Snuzznβ€’13mo ago
what's the expected variable name for the account token when running the command
Brody
Brodyβ€’13mo ago
isnt it RAILWAY_TOKEN?
Snuzzn
Snuzznβ€’13mo ago
when I use that, it seems to think I'm referring to project token: Project Token not found
Snuzzn
Snuzznβ€’13mo ago
it doent seem to work: Unauthorized. Please login with railway login
Brody
Brodyβ€’13mo ago
and you are giving it the api token from the account page?
Want results from more Discord servers?
Add your server