Skip to content

Commit 4ef609b

Browse files
authored
Merge pull request #19015 from github/repo-sync
repo sync
2 parents b18c5bd + e9a46dd commit 4ef609b

File tree

7 files changed

+37
-31
lines changed

7 files changed

+37
-31
lines changed

components/context/RestContext.tsx renamed to components/context/AutomatedPageContext.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
import { createContext, useContext } from 'react'
22
import type { MiniTocItem } from 'components/context/ArticleContext'
33

4-
export type RestContextT = {
4+
export type AutomatedPageContextT = {
55
title: string
66
intro: string
77
renderedPage: string | JSX.Element[]
88
miniTocItems: Array<MiniTocItem>
99
}
1010

11-
export const RestContext = createContext<RestContextT | null>(null)
11+
export const AutomatedPageContext = createContext<AutomatedPageContextT | null>(null)
1212

13-
export const useRestContext = (): RestContextT => {
14-
const context = useContext(RestContext)
13+
export const useAutomatedPageContext = (): AutomatedPageContextT => {
14+
const context = useContext(AutomatedPageContext)
1515

1616
if (!context) {
17-
throw new Error('"useRestContext" may only be used inside "RestContext.Provider"')
17+
throw new Error(
18+
'"useAutomatedPageContext" may only be used inside "AutomatedPageContext.Provider"'
19+
)
1820
}
1921

2022
return context
2123
}
2224

23-
export const getRestContextFromRequest = (req: any): RestContextT => {
25+
export const getAutomatedPageContextFromRequest = (req: any): AutomatedPageContextT => {
2426
const page = req.context.page
2527

2628
return {

components/homepage/ProductSelectionCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const ProductSelectionCard = ({ name, group }: ProductSelectionCardProps)
5959
{icon(group)}
6060

6161
<div>
62-
<h3>{name}</h3>
62+
<h2 className="h3">{name}</h2>
6363
</div>
6464
</div>
6565

components/rest/RestReferencePage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { MarkdownContent } from 'components/ui/MarkdownContent'
88
import { Lead } from 'components/ui/Lead'
99
import { RestOperation } from './RestOperation'
1010
import styles from './RestOperation.module.scss'
11-
import { useRestContext } from 'components/context/RestContext'
11+
import { useAutomatedPageContext } from 'components/context/AutomatedPageContext'
1212
import { Operation } from './types'
1313

1414
const ClientSideHighlightJS = dynamic(() => import('components/article/ClientSideHighlightJS'), {
@@ -28,7 +28,7 @@ export type StructuredContentT = {
2828

2929
export const RestReferencePage = ({ restOperations }: StructuredContentT) => {
3030
const { asPath } = useRouter()
31-
const { title, intro, renderedPage } = useRestContext()
31+
const { title, intro, renderedPage } = useAutomatedPageContext()
3232
// We have some one-off redirects for rest api docs
3333
// currently those are limited to the repos page, but
3434
// that will grow soon as we restructure the rest api docs.

components/sidebar/RestCollapsibleSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ActionList } from '@primer/react'
77
import { Link } from 'components/Link'
88
import { ProductTreeNode } from 'components/context/MainContext'
99
import { EventType, sendEvent } from 'components/lib/events'
10-
import { useRestContext } from 'components/context/RestContext'
10+
import { useAutomatedPageContext } from 'components/context/AutomatedPageContext'
1111
import type { MiniTocItem } from 'components/context/ArticleContext'
1212
import styles from './SidebarProduct.module.scss'
1313

@@ -47,7 +47,7 @@ export const RestCollapsibleSection = (props: SectionProps) => {
4747
router.asPath.includes('/rest/guides') ||
4848
router.asPath.includes('/rest/overview')
4949
? []
50-
: useRestContext().miniTocItems
50+
: useAutomatedPageContext().miniTocItems
5151

5252
useEffect(() => {
5353
if (!currentAnchor) {

content/code-security/dependabot/working-with-dependabot/managing-pull-requests-for-dependency-updates.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ If you have many dependencies to manage, you may want to customize the configura
4444

4545
By default, {% data variables.product.prodname_dependabot %} automatically rebases pull requests to resolve any conflicts. If you'd prefer to handle merge conflicts manually, you can disable this using the `rebase-strategy` option. For details, see "[Configuration options for the dependabot.yml file](/github/administering-a-repository/configuration-options-for-dependency-updates#rebase-strategy)."
4646

47+
## Allowing {% data variables.product.prodname_dependabot %} to rebase and force push over extra commits
48+
49+
By default, {% data variables.product.prodname_dependabot %} will stop rebasing a pull request once extra commits have been pushed to it. To allow {% data variables.product.prodname_dependabot %} to force push over commits added to its branches, include any of the following strings: `[dependabot skip]` , `[skip dependabot]`, `[dependabot-skip]`, or `[skip-dependabot]`, in either lower or uppercase, to the commit message.
50+
4751
## Managing {% data variables.product.prodname_dependabot %} pull requests with comment commands
4852

4953
{% data variables.product.prodname_dependabot %} responds to simple commands in comments. Each pull request contains details of the commands you can use to process the pull request (for example: to merge, squash, reopen, close, or rebase the pull request) under the "{% data variables.product.prodname_dependabot %} commands and options" section. The aim is to make it as easy as possible for you to triage these automatically generated pull requests.

pages/[versionId]/rest/[category]/[subcategory].tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { Operation } from 'components/rest/types'
44
import { RestReferencePage } from 'components/rest/RestReferencePage'
55
import { getMainContext, MainContext, MainContextT } from 'components/context/MainContext'
66
import {
7-
RestContext,
8-
RestContextT,
9-
getRestContextFromRequest,
10-
} from 'components/context/RestContext'
7+
AutomatedPageContext,
8+
AutomatedPageContextT,
9+
getAutomatedPageContextFromRequest,
10+
} from 'components/context/AutomatedPageContext'
1111
import type { MiniTocItem } from 'components/context/ArticleContext'
1212

1313
type MinitocItemsT = {
@@ -16,16 +16,16 @@ type MinitocItemsT = {
1616

1717
type Props = {
1818
mainContext: MainContextT
19-
restContext: RestContextT
19+
automatedPageContext: AutomatedPageContextT
2020
restOperations: Operation[]
2121
}
2222

23-
export default function SubCategory({ mainContext, restContext, restOperations }: Props) {
23+
export default function SubCategory({ mainContext, automatedPageContext, restOperations }: Props) {
2424
return (
2525
<MainContext.Provider value={mainContext}>
26-
<RestContext.Provider value={restContext}>
26+
<AutomatedPageContext.Provider value={automatedPageContext}>
2727
<RestReferencePage restOperations={restOperations} />
28-
</RestContext.Provider>
28+
</AutomatedPageContext.Provider>
2929
</MainContext.Provider>
3030
)
3131
}
@@ -50,7 +50,7 @@ export const getServerSideProps: GetServerSideProps<Props> = async (context) =>
5050
// Gets the miniTocItems in the article context. At this point it will only
5151
// include miniTocItems generated from the Markdown pages in
5252
// content/rest/*
53-
const { miniTocItems } = getRestContextFromRequest(req)
53+
const { miniTocItems } = getAutomatedPageContextFromRequest(req)
5454

5555
// When operations exist, update the miniTocItems in the article context
5656
// with the list of operations in the OpenAPI.
@@ -75,7 +75,7 @@ export const getServerSideProps: GetServerSideProps<Props> = async (context) =>
7575
props: {
7676
restOperations,
7777
mainContext: getMainContext(req, res),
78-
restContext: getRestContextFromRequest(req),
78+
automatedPageContext: getAutomatedPageContextFromRequest(req),
7979
},
8080
}
8181
}

pages/[versionId]/rest/[category]/index.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { Operation } from 'components/rest/types'
55
import { RestReferencePage } from 'components/rest/RestReferencePage'
66
import { getMainContext, MainContext, MainContextT } from 'components/context/MainContext'
77
import {
8-
RestContext,
9-
RestContextT,
10-
getRestContextFromRequest,
11-
} from 'components/context/RestContext'
8+
AutomatedPageContext,
9+
AutomatedPageContextT,
10+
getAutomatedPageContextFromRequest,
11+
} from 'components/context/AutomatedPageContext'
1212
import type { MiniTocItem } from 'components/context/ArticleContext'
1313
import {
1414
getTocLandingContextFromRequest,
@@ -25,21 +25,21 @@ type MinitocItemsT = {
2525
type Props = {
2626
mainContext: MainContextT
2727
tocLandingContext: TocLandingContextT
28-
restContext: RestContextT
28+
automatedPageContext: AutomatedPageContextT
2929
restOperations: Operation[]
3030
}
3131

3232
export default function Category({
3333
mainContext,
34-
restContext,
34+
automatedPageContext,
3535
tocLandingContext,
3636
restOperations,
3737
}: Props) {
3838
const { relativePath } = mainContext
3939

4040
return (
4141
<MainContext.Provider value={mainContext}>
42-
<RestContext.Provider value={restContext}>
42+
<AutomatedPageContext.Provider value={automatedPageContext}>
4343
{/* When the page is the rest product landing page, we don't want to
4444
render the rest-specific sidebar because toggling open the categories
4545
won't have the minitoc items at that level. These are pages that have
@@ -51,7 +51,7 @@ export default function Category({
5151
) : (
5252
<RestReferencePage restOperations={restOperations} />
5353
)}
54-
</RestContext.Provider>
54+
</AutomatedPageContext.Provider>
5555
</MainContext.Provider>
5656
)
5757
}
@@ -165,7 +165,7 @@ export const getServerSideProps: GetServerSideProps<Props> = async (context) =>
165165
// Gets the miniTocItems in the article context. At this point it will only
166166
// include miniTocItems generated from the Markdown pages in
167167
// content/rest/*
168-
const { miniTocItems } = getRestContextFromRequest(req)
168+
const { miniTocItems } = getAutomatedPageContextFromRequest(req)
169169

170170
// When operations exist, update the miniTocItems in the article context
171171
// with the list of operations in the OpenAPI.
@@ -194,7 +194,7 @@ export const getServerSideProps: GetServerSideProps<Props> = async (context) =>
194194
props: {
195195
restOperations,
196196
mainContext: getMainContext(req, res),
197-
restContext: getRestContextFromRequest(req),
197+
automatedPageContext: getAutomatedPageContextFromRequest(req),
198198
tocLandingContext,
199199
},
200200
}

0 commit comments

Comments
 (0)