repos_for_auth_user
Creates, updates, deletes, gets or lists a repos_for_auth_user resource.
Overview
| Name | repos_for_auth_user |
| Type | Resource |
| Id | github.repos.repos_for_auth_user |
Fields
The following fields are returned by SELECT queries:
- list_for_authenticated_user
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | Unique identifier of the repository |
name | string | The name of the repository. (example: Team Environment) |
node_id | string | (example: MDEwOlJlcG9zaXRvcnkxMjk2MjY5) |
full_name | string | (example: octocat/Hello-World) |
allow_auto_merge | boolean | Whether to allow Auto-merge to be used on pull requests. |
allow_forking | boolean | Whether to allow forking this repo |
allow_merge_commit | boolean | Whether to allow merge commits for pull requests. |
allow_rebase_merge | boolean | Whether to allow rebase merges for pull requests. |
allow_squash_merge | boolean | Whether to allow squash merges for pull requests. |
allow_update_branch | boolean | Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. |
anonymous_access_enabled | boolean | Whether anonymous git access is enabled for this repository |
archive_url | string | (example: http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}) |
archived | boolean | Whether the repository is archived. |
assignees_url | string | (example: http://api.github.com/repos/octocat/Hello-World/assignees{/user}) |
blobs_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}) |
branches_url | string | (example: http://api.github.com/repos/octocat/Hello-World/branches{/branch}) |
clone_url | string | (example: https://github.com/octocat/Hello-World.git) |
code_search_index_status | object | The status of the code search index for this repository |
collaborators_url | string | (example: http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}) |
comments_url | string | (example: http://api.github.com/repos/octocat/Hello-World/comments{/number}) |
commits_url | string | (example: http://api.github.com/repos/octocat/Hello-World/commits{/sha}) |
compare_url | string | (example: http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}) |
contents_url | string | (example: http://api.github.com/repos/octocat/Hello-World/contents/{+path}) |
contributors_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/contributors) |
created_at | string (date-time) | (example: 2011-01-26T19:01:12Z) |
default_branch | string | The default branch of the repository. (example: master) |
delete_branch_on_merge | boolean | Whether to delete head branches when pull requests are merged |
deployments_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/deployments) |
description | string | (example: This your first repo!) |
disabled | boolean | Returns whether or not this repository disabled. |
downloads_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/downloads) |
events_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/events) |
fork | boolean | |
forks | integer | |
forks_count | integer | |
forks_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/forks) |
git_commits_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}) |
git_refs_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}) |
git_tags_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}) |
git_url | string | (example: git:github.com/octocat/Hello-World.git) |
has_discussions | boolean | Whether discussions are enabled. |
has_downloads | boolean | Whether downloads are enabled. |
has_issues | boolean | Whether issues are enabled. |
has_pages | boolean | |
has_projects | boolean | Whether projects are enabled. |
has_pull_requests | boolean | Whether pull requests are enabled. |
has_wiki | boolean | Whether the wiki is enabled. |
homepage | string (uri) | (example: https://github.com) |
hooks_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/hooks) |
html_url | string (uri) | (example: https://github.com/octocat/Hello-World) |
is_template | boolean | Whether this repository acts as a template that can be used to generate new repositories. |
issue_comment_url | string | (example: http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}) |
issue_events_url | string | (example: http://api.github.com/repos/octocat/Hello-World/issues/events{/number}) |
issues_url | string | (example: http://api.github.com/repos/octocat/Hello-World/issues{/number}) |
keys_url | string | (example: http://api.github.com/repos/octocat/Hello-World/keys{/key_id}) |
labels_url | string | (example: http://api.github.com/repos/octocat/Hello-World/labels{/name}) |
language | string | |
languages_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/languages) |
license | object | License Simple (title: License Simple) |
master_branch | string | |
merge_commit_message | string | The default value for a merge commit message. - PR_TITLE - default to the pull request's title. - PR_BODY - default to the pull request's body. - BLANK - default to a blank commit message. (PR_BODY, PR_TITLE, BLANK) |
merge_commit_title | string | The default value for a merge commit title. - PR_TITLE - default to the pull request's title. - MERGE_MESSAGE - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). (PR_TITLE, MERGE_MESSAGE) |
merges_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/merges) |
milestones_url | string | (example: http://api.github.com/repos/octocat/Hello-World/milestones{/number}) |
mirror_url | string (uri) | (example: git:git.example.com/octocat/Hello-World) |
notifications_url | string | (example: http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}) |
open_issues | integer | |
open_issues_count | integer | |
owner | object | A GitHub user. (title: Simple User) |
permissions | object | |
private | boolean | Whether the repository is private or public. |
pull_request_creation_policy | string | The policy controlling who can create pull requests: all or collaborators_only. (all, collaborators_only) (example: all) |
pulls_url | string | (example: http://api.github.com/repos/octocat/Hello-World/pulls{/number}) |
pushed_at | string (date-time) | (example: 2011-01-26T19:06:43Z) |
releases_url | string | (example: http://api.github.com/repos/octocat/Hello-World/releases{/id}) |
size | integer | The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. |
squash_merge_commit_message | string | The default value for a squash merge commit message: - PR_BODY - default to the pull request's body. - COMMIT_MESSAGES - default to the branch's commit messages. - BLANK - default to a blank commit message. (PR_BODY, COMMIT_MESSAGES, BLANK) |
squash_merge_commit_title | string | The default value for a squash merge commit title: - PR_TITLE - default to the pull request's title. - COMMIT_OR_PR_TITLE - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). (PR_TITLE, COMMIT_OR_PR_TITLE) |
ssh_url | string | (example: git@github.com:octocat/Hello-World.git) |
stargazers_count | integer | |
stargazers_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/stargazers) |
starred_at | string | (example: "2020-07-09T00:17:42Z") |
statuses_url | string | (example: http://api.github.com/repos/octocat/Hello-World/statuses/{sha}) |
subscribers_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/subscribers) |
subscription_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/subscription) |
svn_url | string (uri) | (example: https://svn.github.com/octocat/Hello-World) |
tags_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/tags) |
teams_url | string (uri) | (example: http://api.github.com/repos/octocat/Hello-World/teams) |
temp_clone_token | string | |
topics | array | |
trees_url | string | (example: http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}) |
updated_at | string (date-time) | (example: 2011-01-26T19:14:43Z) |
url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World) |
use_squash_pr_title_as_default | boolean | Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use squash_merge_commit_title instead. |
visibility | string | The repository visibility: public, private, or internal. (default: public) |
watchers | integer | |
watchers_count | integer | |
web_commit_signoff_required | boolean | Whether to require contributors to sign off on web-based commits |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_for_authenticated_user | select | visibility, affiliation, type, sort, direction, per_page, page, since, before | Lists repositories that the authenticated user has explicit permission (:read, :write, or :admin) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. | |
create_for_authenticated_user | insert | name | Creates a new repository for the authenticated user. OAuth app tokens and personal access tokens (classic) need the public_repo or repo scope to create a public repository, and repo scope to create a private repository. |
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 |
|---|---|---|
affiliation | string | Comma-separated list of values. Can include: * owner: Repositories that are owned by the authenticated user. * collaborator: Repositories that the user has been added to as a collaborator. * organization_member: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. |
before | string (date-time) | Only show repositories updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. |
direction | string | The order to sort by. Default: asc when using full_name, otherwise desc. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
since | string (date-time) | Only show repositories updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. |
sort | string | The property to sort the results by. |
type | string | Limit results to repositories of the specified type. Will cause a 422 error if used in the same request as visibility or affiliation. |
visibility | string | Limit results to repositories with the specified visibility. |
SELECT examples
- list_for_authenticated_user
Lists repositories that the authenticated user has explicit permission (:read, :write, or :admin) to access.
The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.
SELECT
id,
name,
node_id,
full_name,
allow_auto_merge,
allow_forking,
allow_merge_commit,
allow_rebase_merge,
allow_squash_merge,
allow_update_branch,
anonymous_access_enabled,
archive_url,
archived,
assignees_url,
blobs_url,
branches_url,
clone_url,
code_search_index_status,
collaborators_url,
comments_url,
commits_url,
compare_url,
contents_url,
contributors_url,
created_at,
default_branch,
delete_branch_on_merge,
deployments_url,
description,
disabled,
downloads_url,
events_url,
fork,
forks,
forks_count,
forks_url,
git_commits_url,
git_refs_url,
git_tags_url,
git_url,
has_discussions,
has_downloads,
has_issues,
has_pages,
has_projects,
has_pull_requests,
has_wiki,
homepage,
hooks_url,
html_url,
is_template,
issue_comment_url,
issue_events_url,
issues_url,
keys_url,
labels_url,
language,
languages_url,
license,
master_branch,
merge_commit_message,
merge_commit_title,
merges_url,
milestones_url,
mirror_url,
notifications_url,
open_issues,
open_issues_count,
owner,
permissions,
private,
pull_request_creation_policy,
pulls_url,
pushed_at,
releases_url,
size,
squash_merge_commit_message,
squash_merge_commit_title,
ssh_url,
stargazers_count,
stargazers_url,
starred_at,
statuses_url,
subscribers_url,
subscription_url,
svn_url,
tags_url,
teams_url,
temp_clone_token,
topics,
trees_url,
updated_at,
url,
use_squash_pr_title_as_default,
visibility,
watchers,
watchers_count,
web_commit_signoff_required
FROM github.repos.repos_for_auth_user
WHERE visibility = '{{ visibility }}'
AND affiliation = '{{ affiliation }}'
AND type = '{{ type }}'
AND sort = '{{ sort }}'
AND direction = '{{ direction }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND since = '{{ since }}'
AND before = '{{ before }}'
;
INSERT examples
- create_for_authenticated_user
- Manifest
Creates a new repository for the authenticated user.
OAuth app tokens and personal access tokens (classic) need the public_repo or repo scope to create a public repository, and repo scope to create a private repository.
INSERT INTO github.repos.repos_for_auth_user (
name,
description,
homepage,
private,
has_issues,
has_projects,
has_wiki,
has_discussions,
team_id,
auto_init,
gitignore_template,
license_template,
allow_squash_merge,
allow_merge_commit,
allow_rebase_merge,
allow_auto_merge,
delete_branch_on_merge,
squash_merge_commit_title,
squash_merge_commit_message,
merge_commit_title,
merge_commit_message,
has_downloads,
is_template
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ homepage }}',
{{ private }},
{{ has_issues }},
{{ has_projects }},
{{ has_wiki }},
{{ has_discussions }},
{{ team_id }},
{{ auto_init }},
'{{ gitignore_template }}',
'{{ license_template }}',
{{ allow_squash_merge }},
{{ allow_merge_commit }},
{{ allow_rebase_merge }},
{{ allow_auto_merge }},
{{ delete_branch_on_merge }},
'{{ squash_merge_commit_title }}',
'{{ squash_merge_commit_message }}',
'{{ merge_commit_title }}',
'{{ merge_commit_message }}',
{{ has_downloads }},
{{ is_template }}
RETURNING
id,
name,
node_id,
full_name,
allow_auto_merge,
allow_forking,
allow_merge_commit,
allow_rebase_merge,
allow_squash_merge,
allow_update_branch,
anonymous_access_enabled,
archive_url,
archived,
assignees_url,
blobs_url,
branches_url,
clone_url,
code_of_conduct,
collaborators_url,
comments_url,
commits_url,
compare_url,
contents_url,
contributors_url,
created_at,
custom_properties,
default_branch,
delete_branch_on_merge,
deployments_url,
description,
disabled,
downloads_url,
events_url,
fork,
forks,
forks_count,
forks_url,
git_commits_url,
git_refs_url,
git_tags_url,
git_url,
has_discussions,
has_downloads,
has_issues,
has_pages,
has_projects,
has_pull_requests,
has_wiki,
homepage,
hooks_url,
html_url,
is_template,
issue_comment_url,
issue_events_url,
issues_url,
keys_url,
labels_url,
language,
languages_url,
license,
master_branch,
merge_commit_message,
merge_commit_title,
merges_url,
milestones_url,
mirror_url,
network_count,
notifications_url,
open_issues,
open_issues_count,
organization,
owner,
parent,
permissions,
private,
pull_request_creation_policy,
pulls_url,
pushed_at,
releases_url,
security_and_analysis,
size,
source,
squash_merge_commit_message,
squash_merge_commit_title,
ssh_url,
stargazers_count,
stargazers_url,
statuses_url,
subscribers_count,
subscribers_url,
subscription_url,
svn_url,
tags_url,
teams_url,
temp_clone_token,
template_repository,
topics,
trees_url,
updated_at,
url,
use_squash_pr_title_as_default,
visibility,
watchers,
watchers_count,
web_commit_signoff_required
;
# Description fields are for documentation purposes
- name: repos_for_auth_user
props:
- name: name
value: "{{ name }}"
description: |
The name of the repository.
- name: description
value: "{{ description }}"
description: |
A short description of the repository.
- name: homepage
value: "{{ homepage }}"
description: |
A URL with more information about the repository.
- name: private
value: {{ private }}
description: |
Whether the repository is private.
default: false
- name: has_issues
value: {{ has_issues }}
description: |
Whether issues are enabled.
default: true
- name: has_projects
value: {{ has_projects }}
description: |
Whether projects are enabled.
default: true
- name: has_wiki
value: {{ has_wiki }}
description: |
Whether the wiki is enabled.
default: true
- name: has_discussions
value: {{ has_discussions }}
description: |
Whether discussions are enabled.
default: false
- name: team_id
value: {{ team_id }}
description: |
The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization.
- name: auto_init
value: {{ auto_init }}
description: |
Whether the repository is initialized with a minimal README.
default: false
- name: gitignore_template
value: "{{ gitignore_template }}"
description: |
The desired language or platform to apply to the .gitignore.
- name: license_template
value: "{{ license_template }}"
description: |
The license keyword of the open source license for this repository.
- name: allow_squash_merge
value: {{ allow_squash_merge }}
description: |
Whether to allow squash merges for pull requests.
default: true
- name: allow_merge_commit
value: {{ allow_merge_commit }}
description: |
Whether to allow merge commits for pull requests.
default: true
- name: allow_rebase_merge
value: {{ allow_rebase_merge }}
description: |
Whether to allow rebase merges for pull requests.
default: true
- name: allow_auto_merge
value: {{ allow_auto_merge }}
description: |
Whether to allow Auto-merge to be used on pull requests.
default: false
- name: delete_branch_on_merge
value: {{ delete_branch_on_merge }}
description: |
Whether to delete head branches when pull requests are merged
default: false
- name: squash_merge_commit_title
value: "{{ squash_merge_commit_title }}"
description: |
Required when using `squash_merge_commit_message`.
The default value for a squash merge commit title:
- `PR_TITLE` - default to the pull request's title.
- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).
valid_values: ['PR_TITLE', 'COMMIT_OR_PR_TITLE']
- name: squash_merge_commit_message
value: "{{ squash_merge_commit_message }}"
description: |
The default value for a squash merge commit message:
- `PR_BODY` - default to the pull request's body.
- `COMMIT_MESSAGES` - default to the branch's commit messages.
- `BLANK` - default to a blank commit message.
valid_values: ['PR_BODY', 'COMMIT_MESSAGES', 'BLANK']
- name: merge_commit_title
value: "{{ merge_commit_title }}"
description: |
Required when using `merge_commit_message`.
The default value for a merge commit title.
- `PR_TITLE` - default to the pull request's title.
- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).
valid_values: ['PR_TITLE', 'MERGE_MESSAGE']
- name: merge_commit_message
value: "{{ merge_commit_message }}"
description: |
The default value for a merge commit message.
- `PR_TITLE` - default to the pull request's title.
- `PR_BODY` - default to the pull request's body.
- `BLANK` - default to a blank commit message.
valid_values: ['PR_BODY', 'PR_TITLE', 'BLANK']
- name: has_downloads
value: {{ has_downloads }}
description: |
Whether downloads are enabled.
default: true
- name: is_template
value: {{ is_template }}
description: |
Whether this repository acts as a template that can be used to generate new repositories.
default: false