Skip to content

Commit 2523834

Browse files
authored
Merge pull request github#16297 from github/repo-sync
repo sync
2 parents f36f099 + f7ed50f commit 2523834

File tree

544 files changed

+10506
-5375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

544 files changed

+10506
-5375
lines changed

.github/workflows/azure-preview-env-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
rsync -rptovR ./user-code/content/./**/*.md ./content
166166
rsync -rptovR ./user-code/assets/./**/*.png ./assets
167167
rsync -rptovR ./user-code/data/./**/*.{yml,md} ./data
168-
rsync -rptovR ./user-code/components/./**/*.{ts,tsx} ./components
168+
rsync -rptovR ./user-code/components/./**/*.{scss,ts,tsx} ./components
169169
rsync -rptovR --ignore-missing-args ./user-code/lib/./**/*.{js,ts} ./lib
170170
rsync -rptovR --ignore-missing-args ./user-code/middleware/./**/*.{js,ts} ./middleware
171171
rsync -rptovR ./user-code/pages/./**/*.tsx ./pages
Binary file not shown.

components/rest/RestOperation.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export function RestOperation({ operation }: Props) {
4848
{previews && (
4949
<RestPreviewNotice slug={operation.slug} previews={operation['x-github'].previews} />
5050
)}
51+
<RestResponse responses={operation.responses} variant="error" />
5152
</div>
5253
)
5354
}

components/rest/RestResponse.tsx

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,44 @@
11
import { CodeResponse } from './types'
22
import { CodeBlock } from './CodeBlock'
3+
import { useTranslation } from 'components/hooks/useTranslation'
4+
import { RestResponseTable } from './RestResponseTable'
35

46
type Props = {
57
responses: Array<CodeResponse>
8+
variant?: 'non-error' | 'error'
69
}
710

8-
export function RestResponse({ responses }: Props) {
11+
export function RestResponse(props: Props) {
12+
const { responses, variant = 'non-error' } = props
13+
const { t } = useTranslation('products')
14+
15+
if (!responses || responses.length === 0) {
16+
return null
17+
}
18+
19+
const filteredResponses = responses.filter((response) => {
20+
const responseCode = parseInt(response.httpStatusCode)
21+
22+
if (variant === 'error') {
23+
return responseCode >= 400
24+
} else {
25+
return responseCode < 400
26+
}
27+
})
28+
29+
if (filteredResponses.length === 0) {
30+
return null
31+
}
32+
33+
if (variant === 'error') {
34+
return (
35+
<RestResponseTable heading={t('rest.reference.error_codes')} responses={filteredResponses} />
36+
)
37+
}
38+
939
return (
1040
<>
11-
{responses.map((response: CodeResponse, index: number) => {
41+
{filteredResponses.map((response, index) => {
1242
return (
1343
<div key={`${response.httpStatusMessage}-${index}}`}>
1444
<h4 dangerouslySetInnerHTML={{ __html: response.description }} />
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.restResponseTable {
2+
table-layout: fixed !important;
3+
4+
thead {
5+
tr {
6+
border-top: none;
7+
8+
th {
9+
border: 0;
10+
font-weight: normal;
11+
}
12+
13+
th:first-child {
14+
width: 25%;
15+
}
16+
17+
th:nth-child(2) {
18+
width: 75%;
19+
}
20+
}
21+
}
22+
23+
tr:nth-child(2n) {
24+
background: none !important;
25+
}
26+
27+
td {
28+
padding: 0.75rem 0.5rem !important;
29+
border: 0 !important;
30+
vertical-align: top;
31+
width: 100%;
32+
}
33+
34+
tbody {
35+
tr td:first-child {
36+
width: 30%;
37+
font-weight: bold;
38+
}
39+
40+
tr td:nth-child(2) {
41+
width: 70%;
42+
}
43+
44+
table tr td:not(:first-child) {
45+
font-weight: normal;
46+
}
47+
}
48+
}

components/rest/RestResponseTable.tsx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import cx from 'classnames'
2+
import { CodeResponse } from './types'
3+
import { useTranslation } from 'components/hooks/useTranslation'
4+
import styles from './RestResponseTable.module.scss'
5+
6+
type Props = {
7+
heading: string
8+
responses: Array<CodeResponse>
9+
}
10+
11+
export function RestResponseTable({ heading, responses }: Props) {
12+
const { t } = useTranslation('products')
13+
14+
return (
15+
<>
16+
<h4>{heading}</h4>
17+
<table className={cx(styles.restResponseTable)}>
18+
<thead>
19+
<tr className="text-left">
20+
<th>{t('rest.reference.http_status_code')}</th>
21+
<th>{t('rest.reference.description')}</th>
22+
</tr>
23+
</thead>
24+
<tbody>
25+
{responses.map((response, index) => {
26+
return (
27+
<tr key={`${response.description}-${index}}`}>
28+
<td>
29+
<code>{response.httpStatusCode}</code>
30+
</td>
31+
<td>
32+
{response.description ? (
33+
<div dangerouslySetInnerHTML={{ __html: response.description }} />
34+
) : (
35+
response.httpStatusMessage
36+
)}
37+
</td>
38+
</tr>
39+
)
40+
})}
41+
</tbody>
42+
</table>
43+
</>
44+
)
45+
}

components/ui/ScrollButton/ScrollButton.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ export const ScrollButton = ({ className, ariaLabel }: ScrollButtonPropsT) => {
2424
},
2525
{ threshold: [0] }
2626
)
27-
2827
observer.observe(document.getElementsByTagName('h1')[0])
28+
return () => {
29+
observer.disconnect()
30+
}
2931
}, [])
3032

3133
const onClick = () => {

content/actions/security-guides/automatic-token-authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ At the start of each workflow run, {% data variables.product.prodname_dotcom %}
2323

2424
When you enable {% data variables.product.prodname_actions %}, {% data variables.product.prodname_dotcom %} installs a {% data variables.product.prodname_github_app %} on your repository. The `GITHUB_TOKEN` secret is a {% data variables.product.prodname_github_app %} installation access token. You can use the installation access token to authenticate on behalf of the {% data variables.product.prodname_github_app %} installed on your repository. The token's permissions are limited to the repository that contains your workflow. For more information, see "[Permissions for the `GITHUB_TOKEN`](#permissions-for-the-github_token)."
2525

26-
Before each job begins, {% data variables.product.prodname_dotcom %} fetches an installation access token for the job. The token expires when the job is finished.
26+
Before each job begins, {% data variables.product.prodname_dotcom %} fetches an installation access token for the job. {% data reusables.actions.github-token-expiration %}
2727

2828
The token is also available in the `github.token` context. For more information, see "[Contexts](/actions/learn-github-actions/contexts#github-context)."
2929

content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,11 @@ For example, if a pull request contains a `feature` branch (the current scope) a
234234
## Usage limits and eviction policy
235235

236236
{% data variables.product.prodname_dotcom %} will remove any cache entries that have not been accessed in over 7 days. There is no limit on the number of caches you can store, but the total size of all caches in a repository is limited to 10 GB. If you exceed this limit, {% data variables.product.prodname_dotcom %} will save your cache but will begin evicting caches until the total size is less than 10 GB.
237+
238+
{% if actions-cache-management %}
239+
240+
## Managing caches
241+
242+
You can use the {% data variables.product.product_name %} REST API to manage your caches. At present, you can use the API to see your cache usage, with more functionality expected in future updates. For more information, see the "[Actions](/rest/reference/actions#cache)" REST API documentation.
243+
244+
{% endif %}

content/actions/using-workflows/workflow-syntax-for-github-actions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,12 @@ The maximum number of minutes to let a job run before {% data variables.product.
714714

715715
If the timeout exceeds the job execution time limit for the runner, the job will be canceled when the execution time limit is met instead. For more information about job execution time limits, see {% ifversion fpt or ghec or ghes %}"[Usage limits and billing](/actions/reference/usage-limits-billing-and-administration#usage-limits)" for {% data variables.product.prodname_dotcom %}-hosted runners and {% endif %}"[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners/#usage-limits){% ifversion fpt or ghec or ghes %}" for self-hosted runner usage limits.{% elsif ghae %}."{% endif %}
716716

717+
{% note %}
718+
719+
**Note:** {% data reusables.actions.github-token-expiration %} For self-hosted runners, the token may be the limiting factor if the job timeout is greater than 24 hours. For more information on the `GITHUB_TOKEN`, see "[About the `GITHUB_TOKEN` secret](/actions/security-guides/automatic-token-authentication#about-the-github_token-secret)."
720+
721+
{% endnote %}
722+
717723
## `jobs.<job_id>.strategy`
718724

719725
{% data reusables.actions.jobs.section-using-a-build-matrix-for-your-jobs-strategy %}

0 commit comments

Comments
 (0)