github_repos
Creates, updates, deletes, gets or lists a github_repos resource.
Overview​
| Name | github_repos |
| Type | Resource |
| Id | railway.integrations.github_repos |
Fields​
The following fields are returned by SELECT queries:
- get
- list
One GitHubRepoWithoutInstallation row.
| Name | Datatype | Description |
|---|---|---|
id | integer | |
name | string | |
full_name | string | |
default_branch | string | |
description | string | |
is_private | boolean |
One row per GitHubRepo.
| Name | Datatype | Description |
|---|---|---|
id | integer | |
name | string | |
installation_id | string | |
full_name | string | |
default_branch | string | |
description | string | |
is_private | boolean | |
owner_avatar_url | string |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | full_repo_name | Checks if user has access to GitHub repository. Backed by the Railway GraphQL query githubRepo. | |
list | select | Get a list of repos for a user that Railway has access to. Backed by the Railway GraphQL query githubRepos. | ||
update | update | environment_id, project_id, service_id | Updates a GitHub repo through the linked template. Backed by the Railway GraphQL mutation githubRepoUpdate. | |
deploy | exec | project_id, repo | branch, environment_id | Deploys 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.
| Name | Datatype | Description |
|---|---|---|
full_repo_name | string | |
branch | string | |
environment_id | string | |
project_id | string | |
repo | string | |
service_id | string |
SELECT examples​
- get
- list
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
;
Get a list of repos for a user that Railway has access to. Backed by the Railway GraphQL query githubRepos.
SELECT
id,
name,
installation_id,
full_name,
default_branch,
description,
is_private,
owner_avatar_url
FROM railway.integrations.github_repos
;
UPDATE examples​
- update
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​
- deploy
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 }}'
;