You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-50Lines changed: 58 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
-
# CodeQL Action
2
-
This action runs GitHub's industry-leading static analysis engine, CodeQL, against a repository's source code to find security vulnerabilities. It then automatically uploads the results to GitHub so they can be displayed in the repository's security tab. CodeQL runs an extensible set of [queries](https://github.com/semmle/ql), which have been developed by the community and the [GitHub Security Lab](https://securitylab.github.com/) to find common vulnerabilities in your code.
3
-
1
+
# CodeQL Action
2
+
3
+
This action runs GitHub's industry-leading static analysis engine, CodeQL, against a repository's source code to find security vulnerabilities. It then automatically uploads the results to GitHub so they can be displayed in the repository's security tab. CodeQL runs an extensible set of [queries](https://github.com/semmle/ql), which have been developed by the community and the [GitHub Security Lab](https://securitylab.github.com/) to find common vulnerabilities in your code.
4
+
4
5
[Sign up for the Advanced Security beta](https://github.com/features/security/advanced-security/signup)
5
-
6
-
## Usage
6
+
7
+
## Usage
7
8
8
9
To get code scanning results from CodeQL analysis on your repo you can use the following workflow as a template:
9
10
@@ -22,39 +23,38 @@ jobs:
22
23
strategy:
23
24
fail-fast: false
24
25
25
-
26
26
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
27
27
runs-on: ubuntu-latest
28
28
29
29
steps:
30
-
- name: Checkout repository
31
-
uses: actions/checkout@v2
32
-
33
-
# Initializes the CodeQL tools for scanning.
34
-
- name: Initialize CodeQL
35
-
uses: github/codeql-action/init@v1
36
-
# Override language selection by uncommenting this and choosing your languages
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
41
+
# If this step fails, then you should remove it and run the build manually (see below).
42
+
- name: Autobuild
43
+
uses: github/codeql-action/autobuild@v1
44
+
45
+
# ℹ️ Command-line programs to run using the OS shell.
46
+
# 📚 https://git.io/JvXDl
47
+
48
+
# ✏️ If the Autobuild fails above, remove it and uncomment the following
49
+
#three lines and modify them (or add more) to build your code if your
50
+
# project uses a compiled language
51
+
52
+
#- run: |
53
+
# make bootstrap
54
+
# make release
55
+
56
+
- name: Perform CodeQL Analysis
57
+
uses: github/codeql-action/analyze@v1
58
58
```
59
59
60
60
If you prefer to integrate this within an existing CI workflow, it should end up looking something like this:
@@ -73,19 +73,23 @@ If you prefer to integrate this within an existing CI workflow, it should end up
73
73
- name: Perform CodeQL Analysis
74
74
uses: github/codeql-action/analyze@v1
75
75
```
76
+
76
77
### Actions triggers
77
-
The CodeQL action should be run on `push` events, and on a `schedule`. `Push` events allow us to do detailed analysis of the delta in a pull request, while the `schedule` event ensures that GitHub regularly scans the repository for the latest vulnerabilities, even if the repository becomes inactive. This action does not support the `pull_request` event.
78
78
79
-
### Configuration
79
+
The CodeQL action should be run on `push` events, and on a `schedule`. `Push` events allow us to do a detailed analysis of the delta in a pull request, while the `schedule` event ensures that GitHub regularly scans the repository for the latest vulnerabilities, even if the repository becomes inactive. This action does not support the `pull_request` event.
80
+
81
+
### Configuration
82
+
80
83
You may optionally specify additional queries for CodeQL to execute by using a config file. The queries must belong to a [QL pack](https://help.semmle.com/codeql/codeql-cli/reference/qlpack-overview.html) and can be in your repository or any public repository. You can choose a single .ql file, a folder containing multiple .ql files, a .qls [query suite](https://help.semmle.com/codeql/codeql-cli/procedures/query-suites.html) file, or any combination of the above. To use queries from other repositories use the same syntax as when [using an action](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsuses).
81
84
82
85
You can choose to ignore some files or folders from the analysis, or include additional files/folders for analysis. This *only* works for Javascript and Python analysis.
83
86
Identifying potential files for extraction:
84
-
- Scans each folder that's defined as `paths` in turn, traversing subfolders and looking for relevant files.
87
+
88
+
- Scans each folder that's defined as `paths` in turn, traversing subfolders, and looking for relevant files.
85
89
- If it finds a subfolder that's defined as `paths-ignore`, stop traversing.
86
90
- If a file or folder is both in `paths` and `paths-ignore`, the `paths-ignore` is ignored.
87
91
88
-
Use the config-file parameter of the init action to enable the configuration file. For example:
92
+
Use the `config-file` parameter of the init action to enable the configuration file. For example:
89
93
90
94
```yaml
91
95
- uses: github/codeql-action/init@v1
@@ -103,17 +107,17 @@ queries:
103
107
uses: ./my-queries
104
108
- name: External Javascript QL pack (Runs a QL pack located in an external repo)
0 commit comments