1
0
mirror of synced 2025-12-22 11:26:57 -05:00

Merge branch 'main' into move-bookmarklets

This commit is contained in:
Sarah Schneider
2022-04-20 14:43:20 -04:00
committed by GitHub
1398 changed files with 21183 additions and 7351 deletions

View File

@@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repo content
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561

View File

@@ -79,7 +79,7 @@ jobs:
- if: ${{ env.IS_PUBLIC_BUILD == 'true' }}
name: Check out main branch
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
ref: 'main'
persist-credentials: 'false'
@@ -87,7 +87,7 @@ jobs:
- if: ${{ env.IS_INTERNAL_BUILD == 'true' }}
name: Check out PR code
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
ref: ${{ env.COMMIT_REF }}
# To prevent issues with cloning early access content later
@@ -139,7 +139,7 @@ jobs:
- if: ${{ env.IS_INTERNAL_BUILD == 'true' }}
name: Clone docs-early-access
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
repository: github/docs-early-access
token: ${{ secrets.DOCUBOT_REPO_PAT }}
@@ -152,7 +152,7 @@ jobs:
- if: ${{ env.IS_PUBLIC_BUILD == 'true' }}
name: Check out user code to temp directory
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
path: ./user-code
ref: ${{ env.COMMIT_REF }}

View File

@@ -39,7 +39,7 @@ jobs:
creds: ${{ secrets.NONPROD_AZURE_CREDENTIALS }}
- name: Check out repo
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Get preview app info
env:

View File

@@ -49,7 +49,7 @@ jobs:
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25
- name: Check out repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
ref: ${{ github.sha }}
# To prevent issues with cloning early access content later
@@ -66,7 +66,7 @@ jobs:
cache: npm
- name: Clone docs-early-access
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
repository: github/docs-early-access
token: ${{ secrets.DOCUBOT_REPO_PAT }}

View File

@@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
lfs: true
@@ -54,7 +54,7 @@ jobs:
run: npm ci --include=optional
- name: Cache nextjs build
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}

View File

@@ -26,7 +26,7 @@ jobs:
REPORT_REPOSITORY: github/docs-content
steps:
- name: Check out repo's default branch
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
with:
@@ -35,7 +35,7 @@ jobs:
- name: npm ci
run: npm ci
- name: Cache nextjs build
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}

View File

@@ -39,7 +39,7 @@ jobs:
exit 1 # prevents further steps from running
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
@@ -50,9 +50,20 @@ jobs:
- name: Install Node.js dependencies
run: npm ci
- name: Run broken github/github link check
- name: Build server
run: npm run build
- name: Start server in the background
env:
WAF_TOKEN: ${{ secrets.WAF_TOKEN }}
NODE_ENV: production
PORT: 4000
run: |
node server.mjs &
sleep 5
curl --retry-connrefused --retry 3 -I http://localhost:4000/
- name: Run broken github/github link check
run: |
script/check-github-github-links.js > broken_github_github_links.md

View File

@@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561

View File

@@ -30,7 +30,7 @@ jobs:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- uses: github/codeql-action/init@1ed1437484560351c5be56cf73a48a279d116b78
with:
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)

View File

@@ -49,7 +49,7 @@ jobs:
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: check out repo content
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Get preview app info
env:
@@ -74,7 +74,7 @@ jobs:
run: .github/actions-scripts/content-changes-table-comment.js
- name: Find content directory changes comment
uses: peter-evans/find-comment@d2dae40ed151c634e4189471272b57e76ec19ba8
uses: peter-evans/find-comment@1769778a0c5bd330272d749d12c036d65e70d39d
id: findComment
with:
issue-number: ${{ github.event.pull_request.number }}

View File

@@ -55,7 +55,7 @@ jobs:
- run: git config --global user.email "67483024+docubot@users.noreply.github.com"
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
fetch-depth: 0
lfs: true

View File

@@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561

View File

@@ -20,7 +20,7 @@ jobs:
steps:
- name: Check out repo content
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561

View File

@@ -36,7 +36,7 @@ jobs:
exit 1 # prevents further steps from running
- name: Checkout repository code
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561

View File

@@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.DOCUBOT_REPO_PAT }}
@@ -63,7 +63,7 @@ jobs:
run: $GITHUB_WORKSPACE/.github/actions-scripts/enterprise-search-label.js
- name: Cache nextjs build
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}

View File

@@ -27,7 +27,7 @@ jobs:
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561

View File

@@ -45,7 +45,7 @@ jobs:
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25
- name: Check out repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
# To prevent issues with cloning early access content later
persist-credentials: 'false'
@@ -56,7 +56,7 @@ jobs:
- if: ${{ env.ENABLE_EARLY_ACCESS }}
name: Clone docs-early-access
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
repository: github/docs-early-access
token: ${{ secrets.DOCUBOT_REPO_PAT }}

View File

@@ -16,7 +16,7 @@ jobs:
steps:
- name: Check out repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Install dependencies
run: npm ci

View File

@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561

View File

@@ -31,7 +31,7 @@ jobs:
add-labels: 'github-openapi-bot'
- name: Checkout repository code
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
# actions/checkout by default will leave you in a detached head state
# so we need to specify the PR head ref explicitly since we're making

View File

@@ -39,7 +39,7 @@ jobs:
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
steps:
- name: Checkout repository code
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561

View File

@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repo on head ref
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
ref: ${{ github.head_ref }}
# Need to specify a PAT here because otherwise GITHUB_TOKEN is used

View File

@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
# Using a PAT is necessary so that the new commit will trigger the
# CI in the PR. (Events from GITHUB_TOKEN don't trigger new workflows.)

View File

@@ -44,7 +44,7 @@ jobs:
exit 1
- name: Check out repo content
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561

View File

@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
@@ -30,7 +30,7 @@ jobs:
run: npm ci --include=optional
- name: Cache nextjs build
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}

View File

@@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561

View File

@@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repo content
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561

View File

@@ -25,7 +25,7 @@ jobs:
echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
with:

View File

@@ -98,7 +98,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
# Set up npm and run npm ci to run husky to get githooks for LFS
- name: Setup node

View File

@@ -26,10 +26,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout docs-internal
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: checkout public site-policy
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
repository: github/site-policy
token: ${{ secrets.API_TOKEN_SITEPOLICY }}

View File

@@ -51,7 +51,7 @@ jobs:
exit 1 # prevents further steps from running
# Check out internal docs repository
- name: checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
token: ${{ secrets.DOCS_BOT_FR }}
@@ -65,7 +65,7 @@ jobs:
run: npm ci
- name: Cache nextjs build
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}

View File

@@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
@@ -38,7 +38,7 @@ jobs:
run: npm ci
- name: Cache nextjs build
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}

View File

@@ -46,7 +46,7 @@ jobs:
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
# Even if if doesn't do anything
- name: Check out repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
# Not all test suites need the LFS files. So instead, we opt to
# NOT clone them initially and instead, include them manually
@@ -87,7 +87,7 @@ jobs:
- name: Check out docs-early-access too, if internal repo
if: ${{ github.repository == 'github/docs-internal' }}
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
repository: github/docs-early-access
token: ${{ secrets.DOCUBOT_REPO_PAT }}
@@ -132,7 +132,7 @@ jobs:
run: npm ci
- name: Cache nextjs build
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}

View File

@@ -55,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.DOCUBOT_REPO_PAT }}

View File

@@ -32,7 +32,7 @@ jobs:
echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
with:

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

View File

@@ -88,10 +88,7 @@ export const DefaultLayout = (props: Props) => {
<SidebarNav />
{/* Need to set an explicit height for sticky elements since we also
set overflow to auto */}
<div
className="flex-column flex-1 overflow-auto print-overflow-visible"
style={{ height: '100vh' }}
>
<div className="flex-column flex-1">
<Header />
<main id="main-content" style={{ scrollMarginTop: '5rem' }}>
<DeprecationBanner />

View File

@@ -26,7 +26,7 @@ const SUPPORTED_LANGUAGES = ['json', 'javascript', 'curl']
// </pre>
//
const CODE_ELEMENTS_PARENT_SELECTOR = '[data-highlight]'
const CODE_SELECTOR = 'pre code'
const CODE_SELECTOR = 'div code' || 'pre code'
export default function ClientSideHighlightJS() {
const { asPath } = useRouter()

View File

@@ -0,0 +1,37 @@
import { createContext, useContext } from 'react'
export type MiniTocItem = {
platform: string
contents: string & { title: string; href: string }
items?: MiniTocItem[]
}
export type RestContextT = {
title: string
intro: string
renderedPage: string | JSX.Element[]
miniTocItems: Array<MiniTocItem>
}
export const RestContext = createContext<RestContextT | null>(null)
export const useRestContext = (): RestContextT => {
const context = useContext(RestContext)
if (!context) {
throw new Error('"useRestContext" may only be used inside "RestContext.Provider"')
}
return context
}
export const getRestContextFromRequest = (req: any): RestContextT => {
const page = req.context.page
return {
title: page.titlePlainText,
intro: page.intro,
renderedPage: req.context.renderedPage || '',
miniTocItems: req.context.miniTocItems || [],
}
}

View File

@@ -1,3 +1,7 @@
import { useState, useEffect } from 'react'
import { useRouter } from 'next/router'
import dynamic from 'next/dynamic'
import { DefaultLayout } from 'components/DefaultLayout'
import { TableOfContents } from 'components/landing/TableOfContents'
import { useTocLandingContext } from 'components/context/TocLandingContext'
@@ -10,6 +14,13 @@ import { Callout } from 'components/ui/Callout'
import { Lead } from 'components/ui/Lead'
import { LearningTrackNav } from 'components/article/LearningTrackNav'
const ClientSideRedirectExceptions = dynamic(
() => import('components/article/ClientsideRedirectExceptions'),
{
ssr: false,
}
)
export const TocLanding = () => {
const {
title,
@@ -23,8 +34,38 @@ export const TocLanding = () => {
} = useTocLandingContext()
const { t } = useTranslation('toc')
const { asPath } = useRouter()
// We have some one-off redirects for rest api docs
// currently those are limited to the repos page, but
// that will grow soon as we restructure the rest api docs.
// This is a workaround to updating the hardcoded links
// directly in the REST API code in a separate repo, which
// requires many file changes and teams to sign off.
// While the organization is turbulent, we can do this.
// Once it's more settled, we can refactor the rest api code
// to leverage the OpenAPI urls rather than hardcoded urls.
// The code below determines if we should bother loading this redirecting
// component at all.
// The reason this isn't done at the server-level is because there you
// can't possibly access the URL hash. That's only known in client-side
// code.
const [loadClientsideRedirectExceptions, setLoadClientsideRedirectExceptions] = useState(false)
useEffect(() => {
const { hash } = window.location
// Today, Jan 2022, it's known explicitly what the pathname.
// In the future there might be more.
// Hopefully, we can some day delete all of this and no longer
// be dependent on the URL hash to do the redirect.
if (hash && asPath.startsWith('/rest')) {
setLoadClientsideRedirectExceptions(true)
}
}, [])
return (
<DefaultLayout>
{/* Doesn't matter *where* this is included because it will
never render anything. It always just return null. */}
{loadClientsideRedirectExceptions && <ClientSideRedirectExceptions />}
<div className="container-xl px-3 px-md-6 my-4">
<ArticleGridLayout>
<ArticleTitle>{title}</ArticleTitle>

View File

@@ -52,7 +52,7 @@ export const Header = () => {
return (
<div
className={cx(
'border-bottom d-unset color-border-muted no-print z-3 color-bg-default',
'border-bottom d-unset color-border-muted no-print z-3 color-bg-default position-sticky top-0',
styles.header
)}
>

View File

@@ -43,7 +43,7 @@ export const RestBanner = () => {
>
const newRestPagesText = pages.map((page, i) => [
<React.Fragment key={page}>
<Link href={`/${router.locale}/rest/reference/${page}`}>
<Link href={`/${router.locale}/rest/${page}`}>
{restRepoCategoryExceptionsTitles[page]}
</Link>
{i < pages.length - 1 && ', '}
@@ -60,7 +60,7 @@ export const RestBanner = () => {
noticeString = (
<React.Fragment>
If you can't find what you're looking for, you might try the{' '}
<Link href={`/${router.locale}/rest/reference/actions`}>Actions</Link> REST API page.
<Link href={`/${router.locale}/rest/actions`}>Actions</Link> REST API page.
</React.Fragment>
)
}

View File

@@ -1,4 +1,14 @@
.codeBlock {
max-height: 32rem;
overflow: auto;
padding: 1rem;
margin-bottom: 1rem;
line-height: 1.45;
background-color: var(--color-canvas-subtle);
white-space: pre-wrap;
word-break: break-all;
code {
background-color: transparent;
}
}

View File

@@ -31,7 +31,7 @@ export function CodeBlock({ verb, headingLang, codeBlock, highlight }: Props) {
</Tooltip>
</header>
)}
<pre className={cx(styles.codeBlock, 'rounded-1 border')} data-highlight={highlight}>
<div className={cx(styles.codeBlock, 'rounded-1 border')} data-highlight={highlight}>
<code>
{verb && (
<>
@@ -43,7 +43,7 @@ export function CodeBlock({ verb, headingLang, codeBlock, highlight }: Props) {
)}
{codeBlock}
</code>
</pre>
</div>
</div>
)
}

View File

@@ -1,18 +1,13 @@
import React, { useState, useEffect } from 'react'
import cx from 'classnames'
import { useRouter } from 'next/router'
import dynamic from 'next/dynamic'
import { DefaultLayout } from 'components/DefaultLayout'
import { useMainContext } from 'components/context/MainContext'
import { MarkdownContent } from 'components/ui/MarkdownContent'
import { Lead } from 'components/ui/Lead'
import { MiniTocItem } from 'components/context/ArticleContext'
import { RestCategoryOperationsT } from './types'
import { useRestContext } from 'components/context/RestContext'
import { Operation } from './types'
import { RestOperation } from './RestOperation'
import { ChevronDownIcon, ChevronUpIcon, SearchIcon } from '@primer/octicons-react'
import { useTranslation } from 'components/hooks/useTranslation'
import { ActionList } from '@primer/react'
const ClientSideHighlightJS = dynamic(() => import('components/article/ClientSideHighlightJS'), {
ssr: false,
@@ -26,24 +21,12 @@ const ClientSideRedirectExceptions = dynamic(
)
export type StructuredContentT = {
descriptions: any
introContent: string
restOperations: RestCategoryOperationsT
miniTocItems?: MiniTocItem[]
restOperations: Operation[]
}
export const RestReferencePage = ({
descriptions,
introContent,
restOperations,
miniTocItems,
}: StructuredContentT) => {
const { t } = useTranslation('pages')
export const RestReferencePage = ({ restOperations }: StructuredContentT) => {
const { asPath } = useRouter()
const { page } = useMainContext()
const subcategories = Object.keys(restOperations)
const [collapsed, setCollapsed] = useState({} as Record<number, boolean>)
const { title, intro, renderedPage } = useRestContext()
// We have some one-off redirects for rest api docs
// currently those are limited to the repos page, but
// that will grow soon as we restructure the rest api docs.
@@ -60,17 +43,13 @@ export const RestReferencePage = ({
// code.
const [loadClientsideRedirectExceptions, setLoadClientsideRedirectExceptions] = useState(false)
useEffect(() => {
const { hash, pathname } = window.location
const { hash } = window.location
// Today, Jan 2022, it's known explicitly what the pathname.
// In the future there might be more.
// Hopefully, we can some day delete all of this and no longer
// be dependent on the URL hash to do the redirect.
if (
hash &&
(pathname.endsWith('/rest/reference/repos') ||
pathname.endsWith('/rest/reference/enterprise-admin') ||
pathname.endsWith('/rest/reference/deployments'))
) {
if (hash && asPath.startsWith('/rest')) {
setLoadClientsideRedirectExceptions(true)
}
}, [])
@@ -110,113 +89,31 @@ export const RestReferencePage = ({
// consecutive one does.
}, [asPath])
// Resetting the collapsed array when we move to another REST page
useEffect(() => {
setCollapsed({})
}, [asPath])
const handleClick = (param: number) => {
setCollapsed((prevState) => {
return { ...prevState, [param]: !prevState[param] }
})
}
const renderTocItem = (item: MiniTocItem, index: number) => {
return (
<ActionList.Item
as="li"
key={item.contents}
className={item.platform}
sx={{
listStyle: 'none',
padding: '2px',
':hover': {
bg: 'var(--color-canvas-inset)',
},
}}
>
<div className={cx('lh-condensed d-block width-full')}>
<div className="d-inline-flex" dangerouslySetInnerHTML={{ __html: item.contents }} />
{item.items && item.items.length > 0 && (
<button
className="background-transparent border-0 ml-1"
onClick={() => handleClick(index)}
>
{!collapsed[index] ? <ChevronDownIcon /> : <ChevronUpIcon />}
</button>
)}
{collapsed[index] && item.items && item.items.length > 0 ? (
<ul className="ml-3">{item.items.map(renderTocItem)}</ul>
) : null}
</div>
</ActionList.Item>
)
}
return (
<DefaultLayout>
{/* Doesn't matter *where* this is included because it will
never render anything. It always just return null. */}
{loadClientsideRedirectExceptions && <ClientSideRedirectExceptions />}
{lazyLoadHighlightJS && <ClientSideHighlightJS />}
<div className="container-xl px-3 px-md-6 my-4 mx-xl-12 mx-lg-12">
<h1>{page.title}</h1>
{page.introPlainText && (
<div className={'px-3 px-md-6 my-4 mx-xl-12 mx-lg-12'}>
<h1 className="mb-3">{title}</h1>
{intro && (
<Lead data-testid="lead" data-search="lead" className="markdown-body">
{page.introPlainText}
{intro}
</Lead>
)}
<div className="my-3 d-flex">
<div className="pr-3 mt-1">
<Circle className="color-fg-on-emphasis color-bg-emphasis">
<SearchIcon className="" size={15} />
</Circle>
</div>
<div id="article-contents">
<h3>{t('miniToc')}</h3>
{miniTocItems && (
<ActionList
key={page.title}
items={miniTocItems.map((items, i) => {
return {
key: page.title + i,
text: page.title,
renderItem: () => <ul>{renderTocItem(items, i)}</ul>,
}
})}
/>
)}
</div>
</div>
<div key={`restCategory-introContent`}>
<div dangerouslySetInnerHTML={{ __html: introContent }} />
</div>
<MarkdownContent>
{subcategories.map((subcategory, index) => (
<div key={`${subcategory}-${index}`}>
<div dangerouslySetInnerHTML={{ __html: descriptions[subcategory] }} />
{restOperations[subcategory].map((operation, index) => (
<RestOperation
key={`${subcategory}-${operation.title}-${index}`}
operation={operation}
/>
))}
</div>
))}
<MarkdownContent>{renderedPage}</MarkdownContent>
{restOperations &&
restOperations.length > 0 &&
restOperations.map((operation, index) => (
<RestOperation
key={`restOperation-${operation.title}-${index}`}
operation={operation}
/>
))}
</MarkdownContent>
</div>
</DefaultLayout>
)
}
const Circle = ({ className, children }: { className?: string; children?: React.ReactNode }) => {
return (
<div
className={cx('circle d-flex flex-justify-center flex-items-center', className)}
style={{ width: 24, height: 24 }}
>
{children}
</div>
)
}

View File

@@ -69,7 +69,3 @@ export interface ChildParameter {
description: string
type: string
}
export interface RestCategoryOperationsT {
[subcategory: string]: Operation[]
}

View File

@@ -0,0 +1,124 @@
import cx from 'classnames'
import { useState, SyntheticEvent } from 'react'
import { ChevronDownIcon } from '@primer/octicons-react'
import { ActionList } from '@primer/react'
import { Link } from 'components/Link'
import { ProductTreeNode } from 'components/context/MainContext'
import { EventType, sendEvent } from 'components/lib/events'
import styles from './SidebarProduct.module.scss'
type SectionProps = {
routePath: string
page: ProductTreeNode
title: string
defaultOpen: boolean
}
export const ProductCollapsibleSection = (props: SectionProps) => {
const { routePath, defaultOpen, title, page } = props
const [isOpen, setIsOpen] = useState(defaultOpen)
const onToggle = (e: SyntheticEvent) => {
const newIsOpen = (e.target as HTMLDetailsElement).open
setIsOpen(newIsOpen)
sendEvent({
type: EventType.navigate,
navigate_label: `details ${newIsOpen ? 'open' : 'close'}: ${title}`,
})
}
// The lowest level page link displayed in the tree
const renderTerminalPageLink = (page: ProductTreeNode) => {
const title = page.renderedShortTitle || page.renderedFullTitle
const isCurrent = routePath === page.href
return {
text: title,
renderItem: () => (
<ActionList.Item
data-testid="sidebar-article"
data-is-current-page={isCurrent}
as="li"
className={cx(
'position-relative',
styles.sidebarArticle,
isCurrent && ['text-bold', styles.sidebarArticleActive]
)}
sx={{
padding: '2px 0',
':hover': {
borderRadius: 0,
},
}}
>
<Link
href={page.href}
className={cx(
'd-block pl-6 pr-5 py-1 no-underline width-full',
isCurrent ? 'color-fg-accent' : 'color-fg-default'
)}
>
{title}
</Link>
</ActionList.Item>
),
}
}
return (
<details open={defaultOpen} onToggle={onToggle} className="details-reset">
<summary className="outline-none">
<div className="d-flex flex-justify-between">
<div className="pl-4 pr-1 py-2 f5 d-block flex-auto mr-3 color-fg-default no-underline text-bold">
{title}
</div>
<span style={{ marginTop: 7 }} className="flex-shrink-0 pr-3">
<ChevronDownIcon className={cx('opacity-60', isOpen && 'rotate-180')} />
</span>
</div>
</summary>
{
<>
{/* <!-- some pages have nested child pages (formerly known as a mapTopic) --> */}
{page.childPages[0]?.page.documentType === 'mapTopic' ? (
<ul className="list-style-none position-relative">
{page.childPages.map((childPage, i) => {
const childTitle = childPage.renderedShortTitle || childPage.renderedFullTitle
const isActive = routePath.includes(childPage.href)
const isCurrent = routePath === childPage.href
return (
<li key={childPage.href + i} data-is-current-page={isCurrent}>
<details
open={isActive}
onToggle={(e) => e.stopPropagation()}
className="details-reset"
>
<summary>
<div className={cx('pl-4 pr-5 py-2 no-underline')}>{childTitle}</div>
</summary>
<div data-testid="sidebar-article-group" className="pb-0">
<ActionList
{...{ as: 'ul' }}
items={childPage.childPages.map((cp) => {
return renderTerminalPageLink(cp)
})}
></ActionList>
</div>
</details>
</li>
)
})}
</ul>
) : page.childPages[0]?.page.documentType === 'article' ? (
<div data-testid="sidebar-article-group" className="pb-0">
<ActionList {...{ as: 'ul' }} items={page.childPages.map(renderTerminalPageLink)} />
</div>
) : null}
</>
}
</details>
)
}

View File

@@ -0,0 +1,206 @@
import { useRouter } from 'next/router'
import cx from 'classnames'
import { useState, useEffect, SyntheticEvent, ReactElement } from 'react'
import { ChevronDownIcon } from '@primer/octicons-react'
import { ActionList } from '@primer/react'
import { Link } from 'components/Link'
import { ProductTreeNode } from 'components/context/MainContext'
import { EventType, sendEvent } from 'components/lib/events'
import { MiniTocItem, useRestContext } from 'components/context/RestContext'
import styles from './SidebarProduct.module.scss'
type SectionProps = {
routePath: string
page: ProductTreeNode
title: string
defaultOpen: boolean
isStandaloneCategory: boolean
}
type ConditionalLinkTypes = {
condition: boolean
wrapper: Function
children: ReactElement
}
export const RestCollapsibleSection = (props: SectionProps) => {
const router = useRouter()
const { routePath, defaultOpen, title, page, isStandaloneCategory } = props
const [isOpen, setIsOpen] = useState(defaultOpen)
const [currentAnchor, setCurrentAnchor] = useState('')
const onToggle = (e: SyntheticEvent) => {
const newIsOpen = (e.target as HTMLDetailsElement).open
setIsOpen(newIsOpen)
sendEvent({
type: EventType.navigate,
navigate_label: `details ${newIsOpen ? 'open' : 'close'}: ${title}`,
})
}
useEffect(() => {
if (!currentAnchor) {
setCurrentAnchor(window.location.hash)
}
const hashChangeHandler = () => {
setCurrentAnchor(window.location.hash)
}
window.addEventListener('hashchange', hashChangeHandler)
return () => {
window.removeEventListener('hashchange', hashChangeHandler)
}
}, [])
const miniTocItems =
router.query.productId === 'rest' ||
// These pages need the Article Page mini tocs instead of the Rest Pages
router.asPath.includes('/rest/guides') ||
router.asPath.includes('/rest/overview')
? []
: useRestContext().miniTocItems
// This wrapper solves the issue of having standalone categories not
// link to the new page. We want standalone categories to have links
// just like maptopics/subcategories.
const ConditionalLinkWrapper = ({ condition, wrapper, children }: ConditionalLinkTypes) =>
condition ? wrapper(children) : children
const renderRestAnchorLink = (miniTocItem: MiniTocItem) => {
const miniTocAnchor = miniTocItem.contents.href
const title = miniTocItem.contents.title
const isCurrent = currentAnchor === miniTocAnchor
return {
text: title,
renderItem: () => (
<ActionList.Item
data-is-current-page={isCurrent}
as="li"
className={cx(
'position-relative',
styles.sidebarArticle,
isCurrent && ['text-bold', styles.sidebarArticleActive]
)}
sx={{
padding: '2px 0',
':hover': {
borderRadius: 0,
},
}}
>
<a
className={cx(
'd-block pl-6 pr-5 py-1 no-underline width-full',
isCurrent ? 'color-fg-accent' : 'color-fg-default'
)}
href={miniTocAnchor}
>
{title}
</a>
</ActionList.Item>
),
}
}
return (
<details open={defaultOpen} onToggle={onToggle} className="details-reset">
<summary className="outline-none">
<ConditionalLinkWrapper
condition={isStandaloneCategory}
wrapper={(children: ReactElement) => (
<Link href={page.href} className="color-fg-default no-underline text-bold">
{children}
</Link>
)}
>
<div className="d-flex flex-justify-between">
<div className="pl-4 pr-1 py-2 f5 d-block flex-auto mr-3 color-fg-default no-underline text-bold">
{title}
</div>
<span style={{ marginTop: 7 }} className="flex-shrink-0 pr-3">
<ChevronDownIcon className={cx('opacity-60', isOpen && 'rotate-180')} />
</span>
</div>
</ConditionalLinkWrapper>
</summary>
{
<>
{/* <!-- Render the maptopic level subcategory operation links e.g. --> */}
<ul className="list-style-none position-relative">
{page.childPages.length <= 0 ? (
<div data-testid="sidebar-article-group" className="pb-0">
{miniTocItems.length > 0 && (
<ActionList
{...{ as: 'ul' }}
items={miniTocItems.map((item) => {
return renderRestAnchorLink(item)
})}
></ActionList>
)}
</div>
) : (
page.childPages.map((childPage, i) => {
const childTitle = childPage.renderedShortTitle || childPage.renderedFullTitle
const isActive = routePath.includes(childPage.href)
const isCurrent = routePath === childPage.href
// At this point we have the mini-toc data for the current page
// so we render this list of operation links.
if (routePath === childPage.href) {
return (
<li key={childPage.href + i} data-is-current-page={isCurrent}>
<details
open={isActive}
onToggle={(e) => e.stopPropagation()}
className="details-reset"
>
<summary>
<div
data-testid="sidebar-rest-subcategory"
className={cx('pl-4 pr-5 py-2 no-underline')}
>
{childTitle}
</div>
</summary>
<div className="pb-0">
{miniTocItems.length > 0 && (
<ActionList
{...{ as: 'ul' }}
items={miniTocItems.map((item) => {
return renderRestAnchorLink(item)
})}
></ActionList>
)}
</div>
</details>
</li>
)
} else {
// We're not on the current page so don't have any minitoc
// data so just render a link to the category page.
return (
<li key={childTitle} data-testid="sidebar-article-group" className="pb-0">
<Link
href={childPage.href}
className={cx(
'd-block pl-4 pr-5 py-1 no-underline width-full',
isCurrent ? 'color-fg-accent' : 'color-fg-default'
)}
>
{childTitle}
</Link>
</li>
)
}
})
)}
</ul>
</>
}
</details>
)
}

View File

@@ -9,7 +9,7 @@ import { SidebarHomepage } from './SidebarHomepage'
export const SidebarNav = () => {
const router = useRouter()
const { error, relativePath } = useMainContext()
const { error, currentProduct } = useMainContext()
const { t } = useTranslation('header')
return (
@@ -40,7 +40,7 @@ export const SidebarNav = () => {
</Link>
</div>
<nav>
{error === '404' || relativePath === 'index.md' ? <SidebarHomepage /> : <SidebarProduct />}
{error === '404' || currentProduct === null ? <SidebarHomepage /> : <SidebarProduct />}
</nav>
</div>
)

View File

@@ -1,18 +1,19 @@
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import cx from 'classnames'
import { useState, useEffect, SyntheticEvent } from 'react'
import { ChevronDownIcon } from '@primer/octicons-react'
import { ActionList } from '@primer/react'
import { Link } from 'components/Link'
import { ProductTreeNode, useMainContext } from 'components/context/MainContext'
import { useMainContext } from 'components/context/MainContext'
import { AllProductsLink } from 'components/sidebar/AllProductsLink'
import { EventType, sendEvent } from 'components/lib/events'
import styles from './SidebarProduct.module.scss'
import { RestCollapsibleSection } from './RestCollapsibleSection'
import { ProductCollapsibleSection } from './ProductCollapsibleSection'
import { useTranslation } from 'components/hooks/useTranslation'
export const SidebarProduct = () => {
const router = useRouter()
const { currentProductTree } = useMainContext()
const { currentProduct, currentProductTree } = useMainContext()
const { t } = useTranslation(['products'])
useEffect(() => {
const activeArticle = document.querySelector('[data-is-current-page=true]')
@@ -28,13 +29,134 @@ export const SidebarProduct = () => {
return null
}
const productTitle = currentProductTree.renderedShortTitle || currentProductTree.renderedFullTitle
// remove query string and hash
const routePath = `/${router.locale}${router.asPath.split('?')[0].split('#')[0]}`
const hasExactCategory = !!currentProductTree.childPages.find(({ href }) =>
const hasExactCategory = !!currentProductTree?.childPages.find(({ href }) =>
routePath.includes(href)
)
const productTitle = currentProductTree.renderedShortTitle || currentProductTree.renderedFullTitle
const productSection = () => (
<li className="my-3" data-testid="product-sidebar-items">
<ul className="list-style-none">
{currentProductTree &&
currentProductTree.childPages.map((childPage, i) => {
const isStandaloneCategory = childPage.page.documentType === 'article'
const childTitle = childPage.renderedShortTitle || childPage.renderedFullTitle
const isActive =
routePath.includes(childPage.href + '/') || routePath === childPage.href
const defaultOpen = hasExactCategory ? isActive : false
return (
<li
key={childPage.href + i}
data-is-active-category={isActive}
data-is-current-page={isActive && isStandaloneCategory}
className={cx('py-1', isActive && 'color-bg-inset')}
>
{isStandaloneCategory ? (
<Link
href={childPage.href}
className="pl-4 pr-2 py-2 d-block flex-auto mr-3 color-fg-default no-underline text-bold"
>
{childTitle}
</Link>
) : (
<ProductCollapsibleSection
defaultOpen={defaultOpen}
routePath={routePath}
title={childTitle}
page={childPage}
/>
)}
</li>
)
})}
</ul>
</li>
)
const restSection = () => {
const conceptualPages = currentProductTree.childPages.filter(
(page) => page.href.includes('guides') || page.href.includes('overview')
)
const restPages = currentProductTree.childPages.filter(
(page) => !page.href.includes('guides') && !page.href.includes('overview')
)
return (
<>
<li className="my-3" data-testid="rest-sidebar-items">
<ul className="list-style-none">
{conceptualPages.map((childPage, i) => {
const isStandaloneCategory = childPage.page.documentType === 'article'
const childTitle = childPage.renderedShortTitle || childPage.renderedFullTitle
const isActive =
routePath.includes(childPage.href + '/') || routePath === childPage.href
const defaultOpen = hasExactCategory ? isActive : false
return (
<li
key={childPage.href + i}
data-is-active-category={isActive}
data-is-current-page={isActive && isStandaloneCategory}
className={cx('py-1', isActive && 'color-bg-inset')}
>
<ProductCollapsibleSection
defaultOpen={defaultOpen}
routePath={routePath}
title={childTitle}
page={childPage}
/>
</li>
)
})}
</ul>
</li>
<div className="my-3">
<div
role="separator"
aria-hidden="true"
data-view-component="true"
className="ActionList-sectionDivider mx-4"
></div>
<span data-testid="rest-sidebar-reference" className={cx('f6 pl-4 pb-1 color-fg-muted')}>
{t('rest.reference.api_reference')}
</span>
</div>
<li className="my-3">
<ul className="list-style-none">
{restPages.map((childPage, i) => {
const isStandaloneCategory = childPage.page.documentType === 'article'
const childTitle = childPage.renderedShortTitle || childPage.renderedFullTitle
const isActive =
routePath.includes(childPage.href + '/') || routePath === childPage.href
const defaultOpen = hasExactCategory ? isActive : false
return (
<li
data-testid="rest-sidebar-items"
key={childPage.href + i}
data-is-active-category={isActive}
data-is-current-page={isActive && isStandaloneCategory}
className={cx('py-1', isActive && 'color-bg-inset')}
>
<RestCollapsibleSection
defaultOpen={defaultOpen}
routePath={routePath}
title={childTitle}
page={childPage}
isStandaloneCategory={isStandaloneCategory}
/>
</li>
)
})}
</ul>
</li>
</>
)
}
return (
<ul data-testid="sidebar" className={styles.container}>
<AllProductsLink />
@@ -49,160 +171,9 @@ export const SidebarProduct = () => {
{productTitle}
</Link>
</li>
<li className="my-3">
<ul className="list-style-none">
{currentProductTree.childPages.map((childPage, i) => {
const isStandaloneCategory = childPage.page.documentType === 'article'
const childTitle = childPage.renderedShortTitle || childPage.renderedFullTitle
const isActive =
routePath.includes(childPage.href + '/') || routePath === childPage.href
const defaultOpen = hasExactCategory ? isActive : false
return (
<li
key={childPage.href + i}
data-is-active-category={isActive}
data-is-current-page={isActive && isStandaloneCategory}
className={cx('py-1', isActive && 'color-bg-inset')}
>
{isStandaloneCategory ? (
<Link
href={childPage.href}
className="pl-4 pr-2 py-2 d-block flex-auto mr-3 color-fg-default no-underline text-bold"
>
{childTitle}
</Link>
) : (
<CollapsibleSection
defaultOpen={defaultOpen}
routePath={routePath}
title={childTitle}
page={childPage}
/>
)}
</li>
)
})}
</ul>
</li>
{currentProduct && currentProduct.id === 'rest' ? restSection() : productSection()}
</>
)}
</ul>
)
}
type SectionProps = {
routePath: string
page: ProductTreeNode
title: string
defaultOpen: boolean
}
const CollapsibleSection = (props: SectionProps) => {
const { routePath, defaultOpen, title, page } = props
const [isOpen, setIsOpen] = useState(defaultOpen)
const onToggle = (e: SyntheticEvent) => {
const newIsOpen = (e.target as HTMLDetailsElement).open
setIsOpen(newIsOpen)
sendEvent({
type: EventType.navigate,
navigate_label: `details ${newIsOpen ? 'open' : 'close'}: ${title}`,
})
}
// The lowest level page link displayed in the tree
const renderTerminalPageLink = (page: ProductTreeNode) => {
const title = page.renderedShortTitle || page.renderedFullTitle
const isCurrent = routePath === page.href
return {
text: title,
renderItem: () => (
<ActionList.Item
data-testid="sidebar-article"
data-is-current-page={isCurrent}
as="li"
className={cx(
'position-relative',
styles.sidebarArticle,
isCurrent && ['text-bold', styles.sidebarArticleActive]
)}
sx={{
padding: '2px 0',
':hover': {
borderRadius: 0,
},
}}
>
<Link
href={page.href}
className={cx(
'd-block pl-6 pr-5 py-1 no-underline width-full',
isCurrent ? 'color-fg-accent' : 'color-fg-default'
)}
>
{title}
</Link>
</ActionList.Item>
),
}
}
return (
<details open={defaultOpen} onToggle={onToggle} className="details-reset">
<summary className="outline-none">
<div className="d-flex flex-justify-between">
<div className="pl-4 pr-1 py-2 f5 d-block flex-auto mr-3 color-fg-default no-underline text-bold">
{title}
</div>
<span style={{ marginTop: 7 }} className="flex-shrink-0 pr-3">
<ChevronDownIcon className={cx('opacity-60', isOpen && 'rotate-180')} />
</span>
</div>
</summary>
{
<>
{/* <!-- some pages have nested child pages (formerly known as a mapTopic) --> */}
{page.childPages[0]?.page.documentType === 'mapTopic' ? (
<ul className="list-style-none position-relative">
{page.childPages.map((childPage, i) => {
const childTitle = childPage.renderedShortTitle || childPage.renderedFullTitle
const isActive = routePath.includes(childPage.href)
const isCurrent = routePath === childPage.href
return (
<li key={childPage.href + i} data-is-current-page={isCurrent}>
<details
open={isActive}
onToggle={(e) => e.stopPropagation()}
className="details-reset"
>
<summary>
<div className={cx('pl-4 pr-5 py-2 no-underline')}>{childTitle}</div>
</summary>
<div data-testid="sidebar-article-group" className="pb-0">
<ActionList
{...{ as: 'ul' }}
items={childPage.childPages.map((cp) => {
return renderTerminalPageLink(cp)
})}
></ActionList>
</div>
</details>
</li>
)
})}
</ul>
) : page.childPages[0]?.page.documentType === 'article' ? (
<div data-testid="sidebar-article-group" className="pb-0">
<ActionList {...{ as: 'ul' }} items={page.childPages.map(renderTerminalPageLink)} />
</div>
) : null}
</>
}
</details>
)
}

View File

@@ -12,7 +12,8 @@
[class~="code-extra"] {
margin-top: 1.5rem;
pre {
pre,
div {
margin-top: 0 !important;
border-top-left-radius: 0 !important;
border-top-right-radius: 0 !important;

View File

@@ -16,7 +16,7 @@ topics:
shortTitle: Organization's profile
---
You can optionally choose to add a description, location, website, and email address for your organization, and pin important repositories.{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-4749 %} You can customize your organization's profile by adding a README.md file. For more information, see "[Customizing your organization's profile](/organizations/collaborating-with-groups-in-organizations/customizing-your-organizations-profile)."{% endif %}
You can optionally choose to add a description, location, website, and email address for your organization, and pin important repositories.{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-4749 %} You can customize your organization's public profile by adding a README.md file. For more information, see "[Customizing your organization's profile](/organizations/collaborating-with-groups-in-organizations/customizing-your-organizations-profile)."{% endif %}
{% ifversion fpt %}
Organizations that use {% data variables.product.prodname_ghe_cloud %} can confirm their organization's identity and display a "Verified" badge on their organization's profile page by verifying the organization's domains with {% data variables.product.product_name %}. For more information, see "[Verifying or approving a domain for your organization](/organizations/managing-organization-settings/verifying-or-approving-a-domain-for-your-organization)" in the {% data variables.product.prodname_ghe_cloud %} documenatation.

View File

@@ -65,7 +65,7 @@ jobs:
java-version: '11'
distribution: 'adopt'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify
run: mvn --batch-mode --update-snapshots package
```
This workflow performs the following steps:

View File

@@ -28,6 +28,14 @@ You can add self-hosted runners at various levels in the management hierarchy:
{% data reusables.actions.self-hosted-runner-architecture %} {% data reusables.actions.runner-app-open-source %} When a new version is released, the runner application automatically updates itself when a job is assigned to the runner, or within a week of release if the runner hasn't been assigned any jobs.
{% ifversion ghes %}
{% note %}
**Note:** {% data reusables.actions.upgrade-runners-before-upgrade-ghes %}
{% endnote %}
{% endif %}
{% data reusables.actions.self-hosted-runner-auto-removal %}
For more information about installing and using self-hosted runners, see "[Adding self-hosted runners](/github/automating-your-workflow-with-github-actions/adding-self-hosted-runners)" and "[Using self-hosted runners in a workflow](/github/automating-your-workflow-with-github-actions/using-self-hosted-runners-in-a-workflow)."
@@ -45,7 +53,7 @@ For more information about installing and using self-hosted runners, see "[Addin
- Use free minutes on your {% data variables.product.prodname_dotcom %} plan, with per-minute rates applied after surpassing the free minutes.
**Self-hosted runners:**{% endif %}
- Receive automatic updates for the self-hosted runner application only{% ifversion fpt or ghec or ghes > 3.2 %}, though you may disable automatic updates of the runner. For more information about controlling runner software updates on self-hosted runners, see "[Autoscaling with self-hosted runners](/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#controlling-runner-software-updates-on-self-hosted-runners)."{% else %}.{% endif %} You are responsible for updating the operating system and all other software.
- Receive automatic updates for the self-hosted runner application only{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6143 %}, though you may disable automatic updates of the runner. For more information about controlling runner software updates on self-hosted runners, see "[Autoscaling with self-hosted runners](/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#controlling-runner-software-updates-on-self-hosted-runners)."{% else %}.{% endif %} You are responsible for updating the operating system and all other software.
- Can use cloud services or local machines that you already pay for.
- Are customizable to your hardware, operating system, software, and security requirements.
- Don't need to have a clean instance for every job execution.

View File

@@ -54,6 +54,8 @@ The {% data variables.product.prodname_actions %} service will then automaticall
{% endnote %}
{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6143 %}
## Controlling runner software updates on self-hosted runners
By default, self-hosted runners will automatically perform a software update whenever a new version of the runner software is available. If you use ephemeral runners in containers then this can lead to repeated software updates when a new runner version is released. Turning off automatic updates allows you to update the runner version on the container image directly on your own schedule.
@@ -76,6 +78,8 @@ For instructions on how to install the latest runner version, see the installati
{% endnote %}
{% endif %}
## Using webhooks for autoscaling
You can create your own autoscaling environment by using payloads received from the [`workflow_job`](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job) webhook. This webhook is available at the repository, organization, and enterprise levels, and the payload for this event contains an `action` key that corresponds to the stages of a workflow job's life-cycle; for example when jobs are `queued`, `in_progress`, and `completed`. You must then create your own scaling automation in response to these webhook payloads.

View File

@@ -258,3 +258,11 @@ User=runner-user
```
{% endlinux %}
{% ifversion ghes %}
## Resolving runners that are offline after an upgrade of {% data variables.product.product_location %}
{% data reusables.actions.upgrade-runners-before-upgrade-ghes %}
If your runners are offline for this reason, manually update the runners. For more information, see the installation instructions for [the latest release](https://github.com/actions/runner/releases/latest) in the actions/runner repository.
{% endif %}

View File

@@ -50,7 +50,7 @@ Setting secondary rate limits protects the overall level of service on {% data v
3. Type limits for Total Requests, CPU Limit, and CPU Limit for Searching, or accept the pre-filled default limits.
{% data reusables.enterprise_management_console.save-settings %}
## Enabling Git rate limits
## Enabling rate limits for Git
You can apply Git rate limits per repository network or per user ID. Git rate limits are expressed in concurrent operations per minute, and are adaptive based on the current CPU load.
@@ -61,3 +61,44 @@ You can apply Git rate limits per repository network or per user ID. Git rate li
3. Type limits for each repository network or user ID.
![Fields for repository network and user ID limits](/assets/images/enterprise/management-console/example-git-rate-limits.png)
{% data reusables.enterprise_management_console.save-settings %}
{% ifversion ghes > 3.4 %}
## Configuring rate limits for {% data variables.product.prodname_actions %}
You can apply a rate limit to {% data variables.product.prodname_actions %} workflow runs. For more information about {% data variables.product.prodname_actions %}, see "[About {% data variables.product.prodname_actions %} for enterprises](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/about-github-actions-for-enterprises)."
### About rate limits for {% data variables.product.prodname_actions %}
Your {% data variables.product.product_name %} instance assigns each {% data variables.product.prodname_actions %} workflow job to a runner. If your instance cannot immediately assign a job to an available runner, the job will wait in a queue until a runner is available. If {% data variables.product.prodname_actions %} experiences sustained high load, the queue can back up, and the performance of {% data variables.product.product_location %} may degrade.
To avoid this performance degradation, you can configure a rate limit for {% data variables.product.prodname_actions %}. This rate limit is expressed in job runs per minute. {% data variables.product.product_name %} calculates and applies the rate limit for the sum total of all job runs on the instance. If runs exceed the rate limit, additional runs will fail instead of entering the queue. The following error will appear in the run's annotations.
> You've exceeded the rate limit for workflow run requests. Please wait before retrying the run.
An appropriate rate limit protects {% data variables.product.product_location %} from abnormal usage of {% data variables.product.prodname_actions %} without interfering with day-to-day operations. The exact threshold depends on your instance's available resources and overall load profile. For more information about the hardware requirements for {% data variables.product.prodname_actions %}, see "[Getting started with {% data variables.product.prodname_actions %} for {% data variables.product.product_name %}](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server#review-hardware-requirements)."
By default, the rate limit for {% data variables.product.prodname_actions %} is disabled. Because {% data variables.product.product_name %} can handle temporary spikes in usage without performance degradation, this rate limit is intended to protect against sustained high load. We recommend leaving the rate limit disabled unless you are experiencing performance problems. In some cases, {% data variables.contact.github_support %} may recommend that you enable a rate limit for {% data variables.product.prodname_actions %}.
### Enabling or disabling rate limits for {% data variables.product.prodname_actions %}
{% data reusables.enterprise_installation.ssh-into-instance %}
1. To enable and configure the rate limit, run the following two commands, replacing **RUNS-PER-MINUTE** with the value of your choice.
```shell
ghe-config actions-rate-limiting.enabled true
ghe-config actions-rate-limiting.queue-runs-per-minute <em>RUNS-PER-MINUTE</em>
```
1. To disable the rate limit after it's been enabled, run the following command.
```
ghe-config actions-rate-limiting.enabled false
```
1. To apply the configuration, run the following command.
```
ghe-config-apply
```
1. Wait for the configuration run to complete.
{% endif %}

View File

@@ -28,8 +28,9 @@ shortTitle: Upgrading GHES
## Preparing to upgrade
1. Determine an upgrade strategy and choose a version to upgrade to. For more information, see "[Upgrade requirements](/enterprise/{{ currentVersion }}/admin/guides/installation/upgrade-requirements/)" and refer to the [{% data variables.enterprise.upgrade_assistant %}](https://support.github.com/enterprise/server-upgrade) to find the upgrade path from your current release version.
3. Create a fresh backup of your primary instance with the {% data variables.product.prodname_enterprise_backup_utilities %}. For more information, see the [{% data variables.product.prodname_enterprise_backup_utilities %} README.md file](https://github.com/github/backup-utils#readme).
4. If you are upgrading using an upgrade package, schedule a maintenance window for {% data variables.product.prodname_ghe_server %} end users. If you are using a hotpatch, maintenance mode is not required.
1. Create a fresh backup of your primary instance with the {% data variables.product.prodname_enterprise_backup_utilities %}. For more information, see the [{% data variables.product.prodname_enterprise_backup_utilities %} README.md file](https://github.com/github/backup-utils#readme).
1. If {% data variables.product.product_location %} uses ephemeral self-hosted runners for {% data variables.product.prodname_actions %} and you've disabled automatic updates, upgrade your runners to the version of the runner application that your upgraded instance will run.
1. If you are upgrading using an upgrade package, schedule a maintenance window for {% data variables.product.prodname_ghe_server %} end users. If you are using a hotpatch, maintenance mode is not required.
{% note %}

View File

@@ -94,6 +94,12 @@ For more information about minimum hardware requirements for {% data variables.p
{% data reusables.enterprise_installation.about-adjusting-resources %}
{% ifversion ghes > 3.4 %}
Optionally, you can limit resource consumption on {% data variables.product.product_location %} by configuring a rate limit for {% data variables.product.prodname_actions %}. For more information, see "[Configuring rate limits](/admin/configuration/configuring-your-enterprise/configuring-rate-limits#configuring-rate-limits-for-github-actions)."
{% endif %}
## External storage requirements
To enable {% data variables.product.prodname_actions %} on {% data variables.product.prodname_ghe_server %}, you must have access to external blob storage.

View File

@@ -161,6 +161,11 @@ This uploads the database as an actions artifact that you can download to your l
The artifact will contain an archived copy of the source files scanned by {% data variables.product.prodname_codeql %} called _src.zip_. If you compare the source code files in the repository and the files in _src.zip_, you can see which types of file are missing. Once you know what types of file are not being analyzed, it is easier to understand how you may need to change the workflow for {% data variables.product.prodname_codeql %} analysis.
## Alerts found in generated code
{% data reusables.code-scanning.alerts-found-in-generated-code %}
## Extraction errors in the database
The {% data variables.product.prodname_codeql %} team constantly works on critical extraction errors to make sure that all source files can be scanned. However, the {% data variables.product.prodname_codeql %} extractors do occasionally generate errors during database creation. {% data variables.product.prodname_codeql %} provides information about extraction errors and warnings generated during database creation in a log file.
@@ -191,11 +196,9 @@ The default {% data variables.product.prodname_codeql_workflow %} uses a build m
Analysis time is typically proportional to the amount of code being analyzed. You can reduce the analysis time by reducing the amount of code being analyzed at once, for example, by excluding test code, or breaking analysis into multiple workflows that analyze only a subset of your code at a time.
For compiled languages like Java, C, C++, and C#, {% data variables.product.prodname_codeql %} analyzes all of the code which was built during the workflow run. To limit the amount of code being analyzed, build only the code which you wish to analyze by specifying your own build steps in a `run` block. You can combine specifying your own build steps with using the `paths` or `paths-ignore` filters on the `pull_request` and `push` events to ensure that your workflow only runs when specific code is changed. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)."
{% data reusables.code-scanning.alerts-found-in-generated-code %}
For languages like Go, JavaScript, Python, and TypeScript, that {% data variables.product.prodname_codeql %} analyzes without compiling the source code, you can specify additional configuration options to limit the amount of code to analyze. For more information, see "[Specifying directories to scan](/code-security/secure-coding/configuring-code-scanning#specifying-directories-to-scan)."
If you split your analysis into multiple workflows as described above, we still recommend that you have at least one workflow which runs on a `schedule` which analyzes all of the code in your repository. Because {% data variables.product.prodname_codeql %} analyzes data flows between components, some complex security behaviors may only be detected on a complete build.
If you split your analysis into multiple workflows as described above, we still recommend that you have at least one workflow which runs on a `schedule` which analyzes all of the code in your repository. Because {% data variables.product.prodname_codeql %} analyzes data flows between components, some complex security behaviors may only be detected on a complete build.
### Run only during a `schedule` event

View File

@@ -64,7 +64,7 @@ You need to make the full contents of the {% data variables.product.prodname_cod
```shell
$ wget https://{% ifversion fpt or ghec %}github.com{% else %}<em>HOSTNAME</em>{% endif %}/github/codeql-action/releases/latest/download/codeql-bundle-linux64.tar.gz
$ tar -xvzf ../codeql-bundle-linux64.tar.gz
$ tar -xvzf ./codeql-bundle-linux64.tar.gz
```
After you extract the {% data variables.product.prodname_codeql_cli %} bundle, you can run the `codeql` executable on the server:

View File

@@ -66,7 +66,7 @@ The recommended formats explicitly define which versions are used for all direct
| Package manager | Languages | Recommended formats | All supported formats |
| --- | --- | --- | ---|
| Composer | PHP | `composer.lock` | `composer.json`, `composer.lock` |
| `dotnet` CLI | .NET languages (C#, C++, F#, VB) | `.csproj`, `.vbproj`, `.nuspec`, `.vcxproj`, `.fsproj` | `.csproj`, `.vbproj`, `.nuspec`, `.vcxproj`, `.fsproj`, `packages.config` |
| NuGet | .NET languages (C#, F#, VB), C++ | `.csproj`, `.vbproj`, `.nuspec`, `.vcxproj`, `.fsproj` | `.csproj`, `.vbproj`, `.nuspec`, `.vcxproj`, `.fsproj`, `packages.config` |
{%- if github-actions-in-dependency-graph %}
| {% data variables.product.prodname_actions %} workflows<sup>[1]</sup> | YAML | `.yml`, `.yaml` | `.yml`, `.yaml` |
{%- endif %}

View File

@@ -198,7 +198,7 @@ The `devcontainer.json` file is written using the JSONC format. This allows you
{% note %}
**Note**: If you use a linter to valid the `devcontainer.json` file, make sure it is set to JSONC and not JSON or comments will be reported as errors.
**Note**: If you use a linter to validate the `devcontainer.json` file, make sure it is set to JSONC and not JSON or comments will be reported as errors.
{% endnote %}

View File

@@ -122,6 +122,7 @@ Webhook event name | Required permission | Description
[`pull_request`](/webhooks/event-payloads/#pull_request) | `pull_requests` | {% data reusables.webhooks.pull_request_short_desc %}
[`pull_request_review`](/webhooks/event-payloads/#pull_request_review) | `pull_request` | {% data reusables.webhooks.pull_request_review_short_desc %}
[`pull_request_review_comment`](/webhooks/event-payloads/#pull_request_review_comment) | `pull_request` | {% data reusables.webhooks.pull_request_review_comment_short_desc %}
[`pull_request_review_thread`](/webhooks/event-payloads/#pull_request_review_thread) | `pull_request` | {% data reusables.webhooks.pull_request_review_thread_short_desc %}
[`push`](/webhooks/event-payloads/#push) | `contents` | {% data reusables.webhooks.push_short_desc %}
[`release`](/webhooks/event-payloads/#release) | `contents` | {% data reusables.webhooks.release_short_desc %}
[`repository`](/webhooks/event-payloads/#repository) |`metadata` | {% data reusables.webhooks.repository_short_desc %}{% ifversion fpt or ghec %}

View File

@@ -207,6 +207,16 @@ Key | Type | Description
{% data reusables.webhooks.pull_request_review_comment_event_api_properties %}
{% data reusables.webhooks.pull_request_review_comment_properties %}
## PullRequestReviewThreadEvent
{% data reusables.webhooks.pull_request_review_thread_short_desc %}
{% data reusables.webhooks.events_api_payload %}
### Event `payload` object
{% data reusables.webhooks.pull_request_thread_properties %}
## PushEvent
{% data reusables.webhooks.push_short_desc %}

View File

@@ -1060,6 +1060,28 @@ Deliveries for `review_requested` and `review_request_removed` events will have
{{ webhookPayloadsForCurrentVersion.pull_request_review_comment.created }}
## pull_request_review_thread
{% data reusables.webhooks.pull_request_review_thread_short_desc %}
### Availability
- Repository webhooks
- Organization webhooks
- {% data variables.product.prodname_github_apps %} with the `pull_requests` permission
### Webhook payload object
{% data reusables.webhooks.pull_request_thread_properties %}
{% data reusables.webhooks.repo_desc %}
{% data reusables.webhooks.org_desc %}
{% data reusables.webhooks.app_desc %}
{% data reusables.webhooks.sender_desc %}
### Webhook payload example
{{ webhookPayloadsForCurrentVersion.pull_request_review_thread.resolved }}
## push
{% data reusables.webhooks.push_short_desc %}
@@ -1161,7 +1183,7 @@ This event occurs when a {% data variables.product.prodname_github_app %} sends
Key | Type | Description
----|------|-------------
`action` |`string` | The action that was performed. This can be one of:<ul><li>`created` - A repository is created.</li><li>`deleted` - A repository is deleted.</li><li>`archived` - A repository is archived.</li><li>`unarchived` - A repository is unarchived.</li>{% ifversion ghes or ghae %}<li>`anonymous_access_enabled` - A repository is [enabled for anonymous Git access](/rest/overview/api-previews#anonymous-git-access-to-repositories), `anonymous_access_disabled` - A repository is [disabled for anonymous Git access](/rest/overview/api-previews#anonymous-git-access-to-repositories)</li>{% endif %}<li>`edited` - A repository's information is edited.</li><li>`renamed` - A repository is renamed.</li><li>`transferred` - A repository is transferred.</li><li>`publicized` - A repository is made public.</li><li> `privatized` - A repository is made private.</li></ul>
`action` |`string` | The action that was performed. This can be one of:<ul><li>`created` - A repository is created.</li><li>`deleted` - A repository is deleted.</li><li>`archived` - A repository is archived.</li><li>`unarchived` - A repository is unarchived.</li>{% ifversion ghes or ghae %}<li>`anonymous_access_enabled` - A repository is [enabled for anonymous Git access](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise), `anonymous_access_disabled` - A repository is [disabled for anonymous Git access](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise)</li>{% endif %}<li>`edited` - A repository's information is edited.</li><li>`renamed` - A repository is renamed.</li><li>`transferred` - A repository is transferred.</li><li>`publicized` - A repository is made public.</li><li> `privatized` - A repository is made private.</li></ul>
{% data reusables.webhooks.repo_desc %}
{% data reusables.webhooks.org_desc %}
{% data reusables.webhooks.app_desc %}

View File

@@ -1,6 +1,6 @@
---
title: Customizing your organization's profile
intro: You can share information about your organization by customizing your organization's profile
intro: You can share information about your organization by customizing your organization's profile.
versions:
fpt: '*'
ghec: '*'
@@ -11,19 +11,70 @@ topics:
shortTitle: Customize organization profile
---
## About your organization's profile README
{% if org-profile-pin-private %}
You can share information about how to engage with your organization by creating an organization profile README. {% data variables.product.prodname_dotcom %} shows your organization profile README in the "Overview" tab of your organization.
## About your organization's profile page
You can choose what information to include your organization profile README. Here are some examples of information that may be helpful in your organization's profile README.
You can customize your organization's Overview page to show content dedicated to public users or members of the organization. Members of your organization who are signed into {% data variables.product.prodname_dotcom %}, are shown a member view when they visit your organization's profile page. Users who are not members of your organization will be shown a public view.
![Image of an organization profile page](/assets/images/help/organizations/new_organization_page.png)
{% endif %}
### Pinned repositories
You can give users easy access to important or frequently used repositories, by choosing up to six repositories for public users and six repositories for members of the organization. Once you pin repositories to your organization profile, the "Pinned" section is shown above the "Repositories" section of the profile page.
Only organization owners can pin repositories. For more information, see "[Pinning repositories to your organization's profile](#pinning-repositories-to-your-organizations-profile)."
### Organization profile READMEs
You can share information about how to engage with your organization by creating an organization profile README for both public users and members of the organization. {% data variables.product.prodname_dotcom %} shows your organization profile README in the "Overview" tab of your organization.
You can choose what information to include in your organization profile README. Here are some examples of information that may be helpful.
- An "About" section that describes your organization
- Guidance for getting help in the organization
You can format text and include emoji, images, and GIFs in your organization profile README by using {% data variables.product.company_short %} Flavored Markdown. For more information, see "[Getting started with writing and formatting on {% data variables.product.prodname_dotcom %}](/github/writing-on-github/getting-started-with-writing-and-formatting-on-github)."
## Adding an organization profile README
## Adding a public organization profile README
1. If your organization does not already have a public `.github` repository, create a public `.github` repository.
2. In your organization's `.github` repository, create a `README.md` file in the `profile` folder.
3. Commit the changes to the `README.md` file. The content of the `README.md` will appear on your organization's profile.
3. Commit the changes to the `README.md` file. The content of the `README.md` will appear on your organization's public profile.
![Image of an organization's public README](/assets/images/help/organizations/org_public_readme.png)
{% if org-profile-pin-private %}
## Adding a member-only organization profile README
1. If your organization does not already have a `.github-private` repository, create a public `.github-private` repository. This action can be performed by any user that has write access to that repository.
2. In your organization's `.github-private` repository, create a `README.md` file in the `profile` folder.
3. Commit the changes to the `README.md` file. The content of the `README.md` will be displayed in the member view of your organization's profile.
![Image of an organization's private README](/assets/images/help/organizations/org_member_readme.png)
## Pinning repositories to your organization's profile
You can pin repositories that you want to feature, such as those that are frequently used, to your organization's profile page. To choose which repositories to pin to your organization's profile, you must be an organization owner or administrator.
1. Navigate to your organization's profile page.
2. In the right sidebar of the page in the {% octicon "eye" aria-label="The eye octicon" %} "View as" link, choose the **Public** or **Member** profile view from the dropdown menu.
![Image of the organization profile view dropdown](/assets/images/help/organizations/org_profile_view.png)
3. In the pinned repositories section, select **Customize pins**.
![Image of the customize pins link](/assets/images/help/organizations/customize_pins_link.png)
- If you haven't yet pinned any repositories to your organization's profile, you'll need to instead click **pin repositories** in the right sidebar of the profile page.
![Image of pin repositories link in right sidebar](/assets/images/help/organizations/pin_repositories_link.png)
4. In the "Edit pinned repositories" dialog box, select a combination of up to six public, {% ifversion not fpt %}private, or internal{% else %}or private{% endif %} repositories to display.
![Image of pinned repo dialog](/assets/images/help/organizations/pinned_repo_dialog.png)
5. Click **Save pins**.
{% endif %}

View File

@@ -0,0 +1,15 @@
---
title: Artifacts
intro: 'The Artifacts API allows you to download, delete, and retrieve information about workflow artifacts.'
topics:
- API
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
{% data reusables.actions.about-artifacts %} For more information, see "[Persisting workflow data using artifacts](/actions/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts)."
{% data reusables.actions.actions-authentication %} {% data reusables.actions.actions-app-actions-permissions-api %}

View File

@@ -1,3 +1,11 @@
## Cache
---
title: Cache
intro: 'The Cache API allows you to query and manage the {% data variables.product.prodname_actions %} cache for repositories.'
topics:
- API
versions:
fpt: '*'
ghec: '*'
---
The cache API allows you to query and manage the {% data variables.product.prodname_actions %} cache for repositories. For more information, see "[Caching dependencies to speed up workflows](/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy)."
The cache API allows you to query and manage the {% data variables.product.prodname_actions %} cache for repositories. For more information, see "[Caching dependencies to speed up workflows](/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy)."

View File

@@ -0,0 +1,26 @@
---
title: Actions
intro: 'With the Actions API, you can manage and control {% data variables.product.prodname_actions %} for an organization or repository.'
redirect_from:
- /v3/actions
- /rest/reference/actions
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- API
miniTocMaxHeadingLevel: 3
children:
- /artifacts
- /cache
- /permissions
- /secrets
- /self-hosted-runner-groups
- /self-hosted-runners
- /workflow-jobs
- /workflow-runs
- /workflows
---
The {% data variables.product.prodname_actions %} API enables you to manage {% data variables.product.prodname_actions %} using the REST API. {% data reusables.actions.actions-authentication %} {% data variables.product.prodname_github_apps %} require the permissions mentioned in each endpoint. For more information, see "[{% data variables.product.prodname_actions %} Documentation](/actions)."

View File

@@ -1,3 +1,15 @@
---
title: Permissions
intro: 'The Permissions API allows you to set permissions for what enterprises, organizations, and repositories are allowed to run {% data variables.product.prodname_actions %}, and what actions{% if actions-workflow-policy %} and reusable workflows{% endif %} are allowed to run.'
topics:
- API
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
## Permissions
The Permissions API allows you to set permissions for what enterprises, organizations, and repositories are allowed to run {% data variables.product.prodname_actions %}, and what actions{% if actions-workflow-policy %} and reusable workflows{% endif %} are allowed to run.{% ifversion fpt or ghec or ghes %} For more information, see "[Usage limits, billing, and administration](/actions/reference/usage-limits-billing-and-administration#disabling-or-limiting-github-actions-for-your-repository-or-organization)."{% endif %}

View File

@@ -0,0 +1,15 @@
---
title: Secrets
intro: 'The Secrets API lets you create, update, delete, and retrieve information about encrypted secrets. '
topics:
- API
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
{% data reusables.actions.about-secrets %} For more information, see "[Creating and using encrypted secrets](/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)."
{% data reusables.actions.actions-authentication %} {% data variables.product.prodname_github_apps %} must have the `secrets` permission to use this API. Authenticated users must have collaborator access to a repository to create, update, or read secrets.

View File

@@ -1,3 +1,15 @@
---
title: Self-hosted runner groups
intro: 'The Self-hosted Runners Groups API allows you manage groups of self-hosted runners.'
topics:
- API
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
## Self-hosted runner groups
The Self-hosted Runners Groups API allows you manage groups of self-hosted runners. For more information, see "[Managing access to self-hosted runners using groups](/actions/hosting-your-own-runners/managing-access-to-self-hosted-runners-using-groups)."

View File

@@ -1,3 +1,15 @@
---
title: Self-hosted runners
intro: 'The Self-hosted Runners API allows you to register, view, and delete self-hosted runners.'
topics:
- API
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
## Self-hosted runners
The Self-hosted Runners API allows you to register, view, and delete self-hosted runners. {% data reusables.actions.about-self-hosted-runners %} For more information, see "[Hosting your own runners](/actions/hosting-your-own-runners)."

View File

@@ -0,0 +1,15 @@
---
title: Workflow jobs
intro: 'The Workflow Jobs API allows you to view logs and workflow jobs.'
topics:
- API
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
{% data reusables.actions.about-workflow-jobs %} For more information, see "[Workflow syntax for GitHub Actions](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions)".
{% data reusables.actions.actions-authentication %} {% data reusables.actions.actions-app-actions-permissions-api %}

View File

@@ -0,0 +1,15 @@
---
title: Workflow runs
intro: 'The Workflow Runs API allows you to view, re-run, cancel, and view logs for workflow runs.'
topics:
- API
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
{% data reusables.actions.about-workflow-runs %} For more information, see "[Managing a workflow run](/actions/automating-your-workflow-with-github-actions/managing-a-workflow-run)."
{% data reusables.actions.actions-authentication %} {% data reusables.actions.actions-app-actions-permissions-api %}

View File

@@ -0,0 +1,15 @@
---
title: Workflows
intro: 'The Workflows API allows you to view workflows for a repository.'
topics:
- API
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
{% data reusables.actions.about-workflows %} For more information, see "[Automating your workflow with GitHub Actions](/actions/automating-your-workflow-with-github-actions)."
{% data reusables.actions.actions-authentication %} {% data reusables.actions.actions-app-actions-permissions-api %}

View File

@@ -1,6 +1,17 @@
## Events
---
title: Events
intro: 'The Events API is a read-only API to the {% data variables.product.prodname_dotcom %} events.'
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- API
miniTocMaxHeadingLevel: 3
---
The Events API is a read-only API to the {% data variables.product.prodname_dotcom %} events. These events power the various activity streams on the site.
These events power the various activity streams on the site.
The Events API can return different types of events triggered by activity on {% data variables.product.product_name %}. For more information about the specific events that you can receive from the Events API, see "[{% data variables.product.prodname_dotcom %} Event types](/developers/webhooks-and-events/github-event-types)." An events API for repository issues is also available. For more information, see the "[Issue Events API](/rest/reference/issues#events)."

View File

@@ -1,4 +1,15 @@
## Feeds
---
title: Feeds
intro: ''
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- API
miniTocMaxHeadingLevel: 3
---
### Example of getting an Atom feed

View File

@@ -3,6 +3,7 @@ title: Activity
intro: 'The Activity API allows you to list events and feeds and manage notifications, starring, and watching for the authenticated user.'
redirect_from:
- /v3/activity
- /rest/reference/activity
versions:
fpt: '*'
ghes: '*'
@@ -11,8 +12,10 @@ versions:
topics:
- API
miniTocMaxHeadingLevel: 3
children:
- /events
- /feeds
- /notifications
- /starring
- /watching
---
<!--
Operations are automatically generated. Markdown for this page is located in data/reusables/rest-reference/activity
-->

View File

@@ -1,4 +1,15 @@
## Notifications
---
title: Notifications
intro: ''
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- API
miniTocMaxHeadingLevel: 3
---
Users receive notifications for conversations in repositories they watch including:

View File

@@ -1,6 +1,17 @@
## Starring
---
title: Starring
intro: 'Repository starring is a feature that lets users bookmark repositories.'
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- API
miniTocMaxHeadingLevel: 3
---
Repository starring is a feature that lets users bookmark repositories. Stars are shown next to repositories to show an approximate level of interest. Stars have no effect on notifications or the activity feed.
Stars are shown next to repositories to show an approximate level of interest. Stars have no effect on notifications or the activity feed.
### Starring vs. Watching

View File

@@ -0,0 +1,14 @@
---
title: Watching
intro: "Watching a repository registers the user to receive notifications on new discussions, as well as events in the user's activity feed."
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- API
miniTocMaxHeadingLevel: 3
---
For simple repository bookmarks, see "[Repository starring](/rest/reference/activity#starring)."

View File

@@ -1,3 +1,16 @@
---
title: Apps
intro: 'The GitHub Apps API enables you to retrieve the information about the installation as well as specific information about GitHub Apps.'
topics:
- API
miniTocMaxHeadingLevel: 3
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
{% data reusables.apps.general-apps-restrictions %}
This page lists endpoints that you can access while authenticated as a GitHub App. See "[Authenticating as a GitHub App](/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app)" to learn more.
@@ -6,4 +19,4 @@ When authenticated as a GitHub App, the GitHub Apps API enables you to get high-
You can access REST API v3 endpoints while authenticated as a GitHub App. These endpoints have a "Notes" section that contains a bullet point that says "Works with GitHub Apps." You can also access these endpoints while authenticated as a user.
A subset of REST API v3 endpoints requires authenticating as a GitHub App installation. See [Installations](/rest/reference/apps#installations) for a list of these endpoints.
A subset of REST API v3 endpoints requires authenticating as a GitHub App installation. See [Installations](/rest/reference/apps#installations) for a list of these endpoints.

View File

@@ -3,6 +3,7 @@ title: Apps
intro: The GitHub Apps API enables you to retrieve the information about the installation as well as specific information about GitHub Apps.
redirect_from:
- /v3/apps
- /rest/reference/apps
versions:
fpt: '*'
ghes: '*'
@@ -11,8 +12,10 @@ versions:
topics:
- API
miniTocMaxHeadingLevel: 3
children:
- /apps
- /installations
- /marketplace
- /oauth-applications
- /webhooks
---
<!--
Operations are automatically generated. Markdown for this page is located in data/reusables/rest-reference/apps
-->

View File

@@ -0,0 +1,16 @@
---
title: Installations
intro: 'The Installations API enables you to get information about installations of your GitHub App and perform actions within those installations.'
topics:
- API
miniTocMaxHeadingLevel: 3
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
An _installation_ refers to any user or organization account that has installed the app. For information on how to authenticate as an installation and limit access to specific repositories, see "[Authenticating as an installation](/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation)."
To list all GitHub App installations for an organization, see "[List app installations for an organization](/rest/reference/orgs#list-app-installations-for-an-organization)."

View File

@@ -1,4 +1,13 @@
## Marketplace
---
title: Marketplace
intro: ''
topics:
- API
miniTocMaxHeadingLevel: 3
versions:
fpt: '*'
ghec: '*'
---
For more information about {% data variables.product.prodname_marketplace %}, see "[GitHub Marketplace](/marketplace/)."
@@ -10,4 +19,4 @@ This API includes endpoints that allow you to [test your {% data variables.produ
To test with stubbed data, use a stubbed endpoint in place of its production counterpart. This allows you to test whether API logic succeeds before listing {% data variables.product.prodname_github_apps %} on {% data variables.product.prodname_marketplace %}.
Be sure to replace stubbed endpoints with production endpoints before deploying your {% data variables.product.prodname_github_app %}.
Be sure to replace stubbed endpoints with production endpoints before deploying your {% data variables.product.prodname_github_app %}.

View File

@@ -1,3 +1,14 @@
## OAuth Applications API
---
title: OAuth Applications
intro: ''
topics:
- API
miniTocMaxHeadingLevel: 3
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
You can use this API to manage the OAuth tokens an OAuth application uses to access people's accounts on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}.
You can use this API to manage the OAuth tokens an OAuth application uses to access people's accounts on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}.

View File

@@ -1,3 +1,14 @@
## Webhooks
---
title: Webhooks
intro: ''
topics:
- API
miniTocMaxHeadingLevel: 3
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
A {% data variables.product.prodname_github_app %}'s webhook allows you to receive HTTP `POST` payloads whenever certain events happen for an app. {% data reusables.webhooks.webhooks-rest-api-links %}
A {% data variables.product.prodname_github_app %}'s webhook allows you to receive HTTP `POST` payloads whenever certain events happen for an app. {% data reusables.webhooks.webhooks-rest-api-links %}

View File

@@ -1 +1,15 @@
---
title: Billing
intro: ''
topics:
- API
miniTocMaxHeadingLevel: 3
versions:
fpt: '*'
ghec: '*'
ghes: '>=3.4'
redirect_from:
- /rest/reference/billing
---
You can get billing information for an enterprise. For more information, see the "[{% data variables.product.prodname_dotcom %} Enterprise administration](/rest/reference/enterprise-admin#billing)" REST API.

View File

@@ -0,0 +1,13 @@
---
title: Protected branches
intro: ''
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- API
miniTocMaxHeadingLevel: 3
allowTitleToDifferFromFilename: true
---

View File

@@ -0,0 +1,12 @@
---
title: Branches
intro: 'The Branches API allows you to modify branches and their protection settings.'
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- API
miniTocMaxHeadingLevel: 3
---

View File

@@ -10,8 +10,9 @@ versions:
topics:
- API
miniTocMaxHeadingLevel: 3
children:
- /branches
- /branch-protection
redirect_from:
- /rest/reference/branches
---
<!--
Operations are automatically generated. Markdown for this page is located in data/reusables/rest-reference/branches
-->

View File

@@ -0,0 +1,20 @@
---
title: Checks
intro: 'With the Checks API, you can build {% data variables.product.prodname_github_apps %} that run powerful checks against the code changes in a repository.'
redirect_from:
- /v3/checks
- /rest/reference/checks
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- API
miniTocMaxHeadingLevel: 3
children:
- /runs
- /suites
---
You can create apps that perform continuous integration, code linting, or code scanning services and provide detailed feedback on commits. For more information, see "[Getting started with the checks API](/rest/guides/getting-started-with-the-checks-api)" and "[Creating CI tests with the Checks API](/apps/quickstart-guides/creating-ci-tests-with-the-checks-api/)."

Some files were not shown because too many files have changed in this diff Show More