openapi: 3.2.0
info:
title: Github Commits API
version: 1.1.4
license:
name: MIT
url: https://spdx.org/licenses/MIT
termsOfService: https://docs.github.com/articles/github-terms-of-service
description: 'Operations tagged Commits across 4 of this provider''s published API definitions: github-gists-openapi.yml, github-repo-branches-api-openapi.yml, github-repo-pulls-api-openapi.yml, github-repo-tags-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: '{protocol}://{hostname}/api/v3'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: HOSTNAME
protocol:
description: Self-hosted Enterprise Server protocol
default: http
- url: '{protocol}://{hostname}'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: api.github.com
protocol:
description: Self-hosted Enterprise Server protocol
default: https
tags:
- name: Commits
paths:
/gists/{gist_id}/commits:
get:
summary: GitHub List Gist Commits
description: This API endpoint retrieves the commit history for a specific GitHub Gist by making a GET request to /gists/{gist_id}/commits, where {gist_id} is the unique identifier of the Gist you want to query. The response returns a chronological list of all commits made to that Gist, including information such as the commit version, URL, user who made the commit, timestamp of when it was committed, and change statistics showing additions, deletions, and total changes. This is particularly useful for tracking the evolution of a Gist over time, auditing changes, or implementing version control features in applications that work with Gists, allowing developers to see who modified the content and when those modifications occurred.
tags:
- Commits
operationId: listGistCommits
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/gists/gists#list-gist-commits
parameters:
- $ref: '#/components/parameters/gist-id'
- $ref: '#/components/parameters/per-page'
- $ref: '#/components/parameters/page'
responses:
'200':
description: Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/gist-commit'
examples:
default:
$ref: '#/components/examples/gist-commit-items'
headers:
Link:
example: <https://api.github.com/resource?page=2>; rel="next"
schema:
type: string
'304':
$ref: '#/components/responses/not_modified'
'403':
$ref: '#/components/responses/forbidden'
'404':
$ref: '#/components/responses/not_found'
x-github:
githubCloudOnly: false
enabledForGitHubApps: false
category: gists
subcategory: gists
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
servers:
- url: '{protocol}://{hostname}/api/v3'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: HOSTNAME
protocol:
description: Self-hosted Enterprise Server protocol
default: http
/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures:
get:
summary: GitHub Get Commit Signature Protection
description: '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](https://docs.github.com/enterprise-server@3.9/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/enterprise-server@3.9/articles/signing-commits-with-gpg) in GitHub Help.
**Note**: You must enable branch protection to require signed commits.'
tags:
- Commits
operationId: getCommitSignatureProtection
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/branches/branch-protection#get-commit-signature-protection
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/repo'
- $ref: '#/components/parameters/branch'
- in: header
name: Authorization
schema:
type: string
example: example_value
- in: header
name: X-GitHub-Api-Version
schema:
type: string
default: '2022-11-28'
example: example_value
- in: header
name: Accept
schema:
type: string
default: application/vnd.github+json
example: example_value
responses:
'200':
description: Response
content:
application/json:
schema:
$ref: '#/components/schemas/protected-branch-admin-enforced'
examples:
default:
$ref: '#/components/examples/protected-branch-admin-enforced'
'404':
$ref: '#/components/responses/not_found'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: branches
subcategory: branch-protection
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
summary: GitHub Create Commit Signature Protection
description: '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](https://docs.github.com/enterprise-server@3.9/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.'
tags:
- Commits
operationId: createCommitSignatureProtection
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/branches/branch-protection#create-commit-signature-protection
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/repo'
- $ref: '#/components/parameters/branch'
- in: header
name: Authorization
schema:
type: string
example: example_value
- in: header
name: X-GitHub-Api-Version
schema:
type: string
default: '2022-11-28'
example: example_value
- in: header
name: Accept
schema:
type: string
default: application/vnd.github+json
example: example_value
responses:
'200':
description: Response
content:
application/json:
schema:
$ref: '#/components/schemas/protected-branch-admin-enforced'
examples:
default:
$ref: '#/components/examples/protected-branch-admin-enforced'
'404':
$ref: '#/components/responses/not_found'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: branches
subcategory: branch-protection
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
delete:
summary: GitHub Delete Commit Signature Protection
description: '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](https://docs.github.com/enterprise-server@3.9/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.'
tags:
- Commits
operationId: deleteCommitSignatureProtection
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/branches/branch-protection#delete-commit-signature-protection
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/repo'
- $ref: '#/components/parameters/branch'
- in: header
name: Authorization
schema:
type: string
example: example_value
- in: header
name: X-GitHub-Api-Version
schema:
type: string
default: '2022-11-28'
example: example_value
- in: header
name: Accept
schema:
type: string
default: application/vnd.github+json
example: example_value
responses:
'204':
description: Response
'404':
$ref: '#/components/responses/not_found'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: branches
subcategory: branch-protection
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
servers:
- url: '{protocol}://{hostname}'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: api.github.com
protocol:
description: Self-hosted Enterprise Server protocol
default: https
/repos/{owner}/{repo}/pulls/{pull_number}/commits:
get:
summary: GitHub List Commits on Pull Request
description: 'Lists a maximum of 250 commits for a pull request. To receive a complete
commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/enterprise-server@3.9/rest/commits/commits#list-commits)
endpoint.
This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body''s markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
- **`application/vnd.github.diff`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message.'
tags:
- Commits
operationId: listCommitsOnPullRequest
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/pulls/pulls#list-commits-on-a-pull-request
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/repo'
- $ref: '#/components/parameters/pull-number'
- $ref: '#/components/parameters/per-page'
- $ref: '#/components/parameters/page'
- in: header
name: Authorization
schema:
type: string
example: example_value
- in: header
name: X-GitHub-Api-Version
schema:
type: string
default: '2022-11-28'
example: example_value
- in: header
name: Accept
schema:
type: string
default: application/vnd.github+json
example: example_value
responses:
'200':
description: Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/commit'
examples:
default:
$ref: '#/components/examples/commit-items'
headers:
Link:
$ref: '#/components/headers/link'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: pulls
subcategory: pulls
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
servers:
- url: '{protocol}://{hostname}'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: api.github.com
protocol:
description: Self-hosted Enterprise Server protocol
default: https
/repos/{owner}/{repo}/comments:
get:
summary: GitHub List Commit Comments for Repository
description: 'Lists the commit comments for a specified repository. Comments are ordered by ascending ID.
This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body''s markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.'
tags:
- Commits
operationId: listCommitCommentsForRepository
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/commits/comments#list-commit-comments-for-a-repository
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/repo'
- $ref: '#/components/parameters/per-page'
- $ref: '#/components/parameters/page'
- in: header
name: Authorization
schema:
type: string
example: example_value
- in: header
name: X-GitHub-Api-Version
schema:
type: string
default: '2022-11-28'
example: example_value
- in: header
name: Accept
schema:
type: string
default: application/vnd.github+json
example: example_value
responses:
'200':
description: Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/commit-comment'
examples:
default:
$ref: '#/components/examples/commit-comment-items'
headers:
Link:
$ref: '#/components/headers/link'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: commits
subcategory: comments
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
servers:
- url: '{protocol}://{hostname}'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: api.github.com
protocol:
description: Self-hosted Enterprise Server protocol
default: https
/repos/{owner}/{repo}/comments/{comment_id}:
get:
summary: GitHub Get Commit Comment
description: 'Gets a specified commit comment.
This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body''s markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.'
tags:
- Commits
operationId: getCommitComment
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/commits/comments#get-a-commit-comment
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/repo'
- $ref: '#/components/parameters/comment-id'
- in: header
name: Authorization
schema:
type: string
example: example_value
- in: header
name: X-GitHub-Api-Version
schema:
type: string
default: '2022-11-28'
example: example_value
- in: header
name: Accept
schema:
type: string
default: application/vnd.github+json
example: example_value
responses:
'200':
description: Response
content:
application/json:
schema:
$ref: '#/components/schemas/commit-comment'
examples:
default:
$ref: '#/components/examples/commit-comment'
'404':
$ref: '#/components/responses/not_found'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: commits
subcategory: comments
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
patch:
summary: GitHub Update Commit Comment
description: 'Updates the contents of a specified commit comment.
This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body''s markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.'
tags:
- Commits
operationId: updateCommitComment
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/commits/comments#update-a-commit-comment
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/repo'
- $ref: '#/components/parameters/comment-id'
- in: header
name: Authorization
schema:
type: string
example: example_value
- in: header
name: X-GitHub-Api-Version
schema:
type: string
default: '2022-11-28'
example: example_value
- in: header
name: Accept
schema:
type: string
default: application/vnd.github+json
example: example_value
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
body:
type: string
description: The contents of the comment
required:
- body
examples:
default:
value:
body: Nice change
responses:
'200':
description: Response
content:
application/json:
schema:
$ref: '#/components/schemas/commit-comment'
examples:
default:
$ref: '#/components/examples/commit-comment-2'
'404':
$ref: '#/components/responses/not_found'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: commits
subcategory: comments
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
delete:
summary: GitHub Delete Commit Comment
description: This API endpoint allows users to permanently remove a commit comment from a GitHub repository by sending a DELETE request to the specified path with the repository owner, repository name, and comment ID as parameters. Once executed, the commit comment associated with the provided comment_id will be deleted from the repository, and this action cannot be undone. Authentication is required to perform this operation, and the user must have the appropriate permissions to delete comments in the specified repository.
tags:
- Commits
operationId: deleteCommitComment
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/commits/comments#delete-a-commit-comment
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/repo'
- $ref: '#/components/parameters/comment-id'
- in: header
name: Authorization
schema:
type: string
example: example_value
- in: header
name: X-GitHub-Api-Version
schema:
type: string
default: '2022-11-28'
example: example_value
- in: header
name: Accept
schema:
type: string
default: application/vnd.github+json
example: example_value
responses:
'204':
description: Response
'404':
$ref: '#/components/responses/not_found'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: commits
subcategory: comments
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
servers:
- url: '{protocol}://{hostname}'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: api.github.com
protocol:
description: Self-hosted Enterprise Server protocol
default: https
/repos/{owner}/{repo}/comments/{comment_id}/reactions:
get:
summary: GitHub List Reactions for Commit Comment
description: This API endpoint retrieves a list of reactions that have been added to a specific commit comment in a GitHub repository. By providing the repository owner, repository name, and comment ID in the path parameters, you can fetch all reactions (such as thumbs up, thumbs down, laugh, confused, heart, hooray, rocket, and eyes) that users have expressed on that particular commit comment. The response returns an array of reaction objects, each containing details about the reaction type, the user who created it, and when it was created. This endpoint supports pagination and requires appropriate authentication to access, following GitHub's standard API authentication mechanisms.
tags:
- Commits
operationId: listReactionsForCommitComment
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/reactions/reactions#list-reactions-for-a-commit-comment
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/repo'
- $ref: '#/components/parameters/comment-id'
- name: content
description: Returns a single [reaction type](https://docs.github.com/enterprise-server@3.9/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a commit comment.
in: query
required: false
schema:
type: string
enum:
- '+1'
- '-1'
- laugh
- confused
- heart
- hooray
- rocket
- eyes
example: '+1'
- $ref: '#/components/parameters/per-page'
- $ref: '#/components/parameters/page'
- in: header
name: Authorization
schema:
type: string
example: example_value
- in: header
name: X-GitHub-Api-Version
schema:
type: string
default: '2022-11-28'
example: example_value
- in: header
name: Accept
schema:
type: string
default: application/vnd.github+json
example: example_value
responses:
'200':
description: Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/reaction'
examples:
default:
$ref: '#/components/examples/reaction-items'
headers:
Link:
$ref: '#/components/headers/link'
'404':
$ref: '#/components/responses/not_found'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: reactions
subcategory: reactions
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
summary: GitHub Create Reaction for Commit Comment
description: Create a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.9/rest/commits/comments#get-a-commit-comment). response with an HTTP `200` status means that you already added the reaction type to this commit comment.
tags:
- Commits
operationId: createReactionForCommitComment
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/reactions/reactions#create-reaction-for-a-commit-comment
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/repo'
- $ref: '#/components/parameters/comment-id'
- in: header
name: Authorization
schema:
type: string
example: example_value
- in: header
name: X-GitHub-Api-Version
schema:
type: string
default: '2022-11-28'
example: example_value
- in: header
name: Accept
schema:
type: string
default: application/vnd.github+json
example: example_value
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
content:
type: string
description: The [reaction type](https://docs.github.com/enterprise-server@3.9/rest/reactions/reactions#about-reactions) to add to the commit comment.
enum:
- '+1'
- '-1'
- laugh
- confused
- heart
- hooray
- rocket
- eyes
required:
- content
examples:
default:
value:
content: heart
responses:
'200':
description: Reaction exists
content:
application/json:
schema:
$ref: '#/components/schemas/reaction'
examples:
default:
$ref: '#/components/examples/reaction'
'201':
description: Reaction created
content:
application/json:
schema:
$ref: '#/components/schemas/reaction'
examples:
default:
$ref: '#/components/examples/reaction'
'422':
$ref: '#/components/responses/validation_failed'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: reactions
subcategory: reactions
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
servers:
- url: '{protocol}://{hostname}'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: api.github.com
protocol:
description: Self-hosted Enterprise Server protocol
default: https
/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}:
delete:
summary: GitHub Delete Commit Comment Reaction
description: '**Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.
Delete a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.9/rest/commits/comments#get-a-commit-comment).'
tags:
- Commits
operationId: deleteCommitCommentReaction
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/reactions/reactions#delete-a-commit-comment-reaction
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/repo'
- $ref: '#/components/parameters/comment-id'
- $ref: '#/components/parameters/reaction-id'
- in: header
name: Authorization
schema:
type: string
example: example_value
- in: header
name: X-GitHub-Api-Version
schema:
type: string
default: '2022-11-28'
example: example_value
- in: header
name: Accept
schema:
type: string
default: application/vnd.github+json
example: example_value
responses:
'204':
description: Response
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: reactions
subcategory: reactions
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
servers:
- url: '{protocol}://{hostname}'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: api.github.com
protocol:
description: Self-hosted Enterprise Server protocol
default: https
/repos/{owner}/{repo}/commits:
g
# --- truncated at 32 KB (226 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/openapi/github-commits-api-openapi.yml