Skip to content

Commit 9a3bc79

Browse files
authored
Merge pull request #36787 from github/repo-sync
Repo sync
2 parents b871d8e + 3a878ba commit 9a3bc79

File tree

14 files changed

+441
-12
lines changed

14 files changed

+441
-12
lines changed
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 'Check article-api docs'
2+
3+
# **What it does**: Makes sure changes to the article api are documented.
4+
# **Why we have it**: So what's documented doesn't fall behind
5+
# **Who does it impact**: Docs engineering, CGS team
6+
7+
on:
8+
workflow_dispatch:
9+
pull_request:
10+
paths:
11+
- 'src/article-api/middleware/article.ts'
12+
- 'src/article-api/middleware/pagelist.ts'
13+
# Self-test
14+
- .github/workflows/article-api-docs.yml
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
check-content-linter-rules-docs:
21+
runs-on: ${{ fromJSON('["ubuntu-latest", "ubuntu-20.04-xl"]')[github.repository == 'github/docs-internal'] }}
22+
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
26+
27+
- uses: ./.github/actions/node-npm-setup
28+
29+
- name: Check that src/article-api/README.md is up-to-date
30+
run: npm run generate-article-api-docs
31+
32+
- name: Fail if it isn't up-to-date
33+
run: |
34+
if [ -n "$(git status --porcelain)" ]; then
35+
git status
36+
git diff
37+
38+
# Some whitespace for the sake of the message below
39+
echo ""
40+
echo ""
41+
42+
echo "src/article-api/README.md is out of date."
43+
echo "Please run 'npm run generate-article-api-docs' and commit the changes."
44+
exit 1;
45+
fi

.github/workflows/first-responder-v2-prs-collect.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ jobs:
7171
env:
7272
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7373
run: |
74-
ISSUE_NUMS=$(echo "${{ github.event.pull_request.body }}" | grep -oE '#[0-9]+' | tr -d '#')
74+
ISSUE_NUMS=$(echo "${{ github.event.pull_request.body }}" | grep -oE '(https://github.com/github/docs-content/issues/[0-9]+|#[0-9]+)' | grep -oE '[0-9]+')
7575
for ISSUE_NUM in $ISSUE_NUMS; do
76-
LABELS=$(gh issue view $ISSUE_NUM --json labels --jq '.labels[].name')
76+
LABELS=$(gh issue view $ISSUE_NUM --repo github/docs-content --json labels --jq '.labels[].name')
7777
if echo "$LABELS" | grep -q 'DIY docs'; then
7878
echo "DIY_DOCS_LABEL=true" >> $GITHUB_ENV
7979
break

content/admin/managing-iam/provisioning-user-accounts-with-scim/user-provisioning-with-scim-on-ghes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ When SCIM is enabled, you will no longer be able to delete, suspend, or promote
7171

7272
If you currently use SAML SSO, and you are enabling SCIM, you should be aware of what happens to existing users during SCIM provisioning.
7373

74-
* When SCIM is enabled, users with SAML-linked identities will **not be able to sign in** until their identities have been provisioned by SCIM.
74+
* When SCIM is enabled, users with SAML-linked identities will **not be able to sign in** until their identities have been provisioned by SCIM.{% ifversion scim-for-ghes-ga %} You will no longer be able to update the SAML `NameID` of existing users in the site admin dashboard.{% endif %}
7575
* When your instance receives a SCIM request, SCIM identities are matched to existing users by **comparing the `userName` SCIM field with the {% data variables.product.prodname_dotcom %} username**. If a user with a matching username doesn't exist, {% data variables.product.prodname_dotcom %} creates a new user.
7676
* If {% data variables.product.prodname_dotcom %} successfully identifies a user from the IdP, but account details such as email address, first name, or last name don't match, the instance **overwrites the details** with values from the IdP. Any email addresses other than the primary email provisioned by SCIM will also be deleted from the user account.
7777

content/admin/managing-iam/using-saml-for-enterprise-iam/updating-a-users-saml-nameid.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ In some situations, you may need to update values associated with a person's acc
2121

2222
To update user SAML `NameID` mappings in bulk, you can use the `ghe-saml-mapping-csv` command. For more information, see [AUTOTITLE](/admin/administering-your-instance/administering-your-instance-from-the-command-line/command-line-utilities#ghe-saml-mapping-csv).
2323

24+
{% ifversion scim-for-ghes-ga %}
25+
When SCIM is enabled on your {% data variables.product.prodname_ghe_server %} instance, you cannot update user SAML `NameID` mappings.
26+
{% endif %}
27+
2428
## Updating a user's SAML `NameID`
2529

2630
Enterprise owners can update a user's SAML `NameID` on a {% data variables.product.github %} instance.

content/codespaces/developing-in-a-codespace/opening-an-existing-codespace.md

-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ You can bookmark the address of this page if you want to get back to it quickly
6262
1. Click **Open in**.
6363
1. Click **Open in APPLICATION**.
6464

65-
![Screenshot of the "Open in" dialog, with "Open in {% data variables.product.prodname_vscode %}" highlighted.](/assets/images/help/codespaces/open-codespace-in-another-editor.png)
66-
6765
You can open the codespace in:
6866
* Your browser
6967
* {% data variables.product.prodname_vscode %}

content/codespaces/setting-your-user-preferences/setting-your-default-editor-for-github-codespaces.md

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ If you want to use {% data variables.product.prodname_vscode %} as your default
2929
{% data reusables.user-settings.codespaces-tab %}
3030
1. Under "Editor preference", select the option you want.
3131

32-
![Screenshot of the "Editor preference" options, with "{% data variables.product.prodname_vscode %} for Web" selected.](/assets/images/help/codespaces/select-default-editor.png)
33-
3432
* {% data reusables.codespaces.application-installed-locally %}<br><br>
3533

3634
* If you choose **{% data variables.product.prodname_vscode %}**, {% data variables.product.prodname_github_codespaces %} will automatically open in the desktop application when you next create or open a codespace.

content/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ When you add an issue type to an issue, the type will be shown on any lists of i
2525
1. Under "Type name", type the name of your new issue type.
2626
1. Under "Description", to help other people understand the purpose of your new issue type, type a description.
2727
1. Under "Color", click on the color you would like for the new issue type.
28-
1. Optionally, to stop the new issue type being available in public repositories, select **Private repositories only**.
2928
1. Click **Create**.
3029

3130
## Making changes to issue types
3231

33-
You can change the name, description, color, and public repository visibility of your issue types.
32+
You can change the name, description, and color of your issue types.
3433

3534
You can also choose to disable or delete an issue type. If you disable an issue type, it will not be shown and it won't be possible to set an issue to that type, but if you later decide to enable the issue type, it will be displayed again on any issues previously set to the issue type. If you delete an issue type, it is permanently removed.
3635

@@ -40,5 +39,5 @@ You can also choose to disable or delete an issue type. If you disable an issue
4039
![Screenshot of the issue types settings page for an organization. The "open type options" button is highlighted with an orange rectangle.](/assets/images/help/issues/issue-type-edit.png)
4140

4241
1. In the menu, click **Edit** and make your changes.
43-
* To make changes to the type name, description, color, and if the issue type should only appear for private repositories. Then click **Save**.
42+
* To make changes to the type name, description, or color, click **Save**.
4443
* To disable or delete the issue type, in the "Danger zone", click **Disable** or **Delete** and follow the prompts.

data/features/scim-for-ghes-ga.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 16433
2+
# SCIM for GitHub Enterprise Server, GA
3+
4+
versions:
5+
ghes: '>=3.17'
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
If you choose **{% data variables.product.prodname_vscode %}**, you must make sure you have installed the selected application on your local machine.
1+
If you choose **{% data variables.product.prodname_vscode %}**, you must make sure you have {% data variables.product.prodname_vscode_shortname %} installed on your local machine.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"lint-content": "tsx src/content-linter/scripts/lint-content.js",
5858
"lint-translation": "vitest src/content-linter/tests/lint-files.js",
5959
"liquid-markdown-tables": "tsx src/tools/scripts/liquid-markdown-tables/index.ts",
60+
"generate-article-api-docs": "tsx src/article-api/scripts/generate-api-docs.ts",
6061
"generate-code-scanning-query-list": "tsx src/code-scanning/scripts/generate-code-scanning-query-list.ts",
6162
"generate-content-linter-docs": "tsx src/content-linter/scripts/generate-docs.ts",
6263
"move-content": "tsx src/content-render/scripts/move-content.js",

src/article-api/README.md

+125
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,128 @@ The `/api/article` endpoints return information about a page by `pathname`.
2222
For internal folks ask in the Docs Engineering slack channel.
2323

2424
For open source folks, please open a discussion in the public repository.
25+
26+
<!-- API reference docs automatically generated, do not edit below this comment -->
27+
## Reference: API endpoints
28+
29+
### GET /api/article/
30+
31+
Get article metadata and content in a single object. Equivalent to calling `/article/meta` concatenated with `/article/body`.
32+
33+
**Parameters**:
34+
- **pathname** (string) - Article path (e.g. '/en/get-started/article-name')
35+
36+
**Returns**: (object) - JSON object with article metadata and content (`meta` and `body` keys)
37+
38+
**Throws**:
39+
- (Error): 403 - If the article body cannot be retrieved. Reason is given in the error message.
40+
- (Error): 400 - If pathname parameter is invalid.
41+
- (Error): 404 - If the path is valid, but the page couldn't be resolved.
42+
43+
**Example**:
44+
```
45+
❯ curl -s "https://docs.github.com/api/article?pathname=/en/get-started/start-your-journey/about-github-and-git"
46+
{
47+
"meta": {
48+
"title": "About GitHub and Git",
49+
"intro": "You can use GitHub and Git to collaborate on work.",
50+
"product": "Get started"
51+
},
52+
"body": "## About GitHub\n\nGitHub is a cloud-based platform where you can store, share, and work together with others to write code.\n\nStoring your code in a \"repository\" on GitHub allows you to:\n\n* **Showcase or share** your work.\n [...]"
53+
}
54+
```
55+
56+
---
57+
58+
### GET /api/article/body
59+
60+
Get the contents of an article's body.
61+
62+
**Parameters**:
63+
- **pathname** (string) - Article path (e.g. '/en/get-started/article-name')
64+
65+
**Returns**: (string) - Article body content in markdown format.
66+
67+
**Throws**:
68+
- (Error): 403 - If the article body cannot be retrieved. Reason is given in the error message.
69+
- (Error): 400 - If pathname parameter is invalid.
70+
- (Error): 404 - If the path is valid, but the page couldn't be resolved.
71+
72+
**Example**:
73+
```
74+
❯ curl -s https://docs.github.com/api/article/body\?pathname=/en/get-started/start-your-journey/about-github-and-git
75+
## About GitHub
76+
77+
GitHub is a cloud-based platform where you can store, share, and work together with others to write code.
78+
79+
Storing your code in a "repository" on GitHub allows you to:
80+
[...]
81+
```
82+
83+
---
84+
85+
### GET /api/article/meta
86+
87+
Get metadata about an article.
88+
89+
**Parameters**:
90+
- **pathname** (string) - Article path (e.g. '/en/get-started/article-name')
91+
92+
**Returns**: (object) - JSON object containing article metadata with title, intro, and product information.
93+
94+
**Throws**:
95+
- (Error): 400 - If pathname parameter is invalid.
96+
- (Error): 404 - If the path is valid, but the page couldn't be resolved.
97+
98+
**Example**:
99+
```
100+
❯ curl -s "https://docs.github.com/api/article/meta?pathname=/en/get-started/start-your-journey/about-github-and-git"
101+
{
102+
"title": "About GitHub and Git",
103+
"intro": "You can use GitHub and Git to collaborate on work.",
104+
"product": "Get started",
105+
"breadcrumbs": [
106+
{
107+
"href": "/en/get-started",
108+
"title": "Get started"
109+
},
110+
{
111+
"href": "/en/get-started/start-your-journey",
112+
"title": "Start your journey"
113+
},
114+
{
115+
"href": "/en/get-started/start-your-journey/about-github-and-git",
116+
"title": "About GitHub and Git"
117+
}
118+
]
119+
}
120+
```
121+
122+
---
123+
124+
### GET /api/pagelist/:lang/:productVersion
125+
126+
A list of pages available for a fully qualified path containing the target language and product version.
127+
128+
**Parameters**:
129+
- **lang** (string) - Path parameter for language code (e.g. 'en')
130+
- **productVersion** (string) - Path parameter for product version (e.g. 'free-pro-team@latest')
131+
132+
**Returns**: (string) - List of paths matching the language and version
133+
134+
**Throws**:
135+
- (Error): 400 - If language or version parameters are invalid. Reason is given in the error message.
136+
137+
**Example**:
138+
```
139+
❯ curl -s https://docs.github.com/api/pagelist/en/free-pro-team@latest
140+
/en
141+
/en/search
142+
/en/get-started
143+
/en/get-started/start-your-journey
144+
/en/get-started/start-your-journey/about-github-and-git
145+
[...]
146+
```
147+
148+
---
149+

src/article-api/middleware/article.ts

+65
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,25 @@ const router = express.Router()
2020
// - pathValidationMiddleware ensures the path is properly structured and handles errors when it's not
2121
// - pageValidationMiddleware fetches the page from the pagelist, returns 404 to the user if not found
2222

23+
/**
24+
* Get article metadata and content in a single object. Equivalent to calling `/article/meta` concatenated with `/article/body`.
25+
* @route GET /api/article
26+
* @param {string} pathname - Article path (e.g. '/en/get-started/article-name')
27+
* @returns {object} JSON object with article metadata and content (`meta` and `body` keys)
28+
* @throws {Error} 403 - If the article body cannot be retrieved. Reason is given in the error message.
29+
* @throws {Error} 400 - If pathname parameter is invalid.
30+
* @throws {Error} 404 - If the path is valid, but the page couldn't be resolved.
31+
* @example
32+
* ❯ curl -s "https://docs.github.com/api/article?pathname=/en/get-started/start-your-journey/about-github-and-git"
33+
* {
34+
* "meta": {
35+
* "title": "About GitHub and Git",
36+
* "intro": "You can use GitHub and Git to collaborate on work.",
37+
* "product": "Get started"
38+
* },
39+
* "body": "## About GitHub\n\nGitHub is a cloud-based platform where you can store, share, and work together with others to write code.\n\nStoring your code in a \"repository\" on GitHub allows you to:\n\n* **Showcase or share** your work.\n [...]"
40+
* }
41+
*/
2342
router.get(
2443
'/',
2544
pathValidationMiddleware as RequestHandler,
@@ -43,6 +62,23 @@ router.get(
4362
}),
4463
)
4564

65+
/**
66+
* Get the contents of an article's body.
67+
* @route GET /api/article/body
68+
* @param {string} pathname - Article path (e.g. '/en/get-started/article-name')
69+
* @returns {string} Article body content in markdown format.
70+
* @throws {Error} 403 - If the article body cannot be retrieved. Reason is given in the error message.
71+
* @throws {Error} 400 - If pathname parameter is invalid.
72+
* @throws {Error} 404 - If the path is valid, but the page couldn't be resolved.
73+
* @example
74+
* ❯ curl -s https://docs.github.com/api/article/body\?pathname=/en/get-started/start-your-journey/about-github-and-git
75+
* ## About GitHub
76+
*
77+
* GitHub is a cloud-based platform where you can store, share, and work together with others to write code.
78+
*
79+
* Storing your code in a "repository" on GitHub allows you to:
80+
* [...]
81+
*/
4682
router.get(
4783
'/body',
4884
pathValidationMiddleware as RequestHandler,
@@ -62,6 +98,35 @@ router.get(
6298
}),
6399
)
64100

101+
/**
102+
* Get metadata about an article.
103+
* @route GET /api/article/meta
104+
* @param {string} pathname - Article path (e.g. '/en/get-started/article-name')
105+
* @returns {object} JSON object containing article metadata with title, intro, and product information.
106+
* @throws {Error} 400 - If pathname parameter is invalid.
107+
* @throws {Error} 404 - If the path is valid, but the page couldn't be resolved.
108+
* @example
109+
* ❯ curl -s "https://docs.github.com/api/article/meta?pathname=/en/get-started/start-your-journey/about-github-and-git"
110+
* {
111+
* "title": "About GitHub and Git",
112+
* "intro": "You can use GitHub and Git to collaborate on work.",
113+
* "product": "Get started",
114+
* "breadcrumbs": [
115+
* {
116+
* "href": "/en/get-started",
117+
* "title": "Get started"
118+
* },
119+
* {
120+
* "href": "/en/get-started/start-your-journey",
121+
* "title": "Start your journey"
122+
* },
123+
* {
124+
* "href": "/en/get-started/start-your-journey/about-github-and-git",
125+
* "title": "About GitHub and Git"
126+
* }
127+
* ]
128+
* }
129+
*/
65130
router.get(
66131
'/meta',
67132
pathValidationMiddleware as RequestHandler,

src/article-api/middleware/pagelist.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,22 @@ router.get(
4444
}),
4545
)
4646

47-
// for a fully qualified path with language and product version, we'll serve up the pagelist
47+
/**
48+
* A list of pages available for a fully qualified path containing the target language and product version.
49+
* @route GET /api/pagelist
50+
* @param {string} lang - Path parameter for language code (e.g. 'en')
51+
* @param {string} productVersion - Path parameter for product version (e.g. 'free-pro-team@latest')
52+
* @returns {string} List of paths matching the language and version
53+
* @throws {Error} 400 - If language or version parameters are invalid. Reason is given in the error message.
54+
* @example
55+
* ❯ curl -s https://docs.github.com/api/pagelist/en/free-pro-team@latest
56+
* /en
57+
* /en/search
58+
* /en/get-started
59+
* /en/get-started/start-your-journey
60+
* /en/get-started/start-your-journey/about-github-and-git
61+
* [...]
62+
*/
4863
router.get(
4964
'/:lang/:productVersion',
5065
pagelistValidationMiddleware as RequestHandler,

0 commit comments

Comments
 (0)