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: content/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-the-codeql-workflow.md
+50-10Lines changed: 50 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,16 +83,6 @@ For more information about specifying build steps, see "[Configuring the {% data
83
83
84
84
The {% data variables.product.prodname_codeql %} `autobuild` feature uses heuristics to build the code in a repository, however, sometimes this approach results in incomplete analysis of a repository. For example, when multiple `build.sh` commands exist in a single repository, the analysis may not complete since the `autobuild` step will only execute one of the commands. The solution is to replace the `autobuild` step with build steps which build all of the source code which you wish to analyze. 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)."
85
85
86
-
### Error: "Server error"
87
-
88
-
If the run of a workflow for {% data variables.product.prodname_code_scanning %} fails due to a server error, try running the workflow again. If the problem persists, contact {% data variables.contact.contact_support %}.
89
-
90
-
### Error: "Out of disk" or "Out of memory"
91
-
92
-
On very large projects, {% data variables.product.prodname_codeql %} may run out of disk or memory on the runner.
93
-
{% if currentVersion == "free-pro-team@latest" %}If you encounter this issue on a hosted {% data variables.product.prodname_actions %} runner, contact {% data variables.contact.contact_support %} so that we can investigate the problem.
94
-
{% else %}If you encounter this issue, try increasing the memory on the runner.{% endif %}
95
-
96
86
### The build takes too long
97
87
98
88
If your build with {% data variables.product.prodname_codeql %} analysis takes too long to run, there are several approaches you can try to reduce the build time.
@@ -127,3 +117,53 @@ If you are analyzing code written in Python, you may see different results depen
127
117
On GitHub-hosted runners that use Linux, the {% data variables.product.prodname_codeql_workflow %} tries to install and analyze Python dependencies, which could lead to more results. To disable the auto-install, add `setup-python-dependencies: false` to the "Initialize CodeQL" step of the workflow. For more information about configuring the analysis of Python dependencies, see "[Analyzing Python dependencies](/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#analyzing-python-dependencies)."
128
118
129
119
{% endif %}
120
+
121
+
### Error: "Server error"
122
+
123
+
If the run of a workflow for {% data variables.product.prodname_code_scanning %} fails due to a server error, try running the workflow again. If the problem persists, contact {% data variables.contact.contact_support %}.
124
+
125
+
### Error: "Out of disk" or "Out of memory"
126
+
127
+
On very large projects, {% data variables.product.prodname_codeql %} may run out of disk or memory on the runner.
128
+
{% if currentVersion == "free-pro-team@latest" %}If you encounter this issue on a hosted {% data variables.product.prodname_actions %} runner, contact {% data variables.contact.contact_support %} so that we can investigate the problem.
129
+
{% else %}If you encounter this issue, try increasing the memory on the runner.{% endif %}
130
+
131
+
### Warning: "git checkout HEAD^2 is no longer necessary"
132
+
133
+
If you're using an old {% data variables.product.prodname_codeql %} workflow you may get the following warning in the output from the "Initialize {% data variables.product.prodname_codeql %}" action:
134
+
135
+
```
136
+
Warning: 1 issue was detected with this workflow: git checkout HEAD^2 is no longer
137
+
necessary. Please remove this step as Code Scanning recommends analyzing the merge
138
+
commit for best results.
139
+
```
140
+
141
+
Fix this by removing the following lines from the {% data variables.product.prodname_codeql %} workflow. These lines were included in the `steps` section of the `Analyze` job in initial versions of the {% data variables.product.prodname_codeql %} workflow.
142
+
143
+
```yaml
144
+
with:
145
+
# We must fetch at least the immediate parents so that if this is
146
+
# a pull request then we can checkout the head.
147
+
fetch-depth: 2
148
+
149
+
# If this run was triggered by a pull request event, then checkout
150
+
# the head of the pull request instead of the merge commit.
151
+
- run: git checkout HEAD^2
152
+
if: {% raw %}${{ github.event_name == 'pull_request' }}{% endraw %}
153
+
```
154
+
155
+
The revised `steps` section of the workflow will look like this:
156
+
157
+
```yaml
158
+
steps:
159
+
- name: Checkout repository
160
+
uses: actions/checkout@v2
161
+
162
+
# Initializes the {% data variables.product.prodname_codeql %} tools for scanning.
163
+
- name: Initialize {% data variables.product.prodname_codeql %}
164
+
uses: github/codeql-action/init@v1
165
+
166
+
...
167
+
```
168
+
169
+
For more information about editing the {% data variables.product.prodname_codeql %} workflow file, see "[Configuring {% data variables.product.prodname_code_scanning %}](/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#editing-a-code-scanning-workflow)."
0 commit comments