steampipe plugin install theapsgroup/gitlab

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_branch
where
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_hash
from
gitlab_branch b
inner join gitlab_my_project p on b.project_id = p.id
where
b.project_id in (
select
id
from
gitlab_my_project
where
full_path like '%service%'
);

Schema for gitlab_branch

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
can_pushbooleanIndicates if the current user can push to this branch.
commit_datetimestamp with time zoneThe date of the latest commit on the branch.
commit_emailtextThe email address associated with the latest commit on the branch.
commit_idtextThe latest commit hash on the branch.
commit_messagetextThe commit message associated with the latest commit on the branch.
commit_short_idtextThe latest short commit hash on the branch.
commit_titletextThe title of the latest commit on the branch.
commit_urltextThe url of the commit on the branch.
defaultbooleanIndicates if the branch is the default branch of the project.
devs_can_mergebooleanIndicates if users with the `developer` level of access can merge the branch.
devs_can_pushbooleanIndicates if users with the `developer` level of access can push to the branch.
mergedbooleanIndicates if the branch has been merged into the trunk.
nametext=The name of the branch.
project_idbigint=The ID of the project containing the branches - link to `gitlab_project.ID`
protectedbooleanIndicates if the branch is protected or not.
web_urltextThe url of the branch.