How to remove source.commitSha pin without redeploy?
meridonhq
HOBBYOP

14 days ago

A production service is connected to a GitHub repository on branch main, but the Railway source config also contains a persistent source.commitSha pin.

Production is healthy. I want to remove only the source.commitSha value so the service returns to normal branch tracking, without redeploying or changing any other service configuration.

What is the supported way to do this?

Specifically:

  1. Should source.commitSha be set to null, unset, or another value?
  2. Can this change be staged first?
  3. Can it then be committed without triggering a redeploy?

I would prefer not to disconnect/reconnect the repository or use “Deploy Latest Commit” unless that is required.

Solved$10 Bounty

Pinned Solution

14 days ago

This isn't directly possible through the UI, but is possible through the API:


mutation Stage($environmentId: String!, $input: EnvironmentConfig!) {

  environmentStageChanges(environmentId: $environmentId, input: $input, merge: true) { id }

}

And specify with the following variables:


{

  "environmentId": "<ENV_ID>",

  "input": { "services": { "<SERVICE_ID>": { "source": { "commitSha": null } } } }

}

In order to not create a new deployment when committing the environment changes, use this:


mutation {

  environmentPatchCommitStaged(

    environmentId: "<ENV_ID>"

    commitMessage: "remove source.commitSha pin"

    skipDeploys: true

  )

}

(and specify the environment ID in the environment variables like above).

2 Replies

Railway
BOT

14 days ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway • 14 days ago


14 days ago

This isn't directly possible through the UI, but is possible through the API:


mutation Stage($environmentId: String!, $input: EnvironmentConfig!) {

  environmentStageChanges(environmentId: $environmentId, input: $input, merge: true) { id }

}

And specify with the following variables:


{

  "environmentId": "<ENV_ID>",

  "input": { "services": { "<SERVICE_ID>": { "source": { "commitSha": null } } } }

}

In order to not create a new deployment when committing the environment changes, use this:


mutation {

  environmentPatchCommitStaged(

    environmentId: "<ENV_ID>"

    commitMessage: "remove source.commitSha pin"

    skipDeploys: true

  )

}

(and specify the environment ID in the environment variables like above).


meridonhq
HOBBYOP

14 days ago

Solved. The persistent source.commitSha pin was removed through the supported staged GraphQL configuration flow with skipDeploys: true.

No deployment was triggered, the existing production deployment remained active, and the service is now tracking main normally again.

Thanks for the guidance.


Status changed to Solved 0x5b62656e5d • 14 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...