Skip to content

Commit e83febf

Browse files
authored
Merge pull request #37714 from github/repo-sync
Repo sync
2 parents 5e8804e + 745a5ed commit e83febf

File tree

3 files changed

+44
-42
lines changed

3 files changed

+44
-42
lines changed

content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,11 @@ Forks within the same organization copy the collaborators and team settings of t
6868
* Any teams from the upstream permission structure that exist and are visible in the target organization or user namespace will have their permissions copied.
6969
* Admin permissions remain with the upstream owner, except when a user forks into a different organization.
7070
* If that repository is forked to a user namespace, the organization maintains admin permissions and any teams with access maintain access.
71+
72+
{% ifversion ghec or ghes %}
73+
74+
### About forks within an enterprise
75+
76+
Internal repositories only support a single level of forking, it is not possible to fork a private fork of an internal repository. This is intentional to simplify access and management for internal repositories which have enterprise-wide access. This differs from the behavior of public and private repositories, that allow nested forking.
77+
78+
{% endif %}

src/frame/components/DefaultLayout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const DefaultLayout = (props: Props) => {
3030
fullUrl,
3131
status,
3232
} = mainContext
33+
const xHost = mainContext.xHost
3334
const page = mainContext.page!
3435
const { t } = useTranslation(['meta', 'scroll_button'])
3536
const router = useRouter()
@@ -60,7 +61,7 @@ export const DefaultLayout = (props: Props) => {
6061
const metaDescription = page.introPlainText ? page.introPlainText : t('default_description')
6162

6263
const SOCIAL_CATEGORIES = new Set(['code-security', 'actions', 'issues', 'copilot'])
63-
const SOCIAL_CARD_IMG_BASE_URL = '/assets/cb-345/images/social-cards'
64+
const SOCIAL_CARD_IMG_BASE_URL = `${xHost}/assets/cb-345/images/social-cards`
6465

6566
function getCategoryImageUrl(category: string): string {
6667
return `${SOCIAL_CARD_IMG_BASE_URL}/${category}.png`

src/frame/components/context/MainContext.tsx

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ type EnterpriseServerReleases = {
8686
}
8787

8888
export type MainContextT = {
89+
allVersions: Record<string, VersionItem>
8990
breadcrumbs: {
9091
product: BreadcrumbT
9192
category?: BreadcrumbT
@@ -96,21 +97,21 @@ export type MainContextT = {
9697
name: string
9798
href: string
9899
}
100+
currentCategory?: string
101+
currentPathWithoutLanguage: string
99102
currentProduct?: ProductT
100103
currentProductName: string
104+
currentProductTree?: ProductTreeNode | null
101105
currentLayoutName?: string
102-
isHomepageVersion: boolean
106+
currentVersion?: string
103107
data: DataT
104-
error: string
105-
currentCategory?: string
106-
relativePath?: string
107108
enterpriseServerReleases: EnterpriseServerReleases
108-
currentPathWithoutLanguage: string
109-
allVersions: Record<string, VersionItem>
110-
currentVersion?: string
111-
currentProductTree?: ProductTreeNode | null
112-
sidebarTree?: ProductTreeNode | null
109+
enterpriseServerVersions: Array<string>
110+
error: string
113111
featureFlags: FeatureFlags
112+
fullUrl: string
113+
isHomepageVersion: boolean
114+
nonEnterpriseDefaultVersion: string
114115
page: {
115116
documentType: string
116117
type?: string
@@ -122,13 +123,10 @@ export type MainContextT = {
122123
noEarlyAccessBanner: boolean
123124
applicableVersions: string[]
124125
} | null
125-
126-
enterpriseServerVersions: Array<string>
127-
128-
nonEnterpriseDefaultVersion: string
129-
126+
relativePath?: string
127+
sidebarTree?: ProductTreeNode | null
130128
status: number
131-
fullUrl: string
129+
xHost?: string
132130
}
133131

134132
// Write down the namespaces from `data/ui.yml` that are used on all pages,
@@ -231,58 +229,53 @@ export const getMainContext = async (req: any, res: any): Promise<MainContextT>
231229
const currentProductName: string = req.context.currentProductName || ''
232230

233231
const props: MainContextT = {
232+
allVersions: minimalAllVersions(req.context.allVersions),
234233
breadcrumbs: req.context.breadcrumbs || {},
235234
communityRedirect: req.context.page?.communityRedirect || {},
235+
currentCategory: req.context.currentCategory || '',
236+
currentLayoutName: req.context.currentLayoutName || null,
237+
currentPathWithoutLanguage: req.context.currentPathWithoutLanguage,
236238
currentProduct,
237239
currentProductName,
238-
isHomepageVersion: req.context.page?.documentType === 'homepage',
239-
error: req.context.error ? req.context.error.toString() : '',
240+
// This is a slimmed down version of `req.context.currentProductTree`
241+
// that only has the minimal titles stuff needed for sidebars and
242+
// any page that is hidden is omitted.
243+
// However, it's not needed on most pages. For example, on article pages,
244+
// you don't need it. It's similar to the minimal product tree but,
245+
// has the full length titles and not just the short titles.
246+
currentProductTree:
247+
(includeFullProductTree && req.context.currentProductTreeTitlesExcludeHidden) || null,
248+
currentVersion: req.context.currentVersion,
240249
data: {
241250
ui,
242-
243251
reusables,
244-
245252
variables: {
246253
release_candidate: {
247254
version: releaseCandidateVersion,
248255
},
249256
},
250257
},
251-
currentCategory: req.context.currentCategory || '',
252-
currentPathWithoutLanguage: req.context.currentPathWithoutLanguage,
253-
page: pageInfo,
254258
enterpriseServerReleases: pick(req.context.enterpriseServerReleases, [
255259
'isOldestReleaseDeprecated',
256260
'oldestSupported',
257261
'nextDeprecationDate',
258262
'supported',
259263
]),
260264
enterpriseServerVersions: req.context.enterpriseServerVersions,
261-
allVersions: minimalAllVersions(req.context.allVersions),
262-
currentVersion: req.context.currentVersion,
263-
// This is a slimmed down version of `req.context.currentProductTree`
264-
// that only has the minimal titles stuff needed for sidebars and
265-
// any page that is hidden is omitted.
266-
// However, it's not needed on most pages. For example, on article pages,
267-
// you don't need it. It's similar to the minimal product tree but,
268-
// has the full length titles and not just the short titles.
269-
currentProductTree:
270-
(includeFullProductTree && req.context.currentProductTreeTitlesExcludeHidden) || null,
265+
error: req.context.error ? req.context.error.toString() : '',
266+
featureFlags: {},
267+
fullUrl: req.protocol + '://' + req.hostname + req.originalUrl, // does not include port for localhost
268+
isHomepageVersion: req.context.page?.documentType === 'homepage',
269+
nonEnterpriseDefaultVersion: req.context.nonEnterpriseDefaultVersion,
270+
page: pageInfo,
271+
relativePath: req.context.page?.relativePath || null,
271272
// The minimal product tree is needed on all pages that depend on
272273
// the product sidebar or the rest sidebar.
273274
sidebarTree: (includeSidebarTree && req.context.sidebarTree) || null,
274-
featureFlags: {},
275-
nonEnterpriseDefaultVersion: req.context.nonEnterpriseDefaultVersion,
276275
status: res.statusCode,
277-
fullUrl: req.protocol + '://' + req.hostname + req.originalUrl, // does not include port for localhost
276+
xHost: req.get('x-host') || '',
278277
}
279278

280-
if (req.context.currentLayoutName) {
281-
props.currentLayoutName = req.context.currentLayoutName
282-
}
283-
if (req.context.page?.relativePath) {
284-
props.relativePath = req.context.page.relativePath
285-
}
286279
return props
287280
}
288281

0 commit comments

Comments
 (0)