Skip to content

Commit 3e730e1

Browse files
authored
Merge branch 'main' into repo-sync
2 parents 9eb90a6 + 1fdb14f commit 3e730e1

File tree

177 files changed

+1401
-2899
lines changed

Some content is hidden

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

177 files changed

+1401
-2899
lines changed

.github/allowed-actions.js

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export default [
2323
'juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8',
2424
'juliangruber/find-pull-request-action@db875662766249c049b2dcd85293892d61cb0b51', // v1.5.0
2525
'juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512',
26-
'lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8',
2726
'lee-dohm/no-response@9bb0a4b5e6a45046f00353d5de7d90fb8bd773bb',
2827
'pascalgn/automerge-action@c9bd1823770819dc8fb8a5db2d11a3a95fbe9b07', // v0.12.0
2928
'peter-evans/create-issue-from-file@b4f9ee0a9d4abbfc6986601d9b1a4f8f8e74c77e',

.github/workflows/check-all-english-links.yml

+52-16
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414
name: Check all links
1515
if: github.repository == 'github/docs-internal'
1616
runs-on: ubuntu-latest
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
19+
REPORT_AUTHOR: docubot
20+
REPORT_LABEL: broken link report
21+
REPORT_REPOSITORY: github/docs-content
1722
steps:
1823
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
1924
- name: npm ci
@@ -27,27 +32,58 @@ jobs:
2732
name: Get title for issue
2833
id: check
2934
run: echo "::set-output name=title::$(head -1 broken_links.md)"
30-
- if: ${{ failure() }}
31-
name: Close previous report
32-
uses: lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8
33-
with:
34-
query: 'label:"broken link report"'
35-
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
3635
- if: ${{ failure() }}
3736
name: Create issue from file
3837
id: broken-link-report
3938
uses: peter-evans/create-issue-from-file@b4f9ee0a9d4abbfc6986601d9b1a4f8f8e74c77e
4039
with:
41-
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
40+
token: ${{ env.GITHUB_TOKEN }}
41+
4242
title: ${{ steps.check.outputs.title }}
4343
content-filepath: ./broken_links.md
44-
repository: github/docs-content
45-
labels: broken link report
44+
repository: ${{ env.REPORT_REPOSITORY }}
45+
labels: ${{ env.REPORT_LABEL }}
4646
- if: ${{ failure() }}
47-
name: Add comment to issue
48-
uses: peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd
49-
with:
50-
body: |
51-
cc @github/docs-content
52-
issue-number: ${{ steps.broken-link-report.outputs.issue-number }}
53-
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
47+
name: Close and/or comment on old issues
48+
env:
49+
NEW_REPORT_URL: 'https://github.com/${{ env.REPORT_REPOSITORY }}/issues/${{ steps.broken-link-report.outputs.issue-number }}'
50+
run: |
51+
gh alias set list-reports "issue list \
52+
--repo ${{ env.REPORT_REPOSITORY }} \
53+
--author ${{ env.REPORT_AUTHOR }} \
54+
--label '${{ env.REPORT_LABEL }}'"
55+
56+
# Link to the previous report from the new report that triggered this
57+
# workflow run.
58+
59+
for issue_url in $(gh list-reports \
60+
--state all \
61+
--limit 2 \
62+
--json url \
63+
--jq '.[].url' | grep -v ${{ env.NEW_REPORT_URL }}); do
64+
gh issue comment ${{ env.NEW_REPORT_URL }} --body "⬅️ [Previous report]($issue_url)"
65+
done
66+
67+
# Link to the newer report from any older report that is still open,
68+
# then close the older report.
69+
70+
for issue_url in $(gh list-reports \
71+
--search 'no:assignee' \
72+
--json url \
73+
--jq '.[].url'); do
74+
if [ "$issue_url" != "${{ env.NEW_REPORT_URL }}" ]; then
75+
gh issue comment $issue_url --body "➡️ [Newer report](${{ env.NEW_REPORT_URL }})"
76+
gh issue close $issue_url
77+
fi
78+
done
79+
80+
# If an old report is open and assigned to someone, link to the newer
81+
# report without closing the old report.
82+
83+
for issue_url in $(gh list-reports \
84+
--json assignees,url \
85+
--jq '.[] | select (.assignees != []) | .url'); do
86+
if [ "$issue_url" != "${{ env.NEW_REPORT_URL }}" ]; then
87+
gh issue comment $issue_url --body "➡️ [Newer report](${{ env.NEW_REPORT_URL }})"
88+
fi
89+
done
Loading
Loading
Loading
129 KB
Loading
Loading
Loading
Loading
Loading
Loading
Loading

components/DefaultLayout.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import { useTranslation } from './hooks/useTranslation'
1111

1212
type Props = { children?: React.ReactNode }
1313
export const DefaultLayout = (props: Props) => {
14-
const { page, error, isHomepageVersion } = useMainContext()
14+
const { page, error, isHomepageVersion, currentPathWithoutLanguage } = useMainContext()
1515
const { t } = useTranslation('errors')
1616
return (
1717
<div className="d-lg-flex">
1818
<Head>
1919
{error === '404' ? (
2020
<title>{t('oops')}</title>
21-
) : !isHomepageVersion && page.fullTitle ? (
21+
) : (!isHomepageVersion && page.fullTitle) || (currentPathWithoutLanguage.includes('enterprise-server') && page.fullTitle) ? (
2222
<title>{page.fullTitle}</title>
2323
) : null}
2424

components/HeaderNotifications.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const HeaderNotifications = () => {
5252
if (userLanguage && userLanguage !== 'en' && languages[userLanguage]?.wip === false) {
5353
translationNotices.push({
5454
type: NotificationType.TRANSLATION,
55-
content: `This article is also available in your language of choice. Click <a href="/${userLanguage}${currentPathWithoutLanguage}">here</a>`,
55+
content: `This article is also available in <a href="/${userLanguage}${currentPathWithoutLanguage}">${languages[userLanguage].name}</a>.`,
5656
})
5757
}
5858
}

components/LanguagePicker.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const LanguagePicker = ({ variant }: Props) => {
6363
width: unset;
6464
}
6565
`}
66+
data-testid="language-picker"
6667
>
6768
<summary>
6869
{selectedLang.nativeName || selectedLang.name}

components/article/ArticlePage.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ export const ArticlePage = () => {
5555
)}
5656

5757
{intro && (
58-
<div className="lead-mktg">
59-
<p>{intro}</p>
60-
</div>
58+
<div
59+
className="lead-mktg"
60+
dangerouslySetInnerHTML={{ __html: intro }}
61+
/>
6162
)}
6263

6364
{permissions && (

components/article/ArticleVersionPicker.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const ArticleVersionPicker = () => {
2323
width: unset;
2424
}
2525
`}
26+
data-testid="article-version-picker"
2627
>
2728
<summary className="f4 h5-mktg btn-outline-mktg btn-mktg p-2">
2829
<span className="d-md-none d-xl-inline-block">{t('article_version')}</span>{' '}

components/context/ArticleContext.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const getArticleContextFromRequest = (req: any): ArticleContextT => {
4141
const page = req.context.page
4242
return {
4343
title: page.titlePlainText,
44-
intro: page.introPlainText,
44+
intro: page.intro,
4545
renderedPage: req.context.renderedPage || '',
4646
miniTocItems:
4747
(req.context.miniTocItems || []).map((item: any) => {

components/context/ProductLandingContext.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ export type TocItem = {
55
fullPath: string
66
title: string
77
intro?: string
8+
childTocItems?: Array<{
9+
fullPath: string;
10+
title: string;
11+
}>
812
}
913
export type FeaturedLink = {
1014
title: string

components/context/TocLandingContext.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const getTocLandingContextFromRequest = (req: any): TocLandingContextT =>
3838
introPlainText: req.context.page.introPlainText,
3939
isEarlyAccess: req.context.page?.documentType === 'early-access',
4040
tocItems: (req.context.genericTocFlat || req.context.genericTocNested || []).map((obj: any) =>
41-
pick(obj, ['fullPath', 'title', 'intro'])
41+
pick(obj, ['fullPath', 'title', 'intro', 'childTocItems'])
4242
),
4343
variant: req.context.genericTocFlat ? 'expanded' : 'compact',
4444

components/landing/GuideCard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const GuideCard = ({ guide }: Props) => {
1313
className="Box color-shadow-medium height-full d-block hover-shadow-large no-underline color-text-primary p-5"
1414
href={guide.href}
1515
>
16-
<h2>{guide.title}</h2>
16+
<h2 dangerouslySetInnerHTML={{__html: guide.title}} />
1717
<p className="mt-2 mb-4 color-text-tertiary">{guide.intro}</p>
1818

1919
<footer className="d-flex">

components/landing/TableOfContents.tsx

+20-3
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,39 @@ export const TableOfContents = (props: Props) => {
1919
return null
2020
}
2121

22-
const { fullPath: href, title, intro } = item
22+
const { fullPath: href, title, intro, childTocItems } = item
2323
const isActive = router.pathname === href
2424
return variant === 'compact' ? (
2525
<li key={href} className="f4 my-1">
2626
<Link href={href}>{title}</Link>
27+
<ul className={cx(variant === 'compact' ? 'list-style-circle pl-5 my-3' : 'list-style-none')}>
28+
{(childTocItems || []).map((childItem) => {
29+
if (!childItem) {
30+
return null
31+
}
32+
return (
33+
<li key={childItem.fullPath} className="f4 mt-1">
34+
<Link
35+
href={childItem.fullPath}
36+
className="Bump-link--hover no-underline py-1 color-border-primary"
37+
>
38+
{childItem.title}
39+
</Link>
40+
</li>
41+
)
42+
})}
43+
</ul>
2744
</li>
2845
) : (
2946
<li key={href} className={cx('mb-5', isActive && 'color-auto-gray-4')}>
3047
<Link
3148
href={href}
3249
className="Bump-link--hover no-underline d-block py-1 border-bottom color-border-primary"
3350
>
34-
<h4>
51+
<h2 className="h4">
3552
{title}
3653
<span className="Bump-link-symbol"></span>
37-
</h4>
54+
</h2>
3855
</Link>
3956
{intro && <p className="f4 mt-3" dangerouslySetInnerHTML={{ __html: intro }} />}
4057
</li>

content/actions/guides/building-and-testing-net.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ versions:
66
fpt: '*'
77
ghes: '>=2.22'
88
ghae: '*'
9+
shortTitle: Build & test .NET
910
---
1011

1112
{% data reusables.actions.enterprise-beta %}
@@ -64,7 +65,7 @@ jobs:
6465
## Specifying a .NET version
6566
6667
To use a preinstalled version of the .NET Core SDK on a {% data variables.product.prodname_dotcom %}-hosted runner, use the `setup-dotnet` action. This action finds a specific version of .NET from the tools cache on each runner, and adds the necessary binaries to `PATH`. These changes will persist for the remainder of the job.
67-
68+
6869
The `setup-dotnet` action is the recommended way of using .NET with {% data variables.product.prodname_actions %}, because it ensures consistent behavior across different runners and different versions of .NET. If you are using a self-hosted runner, you must install .NET and add it to `PATH`. For more information, see the [`setup-dotnet`](https://github.com/marketplace/actions/setup-net-core-sdk) action.
6970

7071
### Using multiple .NET versions
@@ -105,7 +106,7 @@ You can configure your job to use a specific version of .NET, such as `3.1.3`. A
105106
uses: actions/setup-dotnet@v1
106107
with:
107108
# Semantic version range syntax or exact version of a dotnet version
108-
dotnet-version: '3.x'
109+
dotnet-version: '3.x'
109110
```
110111
{% endraw %}
111112

content/actions/guides/building-and-testing-ruby.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ type: tutorial
1010
topics:
1111
- CI
1212
- Ruby
13+
shortTitle: Build & test Ruby
1314
---
1415

1516
{% data reusables.actions.enterprise-beta %}

content/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,19 @@ For more information about the `pull_request` event, see "[Workflow syntax for {
8383
If you scan pull requests, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)."
8484

8585
{% ifversion fpt or ghes > 3.1 or ghae-next %}
86-
### Defining the alert severities causing pull request check failure
86+
### Defining the severities causing pull request check failure
8787

88-
By default, only alerts with the severity level of `error` will cause a pull request check failure, and a check will still succeed with alerts of lower severities. You can change the levels of alert severities that will cause a pull request check failure in your repository settings.
88+
By default, only alerts with the severity level of `Error`{% ifversion fpt or ghes > 3.1 or ghae-issue-4697 %} or security severity level of `Critical` or `High`{% endif %} will cause a pull request check failure, and a check will still succeed with alerts of lower severities. You can change the levels of alert severities{% ifversion fpt or ghes > 3.1 or ghae-issue-4697 %} and of security severities{% endif %} that will cause a pull request check failure in your repository settings. For more information about severity levels, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository#about-alerts-details)."
8989

9090
{% data reusables.repositories.navigate-to-repo %}
9191
{% data reusables.repositories.sidebar-settings %}
9292
{% data reusables.repositories.navigate-to-security-and-analysis %}
9393
1. Under "Code scanning", to the right of "Check Failure", use the drop-down menu to select the level of severity you would like to cause a pull request check failure.
94+
{% ifversion fpt or ghes > 3.1 or ghae-issue-4697 %}
9495
![Check failure setting](/assets/images/help/repository/code-scanning-check-failure-setting.png)
96+
{% else %}
97+
![Check failure setting](/assets/images/help/repository/code-scanning-check-failure-setting-ghae.png)
98+
{% endif %}
9599
{% endif %}
96100

97101
### Avoiding unnecessary scans of pull requests

content/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,29 @@ By default, {% data variables.product.prodname_code_scanning %} analyzes your co
3434

3535
## About alerts details
3636

37-
Each alert highlights a problem with the code and the name of the tool that identified it. You can see the line of code that triggered the alert, as well as properties of the alert, such as the severity and the nature of the problem. Alerts also tell you when the issue was first introduced. For alerts identified by {% data variables.product.prodname_codeql %} analysis, you will also see information on how to fix the problem.
37+
Each alert highlights a problem with the code and the name of the tool that identified it. You can see the line of code that triggered the alert, as well as properties of the alert, such as the severity{% ifversion fpt or ghes > 3.1 or ghae-issue-4697 %}, security severity,{% endif %} and the nature of the problem. Alerts also tell you when the issue was first introduced. For alerts identified by {% data variables.product.prodname_codeql %} analysis, you will also see information on how to fix the problem.
3838

3939
![Example alert from {% data variables.product.prodname_code_scanning %}](/assets/images/help/repository/code-scanning-alert.png)
4040

4141
If you set up {% data variables.product.prodname_code_scanning %} using {% data variables.product.prodname_codeql %}, this can also detect data-flow problems in your code. Data-flow analysis finds potential security issues in code, such as: using data insecurely, passing dangerous arguments to functions, and leaking sensitive information.
4242

4343
When {% data variables.product.prodname_code_scanning %} reports data-flow alerts, {% data variables.product.prodname_dotcom %} shows you how data moves through the code. {% data variables.product.prodname_code_scanning_capc %} allows you to identify the areas of your code that leak sensitive information, and that could be the entry point for attacks by malicious users.
4444

45+
### About severity levels
46+
47+
Alert severity levels may be `Error`, `Warning`, or `Note`.
48+
49+
By default, any code scanning results with a severity of `error` will cause check failure. {% ifversion fpt or ghes > 3.1 or ghae-next %}You can specify the severity level at which pull requests that trigger code scanning alerts should fail. For more information, see "[Defining the severities causing pull request check failure](/code-security/secure-coding/configuring-code-scanning#defining-the-severities-causing-pull-request-check-failure)."{% endif %}
50+
51+
{% ifversion fpt or ghes > 3.1 or ghae-issue-4697 %}
52+
### About security severity levels
53+
54+
{% data variables.product.prodname_code_scanning_capc %} displays security severity levels for alerts that are generated by security queries. Security severity levels can be `Critical`, `High`, `Medium`, or `Low`.
55+
56+
To calculate the security severity of an alert, we use Common Vulnerability Scoring System (CVSS) data. CVSS is an open framework for communicating the characteristics and severity of software vulnerabilities, and is commonly used by other security products to score alerts. For more information about how severity levels are calculated, see [the blog post](https://github.blog/changelog/2021-07-19-codeql-code-scanning-new-severity-levels-for-security-alerts/).
57+
58+
By default, any code scanning results with a security severity of `Critical` or `High` will cause a check failure. You can specify which security severity level for code scanning results should cause a check failure. For more information, see "[Defining the severities causing pull request check failure](/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#defining-the-severities-causing-pull-request-check-failure)."{% endif %}
59+
4560
## Viewing the alerts for a repository
4661

4762
Anyone with read permission for a repository can see {% data variables.product.prodname_code_scanning %} annotations on pull requests. For more information, see "[Triaging {% data variables.product.prodname_code_scanning %} alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)."

content/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/triaging-code-scanning-alerts-in-pull-requests.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ In repositories where {% data variables.product.prodname_code_scanning %} is con
2929

3030
If {% data variables.product.prodname_code_scanning %} has any results with a severity of `error`, the check fails and the error is reported in the check results. If all the results found by {% data variables.product.prodname_code_scanning %} have lower severities, the alerts are treated as warnings or notices and the check succeeds.
3131

32-
{% ifversion fpt or ghes > 3.1 or ghae-next %}You can override the default behavior in your repository settings, by specifying the level of severities that will cause a pull request check failure. For more information, see "[Defining the alert severities causing pull request check failure](/code-security/secure-coding/configuring-code-scanning#defining-the-alert-severities-causing-pull-request-check-failure)".
32+
{% ifversion fpt or ghes > 3.1 or ghae-next %}You can override the default behavior in your repository settings, by specifying the level of severities {% ifversion fpt or ghes > 3.1 or ghae-issue-4697 %}and security severities {% endif %}that will cause a pull request check failure. For more information, see "[Defining the severities causing pull request check failure](/code-security/secure-coding/configuring-code-scanning#defining-the-severities-causing-pull-request-check-failure)".
3333

3434
{% endif %}If your pull request targets a protected branch that uses {% data variables.product.prodname_code_scanning %}, and the repository owner has configured required status checks, then you must either fix or dismiss all error alerts before the pull request can be merged. For more information, see "[About protected branches](/github/administering-a-repository/about-protected-branches#require-status-checks-before-merging)."
3535

@@ -43,7 +43,7 @@ If the repository uses the {% data variables.product.prodname_codeql_workflow %}
4343

4444
## Triaging an alert on your pull request
4545

46-
When you look at the **Files changed** tab for a pull request, you see annotations for any lines of code that triggered the alert.
46+
When you look at the **Files changed** tab for a pull request, you see annotations for any lines of code that triggered the alert. The severity of the alert is displayed in the annotation.
4747

4848
![Alert annotation within a pull request diff](/assets/images/help/repository/code-scanning-pr-annotation.png)
4949

0 commit comments

Comments
 (0)