Skip to content

Commit

Permalink
Merge pull request #16253 from github/repo-sync
Browse files Browse the repository at this point in the history
repo sync
  • Loading branch information
Octomerger authored Mar 14, 2022
2 parents 99283fa + 73d687a commit dc8b7b7
Show file tree
Hide file tree
Showing 320 changed files with 2,604 additions and 1,848 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/openapi-decorate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: EndBug/add-and-commit@756d9ea820f11931e591eaf57f25e0f5b903d5b2
with:
# The arguments for the `git add` command
add: 'lib/rest/static/decorated'
add: '["lib/rest/static/app", "lib/rest/static/decorated"]'

# The message for the commit
message: 'Add decorated OpenAPI schema files'
Expand Down
2 changes: 1 addition & 1 deletion components/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const DefaultLayout = (props: Props) => {
style={{ height: '100vh' }}
>
<Header />
<main id="main-content">
<main id="main-content" style={{ scrollMarginTop: '5rem' }}>
<DeprecationBanner />
<RestBanner />

Expand Down
9 changes: 1 addition & 8 deletions components/GenericError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ import Link from 'next/link'
import { useRouter } from 'next/router'

import { MarkGithubIcon, CommentDiscussionIcon } from '@primer/octicons-react'
import { useVersion } from 'components/hooks/useVersion'
import { Lead } from 'components/ui/Lead'

export function GenericError() {
const { isEnterprise } = useVersion()

return (
<div className="min-h-screen d-flex flex-column">
<Head>
Expand All @@ -28,11 +25,7 @@ export function GenericError() {
</p>
<a
id="contact-us"
href={
isEnterprise
? 'https://enterprise.github.com/support'
: 'https://support.github.com/contact'
}
href="https://support.github.com/contact"
className="btn btn-outline mt-2"
>
<CommentDiscussionIcon size="small" className="octicon mr-1" />
Expand Down
8 changes: 1 addition & 7 deletions components/page-footer/Support.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { PeopleIcon, CommentDiscussionIcon } from '@primer/octicons-react'

import { useTranslation } from 'components/hooks/useTranslation'
import { useVersion } from 'components/hooks/useVersion'
import { useMainContext } from 'components/context/MainContext'

export const Support = () => {
const { isEnterprise } = useVersion()
const { t } = useTranslation('support')
const { communityRedirect } = useMainContext()

Expand All @@ -25,11 +23,7 @@ export const Support = () => {
<div>
<a
id="contact-us"
href={
isEnterprise
? 'https://enterprise.github.com/support'
: 'https://support.github.com/contact'
}
href="https://support.github.com/contact"
className="Link—secondary text-bold"
>
<CommentDiscussionIcon size="small" className="octicon mr-1" />
Expand Down
2 changes: 1 addition & 1 deletion components/rest/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function CodeBlock({ verb, headingLang, codeBlock, highlight }: Props) {
>
<code>
{verb && (
<span className="color-bg-accent-emphasis color-fg-on-emphasis rounded-1 text-uppercase">
<span className="color-bg-accent-emphasis color-fg-on-emphasis rounded-1 text-uppercase p-1">
{verb}
</span>
)}{' '}
Expand Down
1 change: 1 addition & 0 deletions components/rest/RestParameterTable.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.parameterTable {
table-layout: fixed !important;
z-index: 0;

thead {
tr {
Expand Down
135 changes: 94 additions & 41 deletions components/rest/RestReferencePage.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { useState, useEffect } from 'react'
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 { ArticleTitle } from 'components/article/ArticleTitle'
import { useMainContext } from 'components/context/MainContext'
import { MarkdownContent } from 'components/ui/MarkdownContent'
import { Lead } from 'components/ui/Lead'
import { ArticleGridLayout } from 'components/article/ArticleGridLayout'
import { MiniTocItem } from 'components/context/ArticleContext'
import { RestCategoryOperationsT } from './types'
import { RestOperation } from './RestOperation'
import { MiniTocs } from 'components/ui/MiniTocs'
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,
Expand All @@ -37,9 +38,11 @@ export const RestReferencePage = ({
restOperations,
miniTocItems,
}: StructuredContentT) => {
const { t } = useTranslation('pages')
const { asPath } = useRouter()
const { page } = useMainContext()
const subcategories = Object.keys(restOperations)
const [collapsed, setCollapsed] = useState({} as Record<number, boolean>)

// We have some one-off redirects for rest api docs
// currently those are limited to the repos page, but
Expand Down Expand Up @@ -106,54 +109,104 @@ 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' }}
>
<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">
<ArticleGridLayout
topper={<ArticleTitle>{page.title}</ArticleTitle>}
intro={
<>
{page.introPlainText && (
<Lead data-testid="lead" data-search="lead">
{page.introPlainText}
</Lead>
)}
</>
}
toc={
<>
{miniTocItems && miniTocItems.length > 1 && (
<MiniTocs pageTitle={page.title} miniTocItems={miniTocItems} />
)}
</>
}
>
<div key={`restCategory-introContent`}>
<div dangerouslySetInnerHTML={{ __html: introContent }} />
<div className="container-xl px-3 px-md-6 my-4 mx-xl-12 mx-lg-12">
<h1>{page.title}</h1>
{page.introPlainText && (
<Lead data-testid="lead" data-search="lead" className="markdown-body">
{page.introPlainText}
</Lead>
)}
<div key={`restCategory-introContent`}>
<div dangerouslySetInnerHTML={{ __html: introContent }} />
</div>
<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">
<MarkdownContent>
{subcategories.map((subcategory, index) => (
<div key={`restCategory-${index}`}>
<div dangerouslySetInnerHTML={{ __html: descriptions[subcategory] }} />
{restOperations[subcategory].map((operation, index) => (
<RestOperation
key={`restOperation-${index}`}
operation={operation}
index={index}
/>
))}
</div>
))}
</MarkdownContent>
<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>
</ArticleGridLayout>
</div>
<MarkdownContent>
{subcategories.map((subcategory, index) => (
<div key={`restCategory-${index}`}>
<div dangerouslySetInnerHTML={{ __html: descriptions[subcategory] }} />
{restOperations[subcategory].map((operation, index) => (
<RestOperation key={`restOperation-${index}`} operation={operation} index={index} />
))}
</div>
))}
</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>
)
}
32 changes: 16 additions & 16 deletions components/ui/ScrollButton/ScrollButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ export const ScrollButton = ({ className, ariaLabel }: ScrollButtonPropsT) => {
const [show, setShow] = useState(false)

useEffect(() => {
// show scroll button only when view is scrolled down
const onScroll = function () {
const y = document.documentElement.scrollTop // get the height from page top
if (y < 100) {
setShow(false)
} else if (y >= 100) {
setShow(true)
}
}
window.addEventListener('scroll', onScroll)
// We cannot determine document.documentElement.scrollTop height because we set the height: 100vh and set overflow to auto to keep the header sticky
// That means window.scrollTop height is always 0
// Using IntersectionObserver we can detemine if the h1 header is in view or not. If not, we show the scroll to top button, if so, we hide it
const observer = new IntersectionObserver(
function (entries) {
if (entries[0].isIntersecting === false) {
setShow(true)
} else {
setShow(false)
}
},
{ threshold: [0] }
)

return () => {
window.removeEventListener('scroll', onScroll)
}
observer.observe(document.getElementsByTagName('h1')[0])
}, [])

const onClick = () => {
window.scrollTo(0, 0)
const topOfPage = document.getElementById('github-logo')
if (topOfPage) topOfPage.focus()
document?.getElementById('github-logo')?.focus()
document?.getElementById('main-content')?.scrollIntoView()
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ jobs:
# ...deployment-specific steps
```

For guidance on writing deployment-specific steps, see "[Finding deployment examples](#finding-deployment-examples)."

## Viewing deployment history

When a {% data variables.product.prodname_actions %} workflow deploys to an environment, the environment is displayed on the main page of the repository. For more information about viewing deployments to environments, see "[Viewing deployment history](/developers/overview/viewing-deployment-history)."
Expand Down Expand Up @@ -164,7 +166,7 @@ You can use a status badge to display the status of your deployment workflow. {%

For more information, see "[Adding a workflow status badge](/actions/managing-workflow-runs/adding-a-workflow-status-badge)."

## Next steps
## Finding deployment examples

This article demonstrated features of {% data variables.product.prodname_actions %} that you can add to your deployment workflows.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ You must ensure that the machine has the appropriate network access to communica

You can also use self-hosted runners with a proxy server. For more information, see "[Using a proxy server with self-hosted runners](/actions/automating-your-workflow-with-github-actions/using-a-proxy-server-with-self-hosted-runners)."

For more information about troubleshooting common network connectivity issues, see "[Monitoring and troubleshooting self-hosted runners](/actions/hosting-your-own-runners/monitoring-and-troubleshooting-self-hosted-runners#troubleshooting-network-connectivity)."

{% ifversion ghes %}

## Communication between self-hosted runners and {% data variables.product.prodname_dotcom_the_website %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ shortTitle: Monitor & troubleshoot
* **Active**: The runner is currently executing a job.
* **Offline**: The runner is not connected to {% data variables.product.product_name %}. This could be because the machine is offline, the self-hosted runner application is not running on the machine, or the self-hosted runner application cannot communicate with {% data variables.product.product_name %}.

## Checking self-hosted runner network connectivity
## Troubleshooting network connectivity

### Checking self-hosted runner network connectivity

You can use the self-hosted runner application's `run` script with the `--check` parameter to check that a self-hosted runner can access all required network services on {% data variables.product.product_location %}.

Expand Down Expand Up @@ -65,6 +67,27 @@ The script tests each service, and outputs either a `PASS` or `FAIL` for each on

If you have any failing checks, you should also verify that your self-hosted runner machine meets all the communication requirements. For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners#communication-requirements)."

### Disabling TLS certificate verification
{% ifversion ghes %}
By default, the self-hosted runner application verifies the TLS certificate for {% data variables.product.product_name %}. If your {% data variables.product.product_name %} has a self-signed or internally-issued certificate, you may wish to disable TLS certificate verification for testing purposes.
{% else %}
By default, the self-hosted runner application verifies the TLS certificate for {% data variables.product.product_name %}. If you encounter network problems, you may wish to disable TLS certificate verification for testing purposes.
{% endif %}

To disable TLS certification verification in the self-hosted runner application, set the `GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY` environment variable to `1` before configuring and running the self-hosted runner application.

```shell
export GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY=1
./config.sh --url <em>https://github.com/octo-org/octo-repo</em> --token
./run.sh
```

{% warning %}

**Warning**: Disabling TLS verification is not recommended since TLS provides privacy and data integrity between the self-hosted runner application and {% data variables.product.product_name %}. We recommend that you install the {% data variables.product.product_name %} certificate in the operating system certificate store for your self-hosted runner. For guidance on how to install the {% data variables.product.product_name %} certificate, check with your operating system vendor.

{% endwarning %}

## Reviewing the self-hosted runner application log files

You can monitor the status of the self-hosted runner application and its activities. Log files are kept in the `_diag` directory where you installed the runner application, and a new log is generated each time the application is started. The filename begins with *Runner_*, and is followed by a UTC timestamp of when the application was started.
Expand Down
Loading

0 comments on commit dc8b7b7

Please sign in to comment.