Skip to content

Commit dff608c

Browse files
authored
Merge branch 'main' into all-contributors/add-jeffmcaffer
2 parents d5d7663 + 5ac92c8 commit dff608c

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## GitHub Docs <!-- omit in toc -->
22

3-
This repository contains the documentation website code and Markdown source files for docs.github.com.
3+
This repository contains the documentation website code and Markdown source files for [docs.github.com](https://docs.github.com).
44

55
GitHub's Docs team works on pre-production content in a private repo that regularly syncs with this public repo.
66

content/packages/publishing-and-managing-packages/about-github-packages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ For more information, see:
185185

186186
### Managing packages
187187

188-
You can a delete a version of a private package on {% data variables.product.product_name %} or using the GraphQL API. When you use the GraphQL API to query and delete private packages, you must use the same token you use to authenticate to {% data variables.product.prodname_registry %}. For more information, see "[Deleting a package](/packages/publishing-and-managing-packages/deleting-a-package)" and "[Forming calls with GraphQL](/v4/guides/forming-calls/)."
188+
You can delete a version of a private package on {% data variables.product.product_name %} or using the GraphQL API. When you use the GraphQL API to query and delete private packages, you must use the same token you use to authenticate to {% data variables.product.prodname_registry %}. For more information, see "[Deleting a package](/packages/publishing-and-managing-packages/deleting-a-package)" and "[Forming calls with GraphQL](/v4/guides/forming-calls/)."
189189

190190
You can configure webhooks to subscribe to package-related events, such as when a package is published or updated. For more information, see the "[`package` webhook event](/webhooks/event-payloads/#package)."
191191

content/rest/overview/endpoints-available-for-github-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ versions:
1111

1212
You must use an installation access token to access endpoints using your {% data variables.product.prodname_github_app %}. For more information, see "[Authenticating with {% data variables.product.prodname_github_apps %}](/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation)."
1313

14-
{% for thing in rest.operationsEnabledForApps[currentVersion] %}
14+
{% for thing in rest.operationsEnabledForGitHubApps[currentVersion] %}
1515
{% assign category = thing[0] %}
1616
{% assign operations = thing[1] %}
1717
{% if operations.size > 0 %}

lib/rest.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
const { chain, get, union, flatten, groupBy } = require('lodash')
22
const { supported } = require('./enterprise-server-releases')
33
const operations = require('@github/rest-api-operations')
4-
// TODO need to update this to the new versions in coordination with openAPI
5-
const { oldVersions } = require('./old-versions-utils')
6-
const allVersions = oldVersions
4+
const { getOldVersionFromNewVersion } = require('./old-versions-utils')
5+
const allVersions = Object.keys(require('./all-versions'))
76

87
// This list is generated for use in the tests,
98
// so we can verify that the names of the markdown files
@@ -18,16 +17,16 @@ const categories = union(dotcomCategories, enterpriseCategories)
1817

1918
// Attach convenience properties to each operation that can't easily be created in Liquid
2019
allVersions.forEach(currentVersion => {
21-
operations[currentVersion].forEach(operation => {
20+
operations[getOldVersionFromNewVersion(currentVersion)].forEach(operation => {
2221
operation.hasRequiredPreviews = get(operation, 'x-github.previews', []).some(preview => preview.required)
2322
})
2423
})
2524

26-
// This is a collection of operations that have `enabledForApps = true`
25+
// This is a collection of operations that have `enabledForGitHubApps = true`
2726
// It's grouped by resource title to make rendering easier
28-
const operationsEnabledForApps = allVersions.reduce((acc, currentVersion) => {
29-
acc[currentVersion] = chain(operations[currentVersion] || [])
30-
.filter(operation => operation['x-github'].enabledForApps)
27+
const operationsEnabledForGitHubApps = allVersions.reduce((acc, currentVersion) => {
28+
acc[currentVersion] = chain(operations[getOldVersionFromNewVersion(currentVersion)] || [])
29+
.filter(operation => operation['x-github'].enabledForGitHubApps)
3130
.orderBy('category')
3231
.value()
3332
acc[currentVersion] = groupBy(acc[currentVersion], 'category')
@@ -37,5 +36,5 @@ const operationsEnabledForApps = allVersions.reduce((acc, currentVersion) => {
3736
module.exports = {
3837
categories,
3938
operations,
40-
operationsEnabledForApps
39+
operationsEnabledForGitHubApps
4140
}

tests/rendering/rest.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ describe('REST references docs', () => {
4040
expect(operation.description).toContain('GitHub Enterprise')
4141
})
4242

43+
test('loads operations enabled for GitHub Apps', async () => {
44+
const operations = await getJSON('/en/free-pro-team@latest/rest/overview/endpoints-available-for-github-apps?json=rest.operationsEnabledForGitHubApps')
45+
expect(operations['free-pro-team@latest'].actions.length).toBeGreaterThan(0)
46+
expect(operations['enterprise-server@2.22'].actions.length).toBeGreaterThan(0)
47+
})
48+
4349
test('no wrongly detected AppleScript syntax highlighting in schema data', async () => {
4450
const { operations } = require('../../lib/rest')
4551
expect(JSON.stringify(operations).includes('hljs language-applescript')).toBe(false)

0 commit comments

Comments
 (0)