R
Railway

✋|help

Can't run Railway CLI down command with project token

SSnuzzn8/21/2023
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 }}


Currently it's giving:
Unauthorized. Please login with railway login
SSnuzzn8/21/2023
N/A
MMantisInABox8/21/2023
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
SSnuzzn8/21/2023
i see, so it's different to the railway up command?
MMantisInABox8/21/2023
Honestly, I am not 100% sure, I have not used the CLI for github actions.
SSnuzzn8/21/2023
- 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
BBrody8/21/2023
removing/restarting/re-deploying a service/deployment requires the use of the account token
SSnuzzn8/21/2023
ohh i didn't know there was an account token. I'll try that. Thank you!
is the account token same as api token?
SSnuzzn8/21/2023
what's the expected variable name for the account token when running the command
BBrody8/21/2023
isnt it RAILWAY_TOKEN?
SSnuzzn8/21/2023
when I use that, it seems to think I'm referring to project token:
Project Token not found
SSnuzzn8/21/2023
it doent seem to work:
Unauthorized. Please login with railway login
BBrody8/21/2023
and you are giving it the api token from the account page?
SSnuzzn8/21/2023
yep
BBrody8/21/2023
you might have to code up something that calls the api yourself
SSnuzzn8/21/2023
ahh i see, ok. I'll give that a go later. Thanks for your time 🙂
BBrody8/21/2023
no problem 🙂

Looking for more? Join the community!

Recommended Posts
Ruby on Rails Deployment with database and redisi had a few questions about linking my database and redis server within railway app ... I tried but Lost all my 20$ credits out of no whereSo i just got an email saying my projects needs 3$ in credits, but suddenly when i check? my whole 2any reason why my usage suddenly jumps to 4GB when there are no tasks running?The app had no requests for for the entire day but the usage jumped, any reason why this could happei want to dowload my post gre db locallyhow can i dowload my post-gre db locallyCloudflare custom domain not workingI just upgraded the api for Cloudflare, but the custom domain is no longer workingError: Unsupported Gradle version: 8============== Using Nixpacks ============== context: 78ee202a04734b630f61d71bea3f81cd  NixpacksOSError: libheif.so.1: cannot open shared object file: No such file or directoryHello, I have tried everything i can to get my django project deployed, the build completes, but depFlask app not workinghey there am very new to railway, i would love to get some help, I am not familiar with hosting a weAverage Cost of Ghost CMS Blog?Hi so I've recently moved over to Railway.app, after hearing great things about it and getting boggewebhook outdated docs and issuesHello First of, https://docs.railway.app/diagnose/webhooks this documentation seems outdated. I'm Configure GitHub PATHow do I configure my GitHub PAT (Personal Access token) while deploying my nestJS app on railway?How can I SSH into my CLI application?Hello, I have an CLI python app deployed but I need to connect to the service. I couldnt find how. IPostgres pricing questionsI'm starting to index a few data to my railway postgres. I need to clarify a few questions: 1. WhaDashboard: View cost by service is brokenI think postgres should be a new row?Memory not released even after postgres table droppedHello. Project ID: 6dee0732-68aa-4ae0-a472-7d02880e238a I created a table on 19th August and then Can only view 100 lines of logsI can only see the last 100 lines fo the logs in log viewer I have opted in to "priority boarding"Unexpected crash - Rust crashes after building with libgssapi-krb5 referenceHey, first time posting an error - my Railway deployment is crashing with the following error: erroDocker Service CRON Restart?Hi guys, i have a single docker service running. I'd like to restart this service periodically via tCan't set a private project to publicWhenever I try to set a private project to public, I get the error "All services in a public projectcan railway forward traffic to a self signed web application?i'm deploying an application and for some reason it needs to use self signed certificate, could rail