Search + K

Command Palette

Search for a command to run...

Sign In

Create a registration token for a repository

POST /repos/{owner}/{repo}/actions/runners/registration-token
Copy endpoint
https://api.github.com

Returns a token that you can pass to the config script. The token expires after one hour.

For example, you can replace TOKEN in the following example with the registration token provided by this endpoint to configure your self-hosted runner:

./config.sh --url https://github.com/octo-org --token TOKEN

Authenticated users must have admin access to the repository to use this endpoint.

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

path Path Parameters

Name Type
owner required

The account owner of the repository. The name is not case sensitive.

string
repo required

The name of the repository without the .git extension. The name is not case sensitive.

string

Responses

201 application/json

Response

interface AuthenticationToken {
token: string;
expires_at: string;
permissions?: {};
repositories?: Repository

A repository on GitHub.

interface Repository {
id: number;
node_id: string;
name: string;
full_name: string;
license: LicenseSimple | null;
forks: number;
permissions?: {
admin: boolean;
pull: boolean;
triage?: boolean;
push: boolean;
maintain?: boolean;
}
;
owner: SimpleUser;
private: boolean;
html_url: string;
description: string | null;
fork: boolean;
url: string;
archive_url: string;
assignees_url: string;
blobs_url: string;
branches_url: string;
collaborators_url: string;
comments_url: string;
commits_url: string;
compare_url: string;
contents_url: string;
contributors_url: string;
deployments_url: string;
downloads_url: string;
events_url: string;
forks_url: string;
git_commits_url: string;
git_refs_url: string;
git_tags_url: string;
git_url: string;
issue_comment_url: string;
issue_events_url: string;
issues_url: string;
keys_url: string;
labels_url: string;
languages_url: string;
merges_url: string;
milestones_url: string;
notifications_url: string;
pulls_url: string;
releases_url: string;
ssh_url: string;
stargazers_url: string;
statuses_url: string;
subscribers_url: string;
subscription_url: string;
tags_url: string;
teams_url: string;
trees_url: string;
clone_url: string;
mirror_url: string | null;
hooks_url: string;
svn_url: string;
homepage: string | null;
language: string | null;
forks_count: number;
stargazers_count: number;
watchers_count: number;
size: number;
default_branch: string;
open_issues_count: number;
is_template?: boolean;
topics?: string[];
has_issues: boolean;
has_projects: boolean;
has_wiki: boolean;
has_pages: boolean;
has_downloads: boolean;
has_discussions?: boolean;
archived: boolean;
disabled: boolean;
visibility?: string;
pushed_at: string | null;
created_at: string | null;
updated_at: string | null;
allow_rebase_merge?: boolean;
temp_clone_token?: string;
allow_squash_merge?: boolean;
allow_auto_merge?: boolean;
delete_branch_on_merge?: boolean;
allow_update_branch?: boolean;
use_squash_pr_title_as_default?: boolean;
squash_merge_commit_title?: "PR_TITLE" | "COMMIT_OR_PR_TITLE";
squash_merge_commit_message?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK";
merge_commit_title?: "PR_TITLE" | "MERGE_MESSAGE";
merge_commit_message?: "PR_BODY" | "PR_TITLE" | "BLANK";
allow_merge_commit?: boolean;
allow_forking?: boolean;
web_commit_signoff_required?: boolean;
open_issues: number;
watchers: number;
master_branch?: string;
starred_at?: string;
anonymous_access_enabled?: boolean;
code_search_index_status?: { lexical_search_ok?: boolean;lexical_commit_sha?: string; };
}
[]
;
single_file?: string | null;
repository_selection?: "all" | "selected";
}