Skip to content

Commit 9ca0226

Browse files
authored
Merge pull request #12993 from github/repo-sync
repo sync
2 parents 228cd1c + 951ab5a commit 9ca0226

37 files changed

Lines changed: 710 additions & 532 deletions

components/DefaultLayout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { SmallFooter } from 'components/page-footer/SmallFooter'
66
import { ScrollButton } from 'components/ui/ScrollButton'
77
import { SupportSection } from 'components/page-footer/SupportSection'
88
import { DeprecationBanner } from 'components/page-header/DeprecationBanner'
9+
import { RestRepoBanner } from 'components/page-header/RestRepoBanner'
910
import { useMainContext } from 'components/context/MainContext'
1011
import { useTranslation } from 'components/hooks/useTranslation'
1112
import { useRouter } from 'next/router'
@@ -86,6 +87,7 @@ export const DefaultLayout = (props: Props) => {
8687
<main className="flex-1 min-width-0">
8788
<Header />
8889
<DeprecationBanner />
90+
<RestRepoBanner />
8991

9092
{props.children}
9193

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { Flash } from '@primer/components'
2+
import { useRouter } from 'next/router'
3+
import { Link } from 'components/Link'
4+
const restDisplayPages = [
5+
'/rest/reference/branches',
6+
'/rest/reference/collaborators',
7+
'/rest/reference/commits',
8+
'/rest/reference/deployments',
9+
'/rest/reference/pages',
10+
'/rest/reference/repos',
11+
'/rest/reference/repository-metrics',
12+
'/rest/reference/webhooks',
13+
]
14+
const restRepoCategoryExceptions = [
15+
'Branches',
16+
'Collaborators',
17+
'Commits',
18+
'Deployments',
19+
'Github Pages',
20+
'Repository metrics',
21+
'Webhooks',
22+
]
23+
24+
export const RestRepoBanner = () => {
25+
const router = useRouter()
26+
const asPathRoot = router.asPath.split('?')[0].split('#')[0]
27+
if (!restDisplayPages.includes(asPathRoot)) {
28+
return null
29+
}
30+
31+
const newRestPagesText = restRepoCategoryExceptions.map((page, i) => [
32+
<Link href={`/rest/references/${page}`}>
33+
{page}
34+
{i < restRepoCategoryExceptions.length - 1 && ', '}
35+
</Link>,
36+
])
37+
38+
return (
39+
<div data-testid="rest-api-repos-banner" className="container-xl mt-3 mx-auto p-responsive">
40+
<Flash variant="warning">
41+
<p>
42+
<b className="text-bold">
43+
<span>
44+
We've recently moved some of the REST API documentation. If you can't find what you're
45+
looking for, you might try the new {newRestPagesText} REST API pages.
46+
</span>
47+
</b>{' '}
48+
</p>
49+
</Flash>
50+
</div>
51+
)
52+
}

content/actions/deployment/managing-your-deployments/viewing-deployment-history.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ To view current and past deployments, click **Environments** on the home page of
2424

2525
The deployments page displays the last active deployment of each environment for your repository. If the deployment includes an environment URL, a **View deployment** button that links to the URL is shown next to the deployment.
2626

27-
The activity log shows the deployment history for your environments. By default, only the most recent deployment for an environment has an `Active` status; all previously active deployments have an `Inactive` status. For more information on automatic inactivation of deployments, see "[Inactive deployments](/rest/reference/repos#inactive-deployments)."
27+
The activity log shows the deployment history for your environments. By default, only the most recent deployment for an environment has an `Active` status; all previously active deployments have an `Inactive` status. For more information on automatic inactivation of deployments, see "[Inactive deployments](/rest/reference/deployments#inactive-deployments)."
2828

2929
You can also use the REST API to get information about deployments. For more information, see "[Repositories](/rest/reference/repos#deployments)."

content/actions/learn-github-actions/events-that-trigger-workflows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ on:
307307

308308
### `deployment_status`
309309

310-
Runs your workflow anytime a third party provides a deployment status, which triggers the `deployment_status` event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see "[Create a deployment status](/rest/reference/repos#create-a-deployment-status)."
310+
Runs your workflow anytime a third party provides a deployment status, which triggers the `deployment_status` event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see "[Create a deployment status](/rest/reference/deployments#create-a-deployment-status)."
311311

312312
| Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` |
313313
| --------------------- | -------------- | ------------ | -------------|
@@ -701,7 +701,7 @@ on:
701701

702702
{% note %}
703703

704-
**Note:** The webhook payload available to GitHub Actions does not include the `added`, `removed`, and `modified` attributes in the `commit` object. You can retrieve the full commit object using the REST API. For more information, see "[Get a commit](/rest/reference/repos#get-a-commit)".
704+
**Note:** The webhook payload available to GitHub Actions does not include the `added`, `removed`, and `modified` attributes in the `commit` object. You can retrieve the full commit object using the REST API. For more information, see "[Get a commit](/rest/reference/commits#get-a-commit)".
705705

706706
{% endnote %}
707707

content/admin/policies/enforcing-policy-with-pre-receive-hooks/creating-a-pre-receive-hook-script.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ The `$GITHUB_VIA` variable is available in the pre-receive hook environment when
8282

8383
| Value | Action | More information |
8484
| :- | :- | :- |
85-
| <pre>auto-merge deployment api</pre> | Automatic merge of the base branch via a deployment created with the API | "[Repositories](/rest/reference/repos#create-a-deployment)" in the REST API documentation |
85+
| <pre>auto-merge deployment api</pre> | Automatic merge of the base branch via a deployment created with the API | "[Create a deployment](/rest/reference/deployments#create-a-deployment)" in the REST API documentation |
8686
| <pre>blob#save</pre> | Change to a file's contents in the web interface | "[Editing files](/repositories/working-with-files/managing-files/editing-files)" |
87-
| <pre>branch merge api</pre> | Merge of a branch via the API | "[Repositories](/rest/reference/repos#merge-a-branch)" in the REST API documentation |
87+
| <pre>branch merge api</pre> | Merge of a branch via the API | "[Merge a branch](/rest/reference/branches#merge-a-branch)" in the REST API documentation |
8888
| <pre>branches page delete button</pre> | Deletion of a branch in the web interface | "[Creating and deleting branches within your repository](/github/collaborating-with-issues-and-pull-requests/creating-and-deleting-branches-within-your-repository#deleting-a-branch)" |
8989
| <pre>git refs create api</pre> | Creation of a ref via the API | "[Git database](/rest/reference/git#create-a-reference)" in the REST API documentation |
9090
| <pre>git refs delete api</pre> | Deletion of a ref via the API | "[Git database](/rest/reference/git#delete-a-reference)" in the REST API documentation |
9191
| <pre>git refs update api</pre> | Update of a ref via the API | "[Git database](/rest/reference/git#update-a-reference)" in the REST API documentation |
92-
| <pre>git repo contents api</pre> | Change to a file's contents via the API | "[Repositories](/rest/reference/repos#create-or-update-file-contents)" in the REST API documentation |
92+
| <pre>git repo contents api</pre> | Change to a file's contents via the API | "[Create or update file contents](/rest/reference/repos#create-or-update-file-contents)" in the REST API documentation |
9393
| <pre>merge base into head</pre> | Update of the topic branch from the base branch when the base branch requires strict status checks (via **Update branch** in a pull request, for example) | "[About protected branches](/github/administering-a-repository/about-protected-branches#require-status-checks-before-merging)" |
9494
| <pre>pull request branch delete button</pre> | Deletion of a topic branch from a pull request in the web interface | "[Deleting and restoring branches in a pull request](/github/administering-a-repository/deleting-and-restoring-branches-in-a-pull-request#deleting-a-branch-used-for-a-pull-request)" |
9595
| <pre>pull request branch undo button</pre> | Restoration of a topic branch from a pull request in the web interface | "[Deleting and restoring branches in a pull request](/github/administering-a-repository/deleting-and-restoring-branches-in-a-pull-request#restoring-a-deleted-branch)" |

0 commit comments

Comments
 (0)