Skip to content

Commit 7ff486d

Browse files
Accessibility screenshots: repository A-C, code scanning (#36511)
Co-authored-by: Laura Coursen <[email protected]>
1 parent 5b1834b commit 7ff486d

31 files changed

+66
-115
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

content/actions/creating-actions/publishing-actions-in-github-marketplace.md

-1
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,4 @@ To remove a published action from {% data variables.product.prodname_marketplace
5757
{% data reusables.repositories.releases %}
5858
{% data reusables.releases.edit-release %}
5959
4. Select **Publish this action to the {% data variables.product.prodname_marketplace %}** to remove the check from the box.
60-
![Publish this action button](/assets/images/help/repository/actions-marketplace-unpublish.png)
6160
5. Click **Update release** at the bottom of the page.

content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ Each alert highlights a problem with the code and the name of the tool that iden
3333
{% data reusables.code-scanning.alert-default-branch %}
3434
{% endif %}
3535

36-
{% ifversion fpt or ghec or ghes > 3.4 or ghae > 3.4 %}
37-
![Example alert from {% data variables.product.prodname_code_scanning %}](/assets/images/help/repository/code-scanning-alert.png)
36+
{% ifversion fpt or ghec %}
37+
![Screenshot showing the elements of a {% data variables.product.prodname_code_scanning %} alert, including the title of the alert and relevant lines of code at left and the severity level, affected branches, and weaknesses at right. ](/assets/images/help/repository/code-scanning-alert.png)
38+
{% elsif ghes = 3.4 %}
39+
![Screenshot showing the elements of a {% data variables.product.prodname_code_scanning %} alert, including the title of the alert and relevant lines of code at left and the severity level, affected branches, and weaknesses at right.](/assets/images/enterprise/3.4/repository/code-scanning-alert.png)
3840
{% else %}
39-
![Example alert from {% data variables.product.prodname_code_scanning %}](/assets/images/enterprise/3.4/repository/code-scanning-alert.png)
41+
![Screenshot showing the elements of a {% data variables.product.prodname_code_scanning %} alert, including the title of the alert and relevant lines of code at left and the severity level, affected branches, and weaknesses at right.](/assets/images/enterprise/code-security/code-scanning-alert.png)
4042
{% endif %}
4143

4244
If you configure {% data variables.product.prodname_code_scanning %} using {% data variables.product.prodname_codeql %}, you can also find 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.
@@ -71,7 +73,7 @@ You can run multiple configurations of code analysis on a repository, using diff
7173

7274
If you use multiple configurations to analyze a file, any problems detected by the same query are reported as alerts with multiple analysis origins. If an alert has more than one analysis origin, a {% octicon "workflow" aria-label="The workflow icon" %} icon will appear next to any relevant branch in the **Affected branches** section on the right-hand side of the alert page. You can hover over the {% octicon "workflow" aria-label="The workflow icon" %} icon to see the names of each analysis origin and the status of the alert for that analysis origin. You can also view the history of when alerts appeared in each analysis origin in the timeline on the alert page. If an alert only has one analysis origin, no information about analysis origins is displayed on the alert page.
7375

74-
![Code scanning alert with multiple analysis origins](/assets/images/help/repository/code-scanning-analysis-origins.png)
76+
![Screenshot showing a code scanning alert with multiple analysis origins.](/assets/images/help/repository/code-scanning-analysis-origins.png)
7577

7678
{% note %}
7779

@@ -91,13 +93,13 @@ If you use multiple configurations to analyze a file, any problems detected by t
9193

9294
{% data variables.product.prodname_code_scanning_caps %} categorizes files by file path. You cannot manually categorize source files.
9395

94-
Here is an example from the {% data variables.product.prodname_code_scanning %} alert list of an alert marked as occurring in library code.
96+
In this example, an alert is marked as in "Test" code in the {% data variables.product.prodname_code_scanning %} alert list.
9597

96-
![Code scanning library alert in list](/assets/images/help/repository/code-scanning-library-alert-index.png)
98+
![Screenshot of an alert in the {% data variables.product.prodname_code_scanning %} list. To the right of the title, a "Test" label is highlighted with a dark orange outline.](/assets/images/help/repository/code-scanning-library-alert-index.png)
9799

98-
On the alert page, you can see that the filepath is marked as library code (`Library` label).
100+
When you click through to see details for the alert, you can see that the file path is marked as "Test" code.
99101

100-
![Code scanning library alert details](/assets/images/help/repository/code-scanning-library-alert-show.png)
102+
![Screenshot showing the details of an alert. The file path and "Test" label are highlighted with a dark orange outline.](/assets/images/help/repository/code-scanning-library-alert-show.png)
101103

102104
{% ifversion codeql-ml-queries %}
103105

@@ -107,7 +109,7 @@ On the alert page, you can see that the filepath is marked as library code (`Lib
107109

108110
In repositories that run {% data variables.product.prodname_code_scanning %} using the {% data variables.product.prodname_codeql %} action, you may see some alerts that are marked as experimental. These are alerts that were found using a machine learning model to extend the capabilities of an existing {% data variables.product.prodname_codeql %} query.
109111

110-
![Code scanning experimental alert in list](/assets/images/help/repository/code-scanning-experimental-alert-list.png)
112+
![Screenshot showing an alert for {% data variables.product.prodname_code_scanning %}. An "Experimental" label is displayed to the right of the title, which is appended with "(experimental)."](/assets/images/help/repository/code-scanning-experimental-alert-list.png)
111113

112114
### Benefits of using machine learning models to extend queries
113115

@@ -119,9 +121,7 @@ Each of the security queries for {% data variables.product.prodname_codeql %} id
119121

120122
### Alerts identified using machine learning
121123

122-
Alerts found using a machine learning model are tagged as "Experimental alerts" to show that the technology is under active development. These alerts have a higher rate of false positive results than the queries they are based on. The machine learning model will improve based on user actions such as marking a poor result as a false positive or fixing a good result.
123-
124-
![Code scanning experimental alert details](/assets/images/help/repository/code-scanning-experimental-alert-show.png)
124+
Alerts found using a machine learning model are displayed with an "Experimental alerts" banner to show that the technology is under active development. These alerts have a higher rate of false positive results than the queries they are based on. The machine learning model will improve based on user actions such as marking a poor result as a false positive or fixing a good result.
125125

126126
## Enabling experimental alerts
127127

content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository.md

+5-12
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You decide how to generate {% data variables.product.prodname_code_scanning %} a
4444

4545
{% ifversion code-scanning-tool-status-page %}
4646

47-
The {% data variables.code-scanning.tool_status_page %} shows useful information about all of your code scanning tools. If code scanning is not working as you'd expect, the {% data variables.code-scanning.tool_status_page %} is a good starting point for debugging problems. For more information, see "[AUTOTITLE](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-the-tool-status-page)".
47+
The {% data variables.code-scanning.tool_status_page %} shows useful information about all of your code scanning tools. If code scanning is not working as you'd expect, the {% data variables.code-scanning.tool_status_page %} is a good starting point for debugging problems. For more information, see "[AUTOTITLE](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-the-tool-status-page)."
4848

4949
{% endif %}
5050

@@ -176,7 +176,8 @@ The `on:pull_request` and `on:push` triggers for code scanning are each useful f
176176
{% data reusables.repositories.sidebar-security %}
177177
1. To the right of "{% data variables.product.prodname_code_scanning_caps %} alerts", click **Set up {% data variables.product.prodname_code_scanning %}**.{% ifversion ghec or ghes or ghae %} If "{% data variables.product.prodname_code_scanning %} alerts" is missing, you need to ask an organization owner or repository administrator to enable {% data variables.product.prodname_GH_advanced_security %}.{% endif %} For more information, see "[AUTOTITLE](/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-security-and-analysis-settings-for-your-organization)" or "[AUTOTITLE](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository)."
178178
1. Under "Get started with {% data variables.product.prodname_code_scanning %}", click **Set up this workflow** on the {% data variables.code-scanning.codeql_workflow %} or on a third-party workflow.
179-
!["Set up this workflow" button under "Get started with {% data variables.product.prodname_code_scanning %}" heading](/assets/images/help/repository/code-scanning-set-up-this-workflow.png)Workflows are only displayed if they are relevant for the programming languages detected in the repository. The {% data variables.code-scanning.codeql_workflow %} is always displayed, but the "Set up this workflow" button is only enabled if {% data variables.product.prodname_codeql %} analysis supports the languages present in the repository.
179+
180+
Workflows are only displayed if they are relevant for the programming languages detected in the repository. The {% data variables.code-scanning.codeql_workflow %} is always displayed, but the "Set up this workflow" button is only enabled if {% data variables.product.prodname_codeql %} analysis supports the languages present in the repository.
180181
1. To customize how {% data variables.product.prodname_code_scanning %} scans your code, edit the workflow.
181182

182183
Generally, you can commit the {% data variables.code-scanning.codeql_workflow %} without making any changes to it. However, many of the third-party workflows require additional configuration, so read the comments in the workflow before committing.
@@ -227,14 +228,6 @@ After configuring {% data variables.product.prodname_code_scanning %} for your r
227228

228229
1. Once all jobs are complete, you can view the details of any {% data variables.product.prodname_code_scanning %} alerts that were identified. For more information, see "[AUTOTITLE](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)."
229230

230-
{% note %}
231-
232-
**Note:** If you raised a pull request to add the {% data variables.product.prodname_code_scanning %} workflow to the repository, alerts from that pull request aren't displayed directly on the {% data variables.product.prodname_code_scanning_caps %} page until the pull request is merged. If any alerts were found you can view these, before the pull request is merged, by clicking the **NUMBER alerts found** link in the banner on the {% data variables.product.prodname_code_scanning_caps %} page.
233-
234-
![Click the "n alerts found" link](/assets/images/help/repository/code-scanning-alerts-found-link.png)
235-
236-
{% endnote %}
237-
238231
## Understanding the pull request checks
239232

240233
Each {% data variables.product.prodname_code_scanning %} workflow you set to run on pull requests always has at least two entries listed in the checks section of a pull request. There is one entry for each of the analysis jobs in the workflow, and a final one for the results of the analysis.
@@ -245,10 +238,10 @@ The names of the {% data variables.product.prodname_code_scanning %} analysis ch
245238

246239
When the {% data variables.product.prodname_code_scanning %} jobs complete, {% data variables.product.prodname_dotcom %} works out whether any alerts were added by the pull request and adds the "{% data variables.product.prodname_code_scanning_caps %} results / TOOL NAME" entry to the list of checks. After {% data variables.product.prodname_code_scanning %} has been performed at least once, you can click **Details** to view the results of the analysis.
247240

248-
{% ifversion ghes < 3.5 or ghae %}
241+
{% ifversion ghes < 3.5 %}
249242
If you used a pull request to add {% data variables.product.prodname_code_scanning %} to the repository, you will initially see an "Analysis not found" message when you click **Details** on the "{% data variables.product.prodname_code_scanning_caps %} results / TOOL NAME" check.
250243

251-
![Analysis not found for commit message](/assets/images/enterprise/3.4/repository/code-scanning-analysis-not-found.png)
244+
![Screenshot of the details for a code scanning result. Under "GitHub Code Scanning / CodeQL" is the heading "1 analysis not found."](/assets/images/enterprise/3.4/repository/code-scanning-analysis-not-found.png)
252245

253246
The table lists one or more categories. Each category relates to specific analyses, for the same tool and commit, performed on a different language or a different part of the code. For each category, the table shows the two analyses that {% data variables.product.prodname_code_scanning %} attempted to compare to determine which alerts were introduced or fixed in the pull request.
254247

content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning.md

+11-13
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ With the advanced setup, you can edit workflows like {% data variables.product.p
5858
{% data variables.product.prodname_dotcom %} saves workflow files in the _.github/workflows_ directory of your repository. You can find a workflow you have added by searching for its file name. For example, by default, the workflow file for {% data variables.product.prodname_codeql %} {% data variables.product.prodname_code_scanning %} is called _codeql-analysis.yml_.
5959

6060
1. In your repository, browse to the workflow file you want to edit.
61-
1. In the upper right corner of the file view, to open the workflow editor, click {% octicon "pencil" aria-label="The edit icon" %}.
62-
![Edit workflow file button](/assets/images/help/repository/code-scanning-edit-workflow-button.png)
61+
1. In the upper right corner of the file view, to open the workflow editor, click {% octicon "pencil" aria-label="Edit file" %}.
6362
1. After you have edited the file, click **Start commit** and complete the "Commit changes" form. You can choose to commit directly to the current branch, or create a new branch and start a pull request.
64-
![Commit update to codeql.yml workflow](/assets/images/help/repository/code-scanning-workflow-update.png)
6563

6664
For more information about editing workflow files, see "[AUTOTITLE](/actions/learn-github-actions)."
6765

@@ -89,16 +87,6 @@ If you scan pull requests, then the results appear as alerts in a pull request c
8987

9088
Using the `pull_request` trigger, configured to scan the pull request's merge commit rather than the head commit, will produce more efficient and accurate results than scanning the head of the branch on each push. However, if you use a CI/CD system that cannot be configured to trigger on pull requests, you can still use the `on:push` trigger and {% data variables.product.prodname_code_scanning %} will map the results to open pull requests on the branch and add the alerts as annotations on the pull request. For more information, see "[AUTOTITLE](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning#scanning-on-push)."
9189

92-
### Defining the severities causing pull request check failure
93-
94-
By default, only alerts with the severity level of `Error` or security severity level of `Critical` or `High` 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 and of security severities that will cause a pull request check failure in your repository settings. For more information about severity levels, see "[AUTOTITLE](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts#about-alert-details)."
95-
96-
{% data reusables.repositories.navigate-to-repo %}
97-
{% data reusables.repositories.sidebar-settings %}
98-
{% data reusables.repositories.navigate-to-code-security-and-analysis %}
99-
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.
100-
![Check failure setting](/assets/images/help/repository/code-scanning-check-failure-setting.png)
101-
10290
### Avoiding unnecessary scans of pull requests
10391

10492
You might want to avoid a code scan being triggered on specific pull requests targeted against the default branch, irrespective of which files have been changed. You can configure this by specifying `on:pull_request:paths-ignore` or `on:pull_request:paths` in the {% data variables.product.prodname_code_scanning %} workflow. For example, if the only changes in a pull request are to files with the file extensions `.md` or `.txt` you can use the following `paths-ignore` array.
@@ -270,6 +258,16 @@ jobs:
270258
```
271259
{% endif %}
272260

261+
## Defining the alert severities that give a check failure for a pull request
262+
263+
By default, only alerts with the severity level of `Error` or security severity level of `Critical` or `High` 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 and of security severities that will cause a pull request check failure in your repository settings. For more information about severity levels, see "[AUTOTITLE](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts#about-alert-details)."
264+
265+
{% data reusables.repositories.navigate-to-repo %}
266+
{% data reusables.repositories.sidebar-settings %}
267+
{% data reusables.repositories.navigate-to-code-security-and-analysis %} {% ifversion fpt or ghec %}
268+
1. Under "{% data variables.product.prodname_code_scanning_caps %}", in the "Protection rules" section, use the drop-down menu to define which alerts should cause a check failure. Choose one level for alerts of type "Security" and one level for all other alerts.{% else %}
269+
1. Under "{% data variables.product.prodname_code_scanning_caps %}", 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.{% endif %}
270+
273271
## Configuring a category for the analysis
274272

275273
Use `category` to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. The category you specify in your workflow will be included in the SARIF results file.

0 commit comments

Comments
 (0)