Skip to content

Commit bf206d5

Browse files
authored
Merge branch 'main' into patch-3
2 parents 638b2e5 + 86a0117 commit bf206d5

File tree

36 files changed

+423
-157
lines changed

36 files changed

+423
-157
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ jobs:
165165
rsync -rptovR ./user-code/components/./**/*.{ts,tsx} ./components
166166
rsync -rptovR --ignore-missing-args ./user-code/lib/./**/*.{js,ts} ./lib
167167
rsync -rptovR --ignore-missing-args ./user-code/middleware/./**/*.{js,ts} ./middleware
168-
rsync -rptovR ./user-code/pages/./**/*.{tsx} ./pages
169-
rsync -rptovR ./user-code/stylesheets/./**/*.{scss} ./stylesheets
168+
rsync -rptovR ./user-code/pages/./**/*.tsx ./pages
169+
rsync -rptovR ./user-code/stylesheets/./**/*.scss ./stylesheets
170170
171171
# In addition to making the final image smaller, we also save time by not sending unnecessary files to the docker build context
172172
- name: 'Prune for preview env'

.github/workflows/move-ready-to-merge-pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: move PR
2525
uses: alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488
2626
with:
27-
project: Docs team reviews
27+
project: Docs open source board
2828
column: Triage
2929
repo-token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
3030

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ jobs:
132132
- name: Run build script
133133
run: npm run build
134134

135+
- name: Warm possible disk caching
136+
env:
137+
NODE_ENV: test
138+
run: ./script/warm-before-tests.mjs
139+
135140
- name: Run tests
136141
env:
137142
DIFF_FILE: get_diff_files.txt

components/lib/events.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,15 @@ function initClipboardEvent() {
245245
})
246246
}
247247

248+
function initCopyButtonEvent() {
249+
document.documentElement.addEventListener('click', (evt) => {
250+
const target = evt.target as HTMLElement
251+
const button = target.closest('.js-btn-copy') as HTMLButtonElement
252+
if (!button) return
253+
sendEvent({ type: EventType.navigate, navigate_label: 'copy icon button' })
254+
})
255+
}
256+
248257
function initLinkEvent() {
249258
document.documentElement.addEventListener('click', (evt) => {
250259
const target = evt.target as HTMLElement
@@ -267,6 +276,7 @@ export default function initializeEvents() {
267276
initPageAndExitEvent() // must come first
268277
initLinkEvent()
269278
initClipboardEvent()
279+
initCopyButtonEvent()
270280
initPrintEvent()
271281
// survey event in ./survey.js
272282
// experiment event in ./experiment.js

components/rest/CodeBlock.tsx

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,62 @@
11
import cx from 'classnames'
2+
import { CheckIcon, CopyIcon } from '@primer/octicons-react'
3+
import { Tooltip } from '@primer/react'
4+
5+
import useClipboard from 'components/hooks/useClipboard'
26

37
import styles from './CodeBlock.module.scss'
48

59
type Props = {
610
verb?: string
11+
// Only Code samples should have a copy icon - if there's a headingLang it's a code sample
12+
headingLang?: string
713
codeBlock: string
814
highlight?: string
915
}
1016

11-
export function CodeBlock({ verb, codeBlock, highlight }: Props) {
17+
export function CodeBlock({ verb, headingLang, codeBlock, highlight }: Props) {
18+
const [isCopied, setCopied] = useClipboard(codeBlock, {
19+
successDuration: 1400,
20+
})
21+
1222
return (
13-
<pre className={cx(styles.methodCodeBlock, 'rounded-1 border')} data-highlight={highlight}>
14-
<code>
15-
{verb && (
16-
<span className="color-bg-accent-emphasis color-fg-on-emphasis rounded-1 text-uppercase">
17-
{verb}
18-
</span>
19-
)}{' '}
20-
{codeBlock}
21-
</code>
22-
</pre>
23+
<div className="code-extra">
24+
{headingLang && (
25+
<header className="d-flex flex-justify-between flex-items-center p-2 text-small rounded-top-1 border">
26+
{headingLang === 'JavaScript' ? (
27+
<span>
28+
{headingLang} (
29+
<a className="text-underline" href="https://github.com/octokit/core.js#readme">
30+
@octokit/core.js
31+
</a>
32+
)
33+
</span>
34+
) : (
35+
`${headingLang}`
36+
)}
37+
<Tooltip direction="w" aria-label={isCopied ? 'Copied!' : 'Copy to clipboard'}>
38+
<button className="js-btn-copy btn-octicon" onClick={() => setCopied()}>
39+
{isCopied ? <CheckIcon /> : <CopyIcon />}
40+
</button>
41+
</Tooltip>
42+
</header>
43+
)}
44+
<pre
45+
className={cx(
46+
styles.methodCodeBlock,
47+
'd-flex flex-justify-between flex-items-center rounded-1 border'
48+
)}
49+
data-highlight={highlight}
50+
>
51+
<code>
52+
{verb && (
53+
<span className="color-bg-accent-emphasis color-fg-on-emphasis rounded-1 text-uppercase">
54+
{verb}
55+
</span>
56+
)}{' '}
57+
{codeBlock}
58+
</code>
59+
</pre>
60+
</div>
2361
)
2462
}

components/rest/RestCodeSamples.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,10 @@ export function RestCodeSamples({ slug, xCodeSamples }: Props) {
1818
{xCodeSamples.map((sample, index) => {
1919
const sampleElements: JSX.Element[] = []
2020
if (sample.lang !== 'Ruby') {
21-
sampleElements.push(
22-
sample.lang === 'JavaScript' ? (
23-
<h5 key={`${sample.lang}-${index}`}>
24-
{sample.lang} (
25-
<a className="text-underline" href="https://github.com/octokit/core.js#readme">
26-
@octokit/core.js
27-
</a>
28-
)
29-
</h5>
30-
) : (
31-
<h5 key={`${sample.lang}-${index}`}>{sample.lang}</h5>
32-
)
33-
)
3421
sampleElements.push(
3522
<CodeBlock
3623
key={sample.lang + index}
24+
headingLang={sample.lang}
3725
codeBlock={sample.source}
3826
highlight={sample.lang === 'JavaScript' ? 'javascript' : 'curl'}
3927
></CodeBlock>

content/actions/learn-github-actions/contexts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ The `github` context contains information about the workflow run and the event t
183183
| `github.action_path` | `string` | The path where an action is located. This property is only supported in composite actions. You can use this path to access files located in the same repository as the action. |
184184
| `github.action_ref` | `string` | For a step executing an action, this is the ref of the action being executed. For example, `v2`. |
185185
| `github.action_repository` | `string` | For a step executing an action, this is the owner and repository name of the action. For example, `actions/checkout`. |
186+
| `github.action_status` | `string` | For a composite action, the current result of the composite action. |
186187
| `github.actor` | `string` | The username of the user that initiated the workflow run. |
187188
| `github.api_url` | `string` | The URL of the {% data variables.product.prodname_dotcom %} REST API. |
188189
| `github.base_ref` | `string` | The `base_ref` or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either `pull_request` or `pull_request_target`. |

content/actions/learn-github-actions/environment-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ We strongly recommend that actions use environment variables to access the files
156156
| `GITHUB_RUN_ID` | {% data reusables.actions.run_id_description %} For example, `1658821493`. |
157157
| `GITHUB_RUN_NUMBER` | {% data reusables.actions.run_number_description %} For example, `3`. |
158158
| `GITHUB_SERVER_URL`| The URL of the {% data variables.product.product_name %} server. For example: `https://{% data variables.product.product_url %}`.
159-
| `GITHUB_SHA` | The commit SHA that triggered the workflow. For example, `ffac537e6cbbf934b08745a378932722df287a53`. |
159+
| `GITHUB_SHA` | The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see [Events that trigger workflows](/actions/using-workflows/events-that-trigger-workflows). For example, `ffac537e6cbbf934b08745a378932722df287a53`. |
160160
| `GITHUB_WORKFLOW` | The name of the workflow. For example, `My test workflow`. If the workflow file doesn't specify a `name`, the value of this variable is the full path of the workflow file in the repository. |
161161
| `GITHUB_WORKSPACE` | The default working directory on the runner for steps, and the default location of your repository when using the [`checkout`](https://github.com/actions/checkout) action. For example, `/home/runner/work/my-repo-name/my-repo-name`. |
162162
{%- if actions-runner-arch-envvars %}

content/authentication/securing-your-account-with-two-factor-authentication-2fa/recovering-your-account-if-you-lose-your-2fa-credentials.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ shortTitle: Recover an account with 2FA
2222
**Warnings**:
2323

2424
- {% data reusables.two_fa.support-may-not-help %}
25-
- {% data reusables.accounts.you-must-know-your-password %}
2625

2726
{% endwarning %}
2827

@@ -32,7 +31,13 @@ shortTitle: Recover an account with 2FA
3231

3332
Use one of your recovery codes to automatically regain entry into your account. You may have saved your recovery codes to a password manager or your computer's downloads folder. The default filename for recovery codes is `github-recovery-codes.txt`. For more information about recovery codes, see "[Configuring two-factor authentication recovery methods](/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication-recovery-methods#downloading-your-two-factor-authentication-recovery-codes)."
3433

35-
{% data reusables.two_fa.username-password %}
34+
1. Type your username and password to prompt authentication.
35+
36+
{% warning %}
37+
38+
**Warning**: {% data reusables.accounts.you-must-know-your-password %}
39+
40+
{% endwarning %}
3641

3742
{% ifversion fpt or ghec %}
3843
1. Under "Having problems?", click **Use a recovery code or request a reset**.

content/code-security/guides.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,23 @@ includeGuides:
3131
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/tracking-code-scanning-alerts-in-issues-using-task-lists
3232
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning
3333
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts
34+
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql
3435
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning
3536
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages
3637
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository
3738
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/running-codeql-code-scanning-in-a-container
3839
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository
3940
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/triaging-code-scanning-alerts-in-pull-requests
4041
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/troubleshooting-the-codeql-workflow
42+
- /code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/viewing-code-scanning-logs
4143
- /code-security/code-scanning/integrating-with-code-scanning/about-integration-with-code-scanning
4244
- /code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning
4345
- /code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github
4446
- /code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/about-codeql-code-scanning-in-your-ci-system
4547
- /code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system
4648
- /code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-runner-in-your-ci-system
4749
- /code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/installing-codeql-cli-in-your-ci-system
50+
- /code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/migrating-from-the-codeql-runner-to-codeql-cli
4851
- /code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/running-codeql-runner-in-your-ci-system
4952
- /code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/troubleshooting-codeql-runner-in-your-ci-system
5053
- /code-security/repository-security-advisories/about-coordinated-disclosure-of-security-vulnerabilities
@@ -58,6 +61,8 @@ includeGuides:
5861
- /code-security/repository-security-advisories/removing-a-collaborator-from-a-repository-security-advisory
5962
- /code-security/repository-security-advisories/withdrawing-a-repository-security-advisory
6063
- /code-security/security-overview/about-the-security-overview
64+
- /code-security/security-overview/filtering-alerts-in-the-security-overview
65+
- /code-security/security-overview/viewing-the-security-overview
6166
- /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates
6267
- /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions
6368
- /code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates

0 commit comments

Comments
 (0)