How to change branch from CLI?
adrianpunkt
PROOP

a month ago

We're deploying a service from a GitHub workflow (on new PR) and want to connect the new service to the PR branch. Deployment and everything works, but the new service gets attached to develop branch from which it was copied.

Is there any way to switch the branch post deployment or at any point?

Currently we're doing:

railway link --project ${{ env.RAILWAY_PROJECT_NAME }} --environment develop 
railway environment new ${{ github.head_ref }} --copy develop

and then

railway link --project ${{ env.RAILWAY_PROJECT_NAME }} --environment ${{ github.head_ref }}
          railway up --detach --service ${{ env.RAILWAY_BACKEND_SERVICE_NAME }}

github.head_ref will resolve to the PR branch name.

Solved

2 Replies

Railway
BOT

a month ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


brody
EMPLOYEE

a month ago

Hello,

This isn't supported right now, but we are working on it!

Best,
Brody


Status changed to Awaiting User Response Railway about 1 month ago


Railway
BOT

a month ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway about 1 month ago


Loading...