team_access_restrictions
Creates, updates, deletes, gets or lists a team_access_restrictions resource.
Overview
| Name | team_access_restrictions |
| Type | Resource |
| Id | github.repos.team_access_restrictions |
Fields
The following fields are returned by SELECT queries:
- get_teams_with_access_to_protected_branch
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
name | string | |
enterprise_id | integer | Unique identifier of the enterprise to which this team belongs |
node_id | string | |
organization_id | integer | Unique identifier of the organization to which this team belongs |
description | string | |
html_url | string (uri) | (example: https://github.com/orgs/rails/teams/core) |
members_url | string | |
notification_setting | string | |
parent | object | Groups of organization members that gives permissions on specified repositories. (title: Team Simple) |
permission | string | |
permissions | object | |
privacy | string | |
repositories_url | string (uri) | |
slug | string | |
type | string | The ownership type of the team (enterprise, organization) |
url | string (uri) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_teams_with_access_to_protected_branch | select | owner, repo, branch | Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation. Lists the teams who have push access to this branch. The list includes child teams. | |
add_team_access_restrictions | insert | owner, repo, branch, teams | Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation. Grants the specified teams push access for this branch. You can also give push access to child teams. | |
set_team_access_restrictions | replace | owner, repo, branch, teams | Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation. Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. | |
remove_team_access_restrictions | delete | owner, repo, branch | Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation. Removes the ability of a team to push to this branch. You can also remove push access for child teams. |
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 |
|---|---|---|
branch | string | The name of the branch. Cannot contain wildcard characters. To use wildcard characters in branch names, use the GraphQL API. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
SELECT examples
- get_teams_with_access_to_protected_branch
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Lists the teams who have push access to this branch. The list includes child teams.
SELECT
id,
name,
enterprise_id,
node_id,
organization_id,
description,
html_url,
members_url,
notification_setting,
parent,
permission,
permissions,
privacy,
repositories_url,
slug,
type,
url
FROM github.repos.team_access_restrictions
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND branch = '{{ branch }}' -- required
;
INSERT examples
- add_team_access_restrictions
- Manifest
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Grants the specified teams push access for this branch. You can also give push access to child teams.
INSERT INTO github.repos.team_access_restrictions (
teams,
owner,
repo,
branch
)
SELECT
'{{ teams }}' /* required */,
'{{ owner }}',
'{{ repo }}',
'{{ branch }}'
RETURNING
id,
name,
enterprise_id,
node_id,
organization_id,
description,
html_url,
members_url,
notification_setting,
parent,
permission,
permissions,
privacy,
repositories_url,
slug,
type,
url
;
# Description fields are for documentation purposes
- name: team_access_restrictions
props:
- name: owner
value: "{{ owner }}"
description: Required parameter for the team_access_restrictions resource.
- name: repo
value: "{{ repo }}"
description: Required parameter for the team_access_restrictions resource.
- name: branch
value: "{{ branch }}"
description: Required parameter for the team_access_restrictions resource.
- name: teams
value:
- "{{ teams }}"
description: |
The slug values for teams
REPLACE examples
- set_team_access_restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams.
REPLACE github.repos.team_access_restrictions
SET
teams = '{{ teams }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND branch = '{{ branch }}' --required
AND teams = '{{ teams }}' --required
RETURNING
id,
name,
enterprise_id,
node_id,
organization_id,
description,
html_url,
members_url,
notification_setting,
parent,
permission,
permissions,
privacy,
repositories_url,
slug,
type,
url;
DELETE examples
- remove_team_access_restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Removes the ability of a team to push to this branch. You can also remove push access for child teams.
DELETE FROM github.repos.team_access_restrictions
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND branch = '{{ branch }}' --required
;