Github actions testing and Railway CLI

I'm setting up Github actions in my repo to run my e2e testing before deploying to Railway. I need to use my environment variables from Railway for this (connection strings, etc) I'm using secrets in Github with a project token to authenticate. Whenever it gets to the testing step, I get this error: Multiple services found. Please specify a service to pull variables from. I only have one service, with one environment 'production', and just this one token. This is what my Github action looks like for the test step:
run: npm test
env:
RAILWAY_TOKEN: ${{ secrets.TOKEN_NAME }}
run: npm test
env:
RAILWAY_TOKEN: ${{ secrets.TOKEN_NAME }}
And my test script starts the server like this: railway run npm run start Can I get any assistance with setting this up properly? I used this page: https://blog.railway.app/p/github-actions and the docs to set it up and from my understanding it seems correct. Please and thank you!
Solution:
you may have only one service, but an update was made to the cli that requires you specify the service you want to up into, since you could have a single database service in a project and up into that, if that database was in use, up'ing into that service would not be good, so while this was a breaking change, it was a much much needed change, hopefully in time they will update the article you read, but in the mean time, all you should need to do is add this flag --service <service id> to your...
Jump to solution
7 Replies
Percy
Percy13mo ago
Project ID: 41f1e384-4e03-4db8-8977-4de7736f1111
Dramamine
Dramamine13mo ago
41f1e384-4e03-4db8-8977-4de7736f1111
Solution
Brody
Brody13mo ago
you may have only one service, but an update was made to the cli that requires you specify the service you want to up into, since you could have a single database service in a project and up into that, if that database was in use, up'ing into that service would not be good, so while this was a breaking change, it was a much much needed change, hopefully in time they will update the article you read, but in the mean time, all you should need to do is add this flag --service <service id> to your railway up command
Dramamine
Dramamine13mo ago
I definitely didn't see mention of that in the documentation. I'm probably blind though. Thanks, Brody! I'll try the change out tomorrow
Brody
Brody13mo ago
you are not blind, it is a very recent change and has not made it into any documentation, so absolutely no worries
Dramamine
Dramamine13mo ago
Can confirm it runs my tests now. Sweet. Thanks again
Brody
Brody13mo ago
no problem!
Want results from more Discord servers?
Add your server