gitlab_applicationgitlab_branchgitlab_commitgitlab_epicgitlab_groupgitlab_group_access_requestgitlab_group_hookgitlab_group_iterationgitlab_group_membergitlab_group_projectgitlab_group_push_rulegitlab_group_subgroupgitlab_group_variablegitlab_hookgitlab_instance_variablegitlab_issuegitlab_merge_requestgitlab_merge_request_changegitlab_my_eventgitlab_my_issuegitlab_my_projectgitlab_projectgitlab_project_access_requestgitlab_project_container_registrygitlab_project_deploymentgitlab_project_iterationgitlab_project_jobgitlab_project_membergitlab_project_pages_domaingitlab_project_pipelinegitlab_project_pipeline_detailgitlab_project_protected_branchgitlab_project_repositorygitlab_project_repository_filegitlab_project_variablegitlab_settinggitlab_snippetgitlab_usergitlab_user_eventgitlab_version
Table: gitlab_branch
A branch is essentially a unique set of code changes with a unique name.
The gitlab_branch
table can be used to query information about any branch.
However, you must specify a project_id
in the where or join clause.
Examples
List branches
select *from gitlab_branchwhere project_id = 1;
Get branch information for a specific set of projects
select p.name as project_name, p.full_path as project_path, b.name as branch_name, b.default as is_default_branch, b.commit_short_id as commit_hashfrom gitlab_branch b inner join gitlab_my_project p on b.project_id = p.idwhere b.project_id in ( select id from gitlab_my_project where full_path like '%service%' );
Query examples
Schema for gitlab_branch
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
can_push | boolean | Indicates if the current user can push to this branch. | |
commit_date | timestamp with time zone | The date of the latest commit on the branch. | |
commit_email | text | The email address associated with the latest commit on the branch. | |
commit_id | text | The latest commit hash on the branch. | |
commit_message | text | The commit message associated with the latest commit on the branch. | |
commit_short_id | text | The latest short commit hash on the branch. | |
commit_title | text | The title of the latest commit on the branch. | |
commit_url | text | The url of the commit on the branch. | |
default | boolean | Indicates if the branch is the default branch of the project. | |
devs_can_merge | boolean | Indicates if users with the `developer` level of access can merge the branch. | |
devs_can_push | boolean | Indicates if users with the `developer` level of access can push to the branch. | |
merged | boolean | Indicates if the branch has been merged into the trunk. | |
name | text | = | The name of the branch. |
project_id | bigint | = | The ID of the project containing the branches - link to `gitlab_project.ID` |
protected | boolean | Indicates if the branch is protected or not. | |
web_url | text | The url of the branch. |