Skip to main content

github_repos

Creates, updates, deletes, gets or lists a github_repos resource.

Overview​

Namegithub_repos
TypeResource
Idrailway.integrations.github_repos

Fields​

The following fields are returned by SELECT queries:

One GitHubRepoWithoutInstallation row.

NameDatatypeDescription
idinteger
namestring
full_namestring
default_branchstring
descriptionstring
is_privateboolean

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfull_repo_nameChecks if user has access to GitHub repository. Backed by the Railway GraphQL query githubRepo.
listselectGet a list of repos for a user that Railway has access to. Backed by the Railway GraphQL query githubRepos.
updateupdateenvironment_id, project_id, service_idUpdates a GitHub repo through the linked template. Backed by the Railway GraphQL mutation githubRepoUpdate.
deployexecproject_id, repobranch, environment_idDeploys a GitHub repo. Backed by the Railway GraphQL mutation githubRepoDeploy.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
full_repo_namestring
branchstring
environment_idstring
project_idstring
repostring
service_idstring

SELECT examples​

Checks if user has access to GitHub repository. Backed by the Railway GraphQL query githubRepo.

SELECT
id,
name,
full_name,
default_branch,
description,
is_private
FROM railway.integrations.github_repos
WHERE full_repo_name = '{{ full_repo_name }}' -- required
;

UPDATE examples​

Updates a GitHub repo through the linked template. Backed by the Railway GraphQL mutation githubRepoUpdate.

UPDATE railway.integrations.github_repos
SET

WHERE
environment_id = '{{ environment_id }}' --required
AND project_id = '{{ project_id }}' --required
AND service_id = '{{ service_id }}' --required
RETURNING
result;

Lifecycle Methods​

Deploys a GitHub repo. Backed by the Railway GraphQL mutation githubRepoDeploy.

EXEC railway.integrations.github_repos.deploy
@project_id='{{ project_id }}', --required
@repo='{{ repo }}', --required
@branch='{{ branch }}',
@environment_id='{{ environment_id }}'
;