Repos

Interact with GitHub Repos.

Operations

MethodEndpointDescription
GET/orgs/{org}/reposList organization repositories
POST/orgs/{org}/reposCreate an organization repository
GET/orgs/{org}/rulesetsGet all organization repository rulesets
POST/orgs/{org}/rulesetsCreate an organization repository ruleset
GET/orgs/{org}/rulesets/rule-suitesList organization rule suites
GET/orgs/{org}/rulesets/rule-suites/{rule_suite_id}Get an organization rule suite
GET/orgs/{org}/rulesets/{ruleset_id}Get an organization repository ruleset
PUT/orgs/{org}/rulesets/{ruleset_id}Update an organization repository ruleset
DELETE/orgs/{org}/rulesets/{ruleset_id}Delete an organization repository ruleset
GET/repos/{owner}/{repo}Get a repository
PATCH/repos/{owner}/{repo}Update a repository
DELETE/repos/{owner}/{repo}Delete a repository
GET/repos/{owner}/{repo}/activityList repository activities
POST/repos/{owner}/{repo}/attestationsCreate an attestation
GET/repos/{owner}/{repo}/attestations/{subject_digest}List attestations
GET/repos/{owner}/{repo}/autolinksGet all autolinks of a repository
POST/repos/{owner}/{repo}/autolinksCreate an autolink reference for a repository
GET/repos/{owner}/{repo}/autolinks/{autolink_id}Get an autolink reference of a repository
DELETE/repos/{owner}/{repo}/autolinks/{autolink_id}Delete an autolink reference from a repository
GET/repos/{owner}/{repo}/automated-security-fixesCheck if Dependabot security updates are enabled for a repository
PUT/repos/{owner}/{repo}/automated-security-fixesEnable Dependabot security updates
DELETE/repos/{owner}/{repo}/automated-security-fixesDisable Dependabot security updates
GET/repos/{owner}/{repo}/branchesList branches
GET/repos/{owner}/{repo}/branches/{branch}Get a branch
GET/repos/{owner}/{repo}/branches/{branch}/protectionGet branch protection
PUT/repos/{owner}/{repo}/branches/{branch}/protectionUpdate branch protection
DELETE/repos/{owner}/{repo}/branches/{branch}/protectionDelete branch protection
GET/repos/{owner}/{repo}/branches/{branch}/protection/enforce_adminsGet admin branch protection
POST/repos/{owner}/{repo}/branches/{branch}/protection/enforce_adminsSet admin branch protection
DELETE/repos/{owner}/{repo}/branches/{branch}/protection/enforce_adminsDelete admin branch protection
GET/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviewsGet pull request review protection
PATCH/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviewsUpdate pull request review protection
DELETE/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviewsDelete pull request review protection
GET/repos/{owner}/{repo}/branches/{branch}/protection/required_signaturesGet commit signature protection
POST/repos/{owner}/{repo}/branches/{branch}/protection/required_signaturesCreate commit signature protection
DELETE/repos/{owner}/{repo}/branches/{branch}/protection/required_signaturesDelete commit signature protection
GET/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checksGet status checks protection
PATCH/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checksUpdate status check protection
DELETE/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checksRemove status check protection
GET/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contextsGet all status check contexts

The full set of 203 operations is in the API reference.

Example

List organization repositories, with the TypeScript SDK:

ts
import { GitHubV3REST } from "github";

const client = new GitHubV3REST({
  baseUrl: "https://api.github.com",
});

const result = await client.repos.listForOrg({
  org: "org",
});
console.log(result);
Nine more languages

The same call exists in every SDK. See SDKs for the other nine.