From 249beacea3d23fbbb842f21b87a2c73f211a1d64 Mon Sep 17 00:00:00 2001 From: "lushirong.77" Date: Tue, 30 Jun 2026 16:14:55 +0800 Subject: [PATCH] docs(rest): note when commit comments may be disabled --- content/rest/commits/comments.md | 2 +- content/rest/guides/working-with-comments.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/content/rest/commits/comments.md b/content/rest/commits/comments.md index 5450f25bde18..d9c6b7532785 100644 --- a/content/rest/commits/comments.md +++ b/content/rest/commits/comments.md @@ -14,6 +14,6 @@ category: ## About commit comments -You can create, edit, and view commit comments using the REST API. A commit comment is a comment made on a specific commit. For more information, see [AUTOTITLE](/rest/guides/working-with-comments#commit-comments). +You can create, edit, and view commit comments using the REST API. A commit comment is a comment made on a specific commit. {% ifversion fpt or ghec or ghes > 3.21 %}For repositories that belong to organizations, commit comments can be disabled at the organization or repository level. If commit comments are disabled, people cannot create new commit comments, and requests to create a commit comment may return `403 Forbidden`. For more information, see [AUTOTITLE](/organizations/managing-organization-settings/managing-commit-comments-for-your-organization). {% endif %}For more information, see [AUTOTITLE](/rest/guides/working-with-comments#commit-comments). diff --git a/content/rest/guides/working-with-comments.md b/content/rest/guides/working-with-comments.md index 6aadd77186ab..fac2aa3db614 100644 --- a/content/rest/guides/working-with-comments.md +++ b/content/rest/guides/working-with-comments.md @@ -94,6 +94,10 @@ deal specifically with the way a particular change was implemented within a file The last type of comments occur specifically on individual commits. For this reason, they make use of [the endpoint to manage commit comments](/rest/commits#get-a-commit-comment). +{% ifversion fpt or ghec or ghes > 3.21 %} +For repositories that belong to organizations, commit comments can be disabled at the organization or repository level. If commit comments are disabled, people cannot create new commit comments, and requests to create a commit comment may return `403 Forbidden`. For more information, see [AUTOTITLE](/organizations/managing-organization-settings/managing-commit-comments-for-your-organization). +{% endif %} + To retrieve the comments on a commit, you'll want to use the SHA1 of the commit. In other words, you won't use any identifier related to the Pull Request. Here's an example: