Skip to content
Limiting the Railway GitHub App installation to selected repositories: impact and permissions
sistemasaltavista
OP

5 hours ago

Hello,

We have a single Railway project with one service. The service's Source Repo is a private GitHub repository on a personal GitHub account. In one environment a branch is connected, with auto deploy disabled and "Wait for CI" disabled; the other environment has no branch connected. PR environments are not enabled. We also plan to deploy with a project-scoped Railway token from GitHub Actions.

The Railway GitHub App is currently installed with access to "All repositories". For security reasons we are considering changing it to "Only select repositories", selecting only the repository used by this service. Before changing anything we would like to understand:

  1. Will the service's Source Repo connection and the connected branch keep working if the installation is limited to that single repository?
  2. Do deployments made with a project-scoped Railway token (Railway CLI from GitHub Actions) depend in any way on the Railway GitHub App installation?
  3. Our environments currently have staged (not yet applied) changes. Can staged changes depend on, or be affected by, changing the GitHub App's repository access?
  4. What does Railway use each of its GitHub App permissions for (Administration, Workflows, Actions, Deployments, Checks, Commit statuses, Pull requests, Contents)? Which features stop working without each one? Is there a supported way to install the app with fewer permissions?
  5. If something stops working after limiting the access, does switching back to "All repositories" fully restore the previous state, or are there effects that would not be undone?

Where possible, please indicate whether each answer is a documented guarantee or describes current behavior, and point us to the relevant documentation.

Thank you.

$20 Bounty

3 Replies

Railway
BOT

5 hours ago

For the repository connection, the documented requirement is that the Railway GitHub App has access to the repository and that at least one project member has a connected GitHub account with contributor access to it (GitHub autodeploys). Limiting the installation to "Only select repositories" with that repository selected still meets that requirement. If anything misbehaves after a change, the documented recovery is to wait a few minutes for caches to refresh, then disconnect and reconnect the repository in the service settings.

railway up with a project token scans, compresses and uploads the files from the directory it runs in, then builds them (Deploying with the CLI). Those deployments are built from the uploaded files rather than pulled from GitHub.

We can't give you a per-permission breakdown of the GitHub App, a reduced-permission install option, or guarantees about how staged changes or switching back to "All repositories" behave. Wait for CI is one documented feature that depends on accepting the app's updated permissions. Because the change is reversible on GitHub's side, the safest way to confirm the rest for your workflow is to make the change, then check that the service still shows its source repo and branch and that a "Deploy Latest Commit" from the command palette works, before you apply the staged changes.


Status changed to Awaiting User Response Railway • about 5 hours ago


Railway

For the repository connection, the documented requirement is that the Railway GitHub App has access to the repository and that at least one project member has a connected GitHub account with contributor access to it ([GitHub autodeploys](https://docs.railway.com/deployments/github-autodeploys)). Limiting the installation to "Only select repositories" with that repository selected still meets that requirement. If anything misbehaves after a change, the documented recovery is to wait a few minutes for caches to refresh, then disconnect and reconnect the repository in the service settings. `railway up` with a project token scans, compresses and uploads the files from the directory it runs in, then builds them ([Deploying with the CLI](https://docs.railway.com/cli/deploying)). Those deployments are built from the uploaded files rather than pulled from GitHub. We can't give you a per-permission breakdown of the GitHub App, a reduced-permission install option, or guarantees about how staged changes or switching back to "All repositories" behave. Wait for CI is one documented feature that depends on accepting the app's updated permissions. Because the change is reversible on GitHub's side, the safest way to confirm the rest for your workflow is to make the change, then check that the service still shows its source repo and branch and that a "Deploy Latest Commit" from the command palette works, before you apply the staged changes.

sistemasaltavista
OP

4 hours ago

Thanks for the quick automated reply. Answers 1 and 2 are helpful and we have noted them.

Could someone from the Railway team please review the remaining questions? We cannot run test deployments, apply our staged changes, or disconnect/reconnect the repository until we understand the impact, so "make the change and check" is not an option for us right now.

  1. Can staged (not yet applied) changes depend on, or be affected by, changing the GitHub App's repository access from "All repositories" to "Only select repositories"?
  2. Which features use the GitHub App's Administration, Workflows, Actions, Deployments, Checks, Commit statuses and Pull requests permissions? In staging, auto deploy and Wait for CI are disabled. The other environment has no branch connected, and those controls are not visible there. PR environments appear disabled at project level. Which of these permissions are still needed in this setup?
  3. If we limit the access and later switch back to "All repositories", is there any Railway-side effect that would not be undone?

Thank you.


Status changed to Awaiting Railway Response Railway • about 4 hours ago


Railway
BOT

4 hours ago

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

Status changed to Open Railway • about 4 hours ago


1 - If the repository the service relies on still has access to the repository, then no, it will not be affected.

2 - Listed below (I'd recommend leaving permissions as is)

Administration: Create/manage repositories

Workflows: Modify GitHub workflows

PR: Comment on/read PRs

Actions: Read workflow runs

Deployments: Create GitHub deployment records

Checks: Read check runs

Commit statuses: Post status on commits

3 - No.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...