Skip to content

Commit 5581e08

Browse files
Merge pull request #805 from github/update-v1.0.22-ae284321
Merge main into v1
2 parents e891551 + df5cf24 commit 5581e08

File tree

766 files changed

+54536
-20504
lines changed

Some content is hidden

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

766 files changed

+54536
-20504
lines changed

.github/workflows/__debug-artifacts.yml

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__extractor-ram-threads.yml

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__unset-environment.yml

Lines changed: 88 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/pr-checks.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,3 +393,42 @@ jobs:
393393
# Deliberately don't use TEST_MODE here. This is specifically testing
394394
# the compatibility with the API.
395395
runner/dist/codeql-runner-linux upload --sarif-file src/testdata/empty-sarif.sarif --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
396+
397+
runner-extractor-ram-threads-options:
398+
name: Runner ubuntu extractor RAM and threads options
399+
needs: [check-js, check-node-modules]
400+
runs-on: ubuntu-latest
401+
402+
steps:
403+
- uses: actions/checkout@v2
404+
405+
- name: Build runner
406+
run: |
407+
cd runner
408+
npm install
409+
npm run build-runner
410+
411+
- name: Run init
412+
run: |
413+
runner/dist/codeql-runner-linux init --ram=230 --threads=1 --repository $GITHUB_REPOSITORY --languages java --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
414+
415+
- name: Assert Results
416+
shell: bash
417+
run: |
418+
. ./codeql-runner/codeql-env.sh
419+
if [ "${CODEQL_RAM}" != "230" ]; then
420+
echo "CODEQL_RAM is '${CODEQL_RAM}' instead of 230"
421+
exit 1
422+
fi
423+
if [ "${CODEQL_EXTRACTOR_JAVA_RAM}" != "230" ]; then
424+
echo "CODEQL_EXTRACTOR_JAVA_RAM is '${CODEQL_EXTRACTOR_JAVA_RAM}' instead of 230"
425+
exit 1
426+
fi
427+
if [ "${CODEQL_THREADS}" != "1" ]; then
428+
echo "CODEQL_THREADS is '${CODEQL_THREADS}' instead of 1"
429+
exit 1
430+
fi
431+
if [ "${CODEQL_EXTRACTOR_JAVA_THREADS}" != "1" ]; then
432+
echo "CODEQL_EXTRACTOR_JAVA_THREADS is '${CODEQL_EXTRACTOR_JAVA_THREADS}' instead of 1"
433+
exit 1
434+
fi

.github/workflows/update-dependencies.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
uses: actions/checkout@v2
14+
with:
15+
persist-credentials: false
1416

1517
- name: Remove PR label
1618
env:

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CodeQL Action and CodeQL Runner Changelog
22

3+
## 1.0.22 - 04 Nov 2021
4+
5+
- The `init` step of the Action now supports `ram` and `threads` inputs to limit resource use of CodeQL extractors. These inputs also serve as defaults to the subsequent `analyze` step, which finalizes the database and executes queries. [#738](https://github.com/github/codeql-action/pull/738)
6+
- When used with CodeQL 2.7.1 or above, the Action now includes custom query help in the analysis results uploaded to GitHub code scanning, if available. To add help text for a custom query, create a Markdown file next to the `.ql` file containing the query, using the same base name but the file extension `.md`. [#804](https://github.com/github/codeql-action/pull/804)
7+
38
## 1.0.21 - 28 Oct 2021
49

510
- Update default CodeQL bundle version to 2.7.0. [#795](https://github.com/github/codeql-action/pull/795)

analyze/action.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
1-
name: 'CodeQL: Finish'
2-
description: 'Finalize CodeQL database'
3-
author: 'GitHub'
1+
name: "CodeQL: Finish"
2+
description: "Finalize CodeQL database"
3+
author: "GitHub"
44
inputs:
55
check_name:
66
description: The name of the check run to add text to.
77
required: false
88
output:
99
description: The path of the directory in which to save the SARIF results
1010
required: false
11-
default: '../results'
11+
default: "../results"
1212
upload:
13-
description: Upload the SARIF file
13+
description: Upload the SARIF file to Code Scanning
1414
required: false
1515
default: "true"
1616
cleanup-level:
1717
description: "Level of cleanup to perform on CodeQL databases at the end of the analyze step. This should either be 'none' to skip cleanup, or be a valid argument for the --mode flag of the CodeQL CLI command 'codeql database cleanup' as documented at https://codeql.github.com/docs/codeql-cli/manual/database-cleanup"
1818
required: false
1919
default: "brutal"
2020
ram:
21-
description: Override the amount of memory in MB to be used by CodeQL. By default, almost all the memory of the machine is used.
21+
description: >-
22+
The amount of memory in MB that can be used by CodeQL for database finalization and query execution.
23+
By default, this action will use the same amount of memory as previously set in the "init" action.
24+
If the "init" action also does not have an explicit "ram" input, this action will use most of the
25+
memory available in the system (which for GitHub-hosted runners is 6GB for Linux, 5.5GB for Windows,
26+
and 13GB for macOS).
2227
required: false
2328
add-snippets:
2429
description: Specify whether or not to add code snippets to the output sarif file.
@@ -29,7 +34,12 @@ inputs:
2934
required: false
3035
default: "false"
3136
threads:
32-
description: The number of threads to be used by CodeQL.
37+
description: >-
38+
The number of threads that can be used by CodeQL for database finalization and query execution.
39+
By default, this action will use the same number of threads as previously set in the "init" action.
40+
If the "init" action also does not have an explicit "threads" input, this action will use all the
41+
hardware threads available in the system (which for GitHub-hosted runners is 2 for Linux and Windows
42+
and 3 for macOS).
3343
required: false
3444
checkout_path:
3545
description: "The path at which the analyzed repository was checked out. Used to relativize any absolute paths in the uploaded SARIF file."
@@ -50,5 +60,5 @@ outputs:
5060
db-locations:
5161
description: A map from language to absolute path for each database created by CodeQL.
5262
runs:
53-
using: 'node12'
54-
main: '../lib/analyze-action.js'
63+
using: "node12"
64+
main: "../lib/analyze-action.js"

init/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ inputs:
4141
source-root:
4242
description: Path of the root source code directory, relative to $GITHUB_WORKSPACE.
4343
required: false
44+
ram:
45+
description: >-
46+
The amount of memory in MB that can be used by CodeQL extractors.
47+
By default, CodeQL extractors will use most of the memory available in the system
48+
(which for GitHub-hosted runners is 6GB for Linux, 5.5GB for Windows, and 13GB for macOS).
49+
This input also sets the amount of memory that can later be used by the "analyze" action.
50+
required: false
51+
threads:
52+
description: >-
53+
The number of threads that can be used by CodeQL extractors.
54+
By default, CodeQL extractors will use all the hardware threads available in the system
55+
(which for GitHub-hosted runners is 2 for Linux and Windows and 3 for macOS).
56+
This input also sets the number of threads that can later be used by the "analyze" action.
57+
required: false
58+
debug:
59+
description: Enable debugging mode. This will result in more output being produced which may be useful when debugging certain issues.
60+
required: false
61+
default: 'false'
4462
outputs:
4563
codeql-path:
4664
description: The path of the CodeQL binary used for analysis

lib/analysis-paths.test.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)