Skip to content

Commit a588cfb

Browse files
authored
repo sync
2 parents 4629901 + a11ebb3 commit a588cfb

2 files changed

Lines changed: 53 additions & 10 deletions

File tree

content/actions/creating-actions/metadata-syntax-for-github-actions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,16 @@ For example, this `cleanup.js` will only run on Linux-based runners:
209209
##### `runs.steps[*].run`
210210

211211
**Required** The command you want to run. This can be inline or a script in your action repository:
212+
213+
{% raw %}
212214
```yaml
213215
runs:
214216
using: "composite"
215217
steps:
216218
- run: ${{ github.action_path }}/test/script.sh
217219
shell: bash
218220
```
221+
{% endraw %}
219222

220223
Alternatively, you can use `$GITHUB_ACTION_PATH`:
221224

content/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-the-codeql-workflow.md

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,6 @@ For more information about specifying build steps, see "[Configuring the {% data
8383

8484
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)."
8585

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-
9686
### The build takes too long
9787

9888
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
127117
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)."
128118

129119
{% 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

Comments
 (0)