Skip to content

Commit 7cc5ea6

Browse files
committed
code scanning alerts being only for default branches
does not include screenshots
1 parent 8ecfaf9 commit 7cc5ea6

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ By default, {% data variables.product.prodname_code_scanning %} analyzes your co
2727

2828
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 alert severity{% ifversion fpt or ghes > 3.1 or ghae or ghec %}, 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.
2929

30+
{% data reusables.code-scanning.alert-default-branch %}
31+
3032
![Example alert from {% data variables.product.prodname_code_scanning %}](/assets/images/help/repository/code-scanning-alert.png)
3133

3234
If you set up {% 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.

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ By default, the code scanning alerts page is filtered to show alerts for the def
4646
{% else %}
4747
![List of alerts from {% data variables.product.prodname_code_scanning %}](/assets/images/enterprise/3.1/help/repository/code-scanning-click-alert.png)
4848
{% endif %}
49+
{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %}
50+
1. {% data reusables.code-scanning.alert-default-branch %}
51+
<!-- Insert screenshot with status and Affected branches sections highlighted-->
52+
{% endif %}
4953
1. Optionally, if the alert highlights a problem with data flow, click **Show paths** to display the path from the data source to the sink where it's used.
5054
![The "Show paths" link on an alert](/assets/images/help/repository/code-scanning-show-paths.png)
51-
1. Alerts from {% data variables.product.prodname_codeql %} analysis include a description of the problem. Click **Show more** for guidance on how to fix your code.
55+
2. Alerts from {% data variables.product.prodname_codeql %} analysis include a description of the problem. Click **Show more** for guidance on how to fix your code.
5256
![Details for an alert](/assets/images/help/repository/code-scanning-alert-details.png)
5357

5458
For more information, see "[About {% data variables.product.prodname_code_scanning %} alerts](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts)."
@@ -80,6 +84,10 @@ The benefit of using keyword filters is that only values with results are shown
8084

8185
If you enter multiple filters, the view will show alerts matching _all_ these filters. For example, `is:closed severity:high branch:main` will only display closed high-severity alerts that are present on the `main` branch. The exception is filters relating to refs (`ref`, `branch` and `pr`): `is:open branch:main branch:next` will show you open alerts from both the `main` branch and the `next` branch.
8286

87+
{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %}
88+
{% data reusables.code-scanning.filter-non-default-branches %}
89+
{% endif %}
90+
8391
{% ifversion fpt or ghes > 3.3 or ghec %}
8492

8593
You can prefix the `tag` filter with `-` to exclude results with that tag. For example, `-tag:style` only shows alerts that do not have the `style` tag{% if codeql-ml-queries %} and `-tag:experimental` will omit all experimental alerts. For more information, see "[About {% data variables.product.prodname_code_scanning %} alerts](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts#about-experimental-alerts)."{% else %}.{% endif %}
@@ -143,7 +151,11 @@ If you have write permission for a repository, you can view fixed alerts by view
143151

144152
You can use{% ifversion fpt or ghes > 3.1 or ghae or ghec %} the free text search or{% endif %} the filters to display a subset of alerts and then in turn mark all matching alerts as closed.
145153

146-
Alerts may be fixed in one branch but not in another. You can use the "Branch" drop-down menu, on the summary of alerts, to check whether an alert is fixed in a particular branch.
154+
Alerts may be fixed in one branch but not in another. You can use the "Branch" filter, on the summary of alerts, to check whether an alert is fixed in a particular branch.
155+
156+
{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %}
157+
{% data reusables.code-scanning.filter-non-default-branches %}
158+
{% endif %}
147159

148160
{% ifversion fpt or ghes > 3.1 or ghae or ghec %}
149161
![Filtering alerts by branch](/assets/images/help/repository/code-scanning-branch-filter.png)

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ If you have write permission for the repository, some annotations contain links
7474

7575
To see more information about an alert, users with write permission can click the **Show more details** link shown in the annotation. This allows you to see all of the context and metadata provided by the tool in an alert view. In the example below, you can see tags showing the severity, type, and relevant common weakness enumerations (CWEs) for the problem. The view also shows which commit introduced the problem.
7676

77+
{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %}
78+
{% data reusables.code-scanning.alert-default-branch %}
79+
{% endif %}
80+
7781
In the detailed view for an alert, some {% data variables.product.prodname_code_scanning %} tools, like {% data variables.product.prodname_codeql %} analysis, also include a description of the problem and a **Show more** link for guidance on how to fix your code.
7882

7983
![Alert description and link to show more information](/assets/images/help/repository/code-scanning-pr-alert.png)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The status and information on the alert page will only reflect the state of the alert on the default branch, even if an alert exists in other branches of the repository. You can see the status of the alert on non-default branches in the **Affected branches** section in the right-hand sidebar of the alert page. If an alert does not exist in the default branch, the status of the alert will display as "in pull request" or "in branch" and the status label will be colored grey.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please note that if you have filtered for alerts on a non-default branch, but the same alerts exist on the default branch, the alert page for any given alert will still only reflect the alert's status on the default branch, even if it conflicts with the status on a non-default branch. For example, an alert that appears in the "Open" list in the summary of alerts for `branch-x` could show a status of "Fixed" on the alert page, if the alert was already fixed on the default branch. You can view the status of the alert for the branch you filtered on in the **Affected branches** section in the right-hand sidebar of the alert page.

0 commit comments

Comments
 (0)