Skip to content

Commit c3dd292

Browse files
authored
Merge branch 'main' into fix-nav
2 parents be1f883 + 4acd4e4 commit c3dd292

File tree

594 files changed

+39927
-29304
lines changed

Some content is hidden

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

594 files changed

+39927
-29304
lines changed

content/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,32 @@ The default {% data variables.product.prodname_codeql_workflow %} uses the `pull
5252

5353
For more information about the `pull_request` event, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags)."
5454

55+
#### Avoiding unnecessary scans of pull requests
56+
57+
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.
58+
59+
``` yaml
60+
on:
61+
push:
62+
branches: [main, protected]
63+
pull_request:
64+
branches: [main]
65+
paths-ignore:
66+
- '**/*.md'
67+
- '**/*.txt'
68+
```
69+
70+
{% note %}
71+
72+
**Notes**
73+
74+
* `on:pull_request:paths-ignore` and `on:pull_request:paths` set conditions that determine whether the actions in the workflow will run on a pull request. They don't determine what files will be analyzed when the actions _are_ run. When a pull request contains any files that are not matched by `on:pull_request:paths-ignore` or `on:pull_request:paths`, the workflow runs the actions and scans all of the files changed in the pull request, including those matched by `on:pull_request:paths-ignore` or `on:pull_request:paths`, unless the files have been excluded. For information on how to exclude files from analysis, see "[Specifying directories to scan](#specifying-directories-to-scan)."
75+
* For {% data variables.product.prodname_codeql %} {% data variables.product.prodname_code_scanning %} workflow files, don't use the `paths-ignore` or `paths` keywords with the `on:push` event as this is likely to cause missing analyses. For accurate results, {% data variables.product.prodname_codeql %} {% data variables.product.prodname_code_scanning %} needs to be able to compare new changes with the analysis of the previous commit.
76+
77+
{% endnote %}
78+
79+
For more information about using `on:pull_request:paths-ignore` and `on:pull_request:paths` to determine when a workflow will run for a pull request, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpaths)."
80+
5581
#### Scanning on a schedule
5682

5783
If you use the default {% data variables.product.prodname_codeql_workflow %}, the workflow will scan the code in your repository once a week, in addition to the scans triggered by events. To adjust this schedule, edit the `cron` value in the workflow. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#onschedule)."
@@ -235,13 +261,13 @@ If you only want to run custom queries, you can disable the default security que
235261

236262
#### Specifying directories to scan
237263

238-
For the interpreted languages that {% data variables.product.prodname_codeql %} supports (Python and JavaScript/TypeScript), you can restrict {% data variables.product.prodname_code_scanning %} to files in specific directories by adding a `paths` array to the configuration file. You can exclude the files in specific directories from scans by adding a `paths-ignore` array.
264+
For the interpreted languages that {% data variables.product.prodname_codeql %} supports (Python and JavaScript/TypeScript), you can restrict {% data variables.product.prodname_code_scanning %} to files in specific directories by adding a `paths` array to the configuration file. You can exclude the files in specific directories from analysis by adding a `paths-ignore` array.
239265

240266
``` yaml
241-
paths:
267+
paths:
242268
- src
243269
paths-ignore:
244-
- node_modules
270+
- src/node_modules
245271
- '**/*.test.js'
246272
```
247273

@@ -254,7 +280,7 @@ paths-ignore:
254280

255281
{% endnote %}
256282

257-
For C/C++, C#, and Java, if you want to limit {% data variables.product.prodname_code_scanning %} to specific directories in your project, you must specify appropriate build steps in the workflow. The commands you need to use to exclude a directory from the build will depend on your build system. For more information, see "[Configuring the {% data variables.product.prodname_codeql %} workflow for compiled languages](/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language)."
283+
For compiled languages, if you want to limit {% data variables.product.prodname_code_scanning %} to specific directories in your project, you must specify appropriate build steps in the workflow. The commands you need to use to exclude a directory from the build will depend on your build system. For more information, see "[Configuring the {% data variables.product.prodname_codeql %} workflow for compiled languages](/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language)."
258284

259285
You can quickly analyze small portions of a monorepo when you modify code in specific directories. You'll need to both exclude directories in your build steps and use the `paths-ignore` and `paths` keywords for [`on.<push|pull_request>`](/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpaths) in your workflow.
260286

content/github/managing-your-work-on-github/about-labels.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

content/github/managing-your-work-on-github/applying-labels-to-issues-and-pull-requests.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

content/github/managing-your-work-on-github/creating-a-label.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

content/github/managing-your-work-on-github/deleting-a-label.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

content/github/managing-your-work-on-github/editing-a-label.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

content/github/managing-your-work-on-github/index.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ versions:
1414

1515
### Table of Contents
1616

17-
{% topic_link_in_list /managing-your-work-with-issues %}
17+
{% topic_link_in_list /managing-your-work-with-issues-and-pull-requests %}
1818
{% link_in_list /about-issues %}
1919
{% link_in_list /creating-an-issue %}
2020
<!-- if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.15" -->
@@ -27,6 +27,7 @@ versions:
2727
{% link_in_list /pinning-an-issue-to-your-repository %}
2828
<!-- endif -->
2929
{% link_in_list /creating-a-permanent-link-to-a-code-snippet %}
30+
{% link_in_list /managing-labels %}
3031
{% link_in_list /about-task-lists %}
3132
{% link_in_list /about-automation-for-issues-and-pull-requests-with-query-parameters %}
3233
{% link_in_list /file-attachments-on-issues-and-pull-requests %}
@@ -35,12 +36,6 @@ versions:
3536
{% link_in_list /disabling-issues %}
3637
{% link_in_list /linking-a-pull-request-to-an-issue %}
3738
{% link_in_list /about-duplicate-issues-and-pull-requests %}
38-
{% topic_link_in_list /labeling-issues-and-pull-requests %}
39-
{% link_in_list /about-labels %}
40-
{% link_in_list /creating-a-label %}
41-
{% link_in_list /applying-labels-to-issues-and-pull-requests %}
42-
{% link_in_list /editing-a-label %}
43-
{% link_in_list /deleting-a-label %}
4439
{% topic_link_in_list /managing-project-boards %}
4540
{% link_in_list /about-project-boards %}
4641
{% link_in_list /creating-a-project-board %}

content/github/managing-your-work-on-github/labeling-issues-and-pull-requests.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)