diff --git a/docs/codesOfConduct/getForRepo.md b/docs/codesOfConduct/getForRepo.md index 0dcd945a2..13fa1a82c 100644 --- a/docs/codesOfConduct/getForRepo.md +++ b/docs/codesOfConduct/getForRepo.md @@ -8,7 +8,9 @@ type: API method # Get the code of conduct for a repository -This method returns the contents of the repository's code of conduct file, if one is detected. +Returns the contents of the repository's code of conduct file, if one is detected. + +A code of conduct is detected if there is a file named `CODE_OF_CONDUCT` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. ```js octokit.codesOfConduct.getForRepo({ diff --git a/docs/repos/getCommunityProfileMetrics.md b/docs/repos/getCommunityProfileMetrics.md index b55e287ea..7cda38aea 100644 --- a/docs/repos/getCommunityProfileMetrics.md +++ b/docs/repos/getCommunityProfileMetrics.md @@ -13,6 +13,12 @@ overall health score, repository description, the presence of documentation, det code of conduct, detected license, and the presence of ISSUE_TEMPLATE, PULL_REQUEST_TEMPLATE, README, and CONTRIBUTING files. +The `health_percentage` score is defined as a percentage of how many of +these four documents are present: README, CONTRIBUTING, LICENSE, and +CODE_OF_CONDUCT. For example, if all four documents are present, then +the `health_percentage` is `100`. If only one is present, then the +`health_percentage` is `25`. + `content_reports_enabled` is only returned for organization-owned repositories. ```js diff --git a/scripts/update-endpoints/generated/endpoints.json b/scripts/update-endpoints/generated/endpoints.json index ce8f455cb..3a67b1e93 100644 --- a/scripts/update-endpoints/generated/endpoints.json +++ b/scripts/update-endpoints/generated/endpoints.json @@ -10559,7 +10559,7 @@ "url": "/repos/{owner}/{repo}/community/code_of_conduct", "isDeprecated": false, "deprecationDate": null, - "description": "This method returns the contents of the repository's code of conduct file, if one is detected.", + "description": "Returns the contents of the repository's code of conduct file, if one is detected.\n\nA code of conduct is detected if there is a file named `CODE_OF_CONDUCT` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching.", "documentationUrl": "https://docs.github.com/v3/codes_of_conduct/#get-the-code-of-conduct-for-a-repository", "previews": [{ "name": "scarlet-witch" }], "headers": [], @@ -35073,7 +35073,7 @@ "url": "/repos/{owner}/{repo}/community/profile", "isDeprecated": false, "deprecationDate": null, - "description": "This endpoint will return all community profile metrics, including an\noverall health score, repository description, the presence of documentation, detected\ncode of conduct, detected license, and the presence of ISSUE\\_TEMPLATE, PULL\\_REQUEST\\_TEMPLATE,\nREADME, and CONTRIBUTING files.\n\n`content_reports_enabled` is only returned for organization-owned repositories.", + "description": "This endpoint will return all community profile metrics, including an\noverall health score, repository description, the presence of documentation, detected\ncode of conduct, detected license, and the presence of ISSUE\\_TEMPLATE, PULL\\_REQUEST\\_TEMPLATE,\nREADME, and CONTRIBUTING files.\n\nThe `health_percentage` score is defined as a percentage of how many of\nthese four documents are present: README, CONTRIBUTING, LICENSE, and\nCODE_OF_CONDUCT. For example, if all four documents are present, then\nthe `health_percentage` is `100`. If only one is present, then the\n`health_percentage` is `25`.\n\n`content_reports_enabled` is only returned for organization-owned repositories.", "documentationUrl": "https://docs.github.com/rest/reference/repos#get-community-profile-metrics", "previews": [], "headers": [], diff --git a/src/generated/method-types.ts b/src/generated/method-types.ts index a4d196e0b..be9dfc158 100644 --- a/src/generated/method-types.ts +++ b/src/generated/method-types.ts @@ -2166,7 +2166,9 @@ export type RestEndpointMethods = { endpoint: EndpointInterface<{ url: string }>; }; /** - * This method returns the contents of the repository's code of conduct file, if one is detected. + * Returns the contents of the repository's code of conduct file, if one is detected. + * + * A code of conduct is detected if there is a file named `CODE_OF_CONDUCT` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. */ getForRepo: { ( @@ -5958,6 +5960,12 @@ export type RestEndpointMethods = { * code of conduct, detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE, * README, and CONTRIBUTING files. * + * The `health_percentage` score is defined as a percentage of how many of + * these four documents are present: README, CONTRIBUTING, LICENSE, and + * CODE_OF_CONDUCT. For example, if all four documents are present, then + * the `health_percentage` is `100`. If only one is present, then the + * `health_percentage` is `25`. + * * `content_reports_enabled` is only returned for organization-owned repositories. */ getCommunityProfileMetrics: {