Skip to content

Commit 03450ff

Browse files
Merge pull request #601 from github/update-v1.0.4-7726ece0
Merge main into v1
2 parents cf6e019 + 440ccbd commit 03450ff

Some content is hidden

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

70 files changed

+2890
-901
lines changed

.github/workflows/pr-checks.yml

+93-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ jobs:
101101
fi
102102
103103
# Packaging test that runs against a javascript database
104-
test-packaging-javascript:
104+
# Specifying packs in the config file.
105+
test-packaging-javascript-config:
105106
needs: [check-js, check-node-modules]
106107
runs-on: ubuntu-latest
107108

@@ -143,6 +144,97 @@ jobs:
143144
exit 1
144145
fi
145146
147+
# Packaging test that runs against a javascript database
148+
# Specifying packs as an input.
149+
test-packaging-javascript-inputs:
150+
needs: [check-js, check-node-modules]
151+
runs-on: ubuntu-latest
152+
153+
steps:
154+
- uses: actions/checkout@v2
155+
- name: Move codeql-action
156+
shell: bash
157+
run: |
158+
mkdir ../action
159+
mv * .github ../action/
160+
mv ../action/tests/multi-language-repo/{*,.github} .
161+
mv ../action/.github/workflows .github
162+
- uses: ./../action/init
163+
with:
164+
config-file: ".github/codeql/codeql-config-packaging2.yml"
165+
languages: javascript
166+
packs: dsp-testing/codeql-pack1@0.0.4, dsp-testing/codeql-pack2
167+
# TODO: this can be removed when cli v2.5.6 is released and available in the tool cache
168+
tools: https://github.com/dsp-testing/aeisenberg-codeql-action-packaging/releases/download/codeql-bundle-20210615/codeql-bundle-linux64.tar.gz
169+
170+
- name: Build code
171+
shell: bash
172+
run: ./build.sh
173+
- uses: ./../action/analyze
174+
with:
175+
output: "${{ runner.temp }}/results"
176+
env:
177+
TEST_MODE: true
178+
- name: Assert Results
179+
run: |
180+
cd "$RUNNER_TEMP/results"
181+
# We should have 3 hits from these rules
182+
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block"
183+
184+
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
185+
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)"
186+
echo "Found matching rules '$RULES'"
187+
if [ "$RULES" != "$EXPECTED_RULES" ]; then
188+
echo "Did not match expected rules '$EXPECTED_RULES'."
189+
exit 1
190+
fi
191+
192+
# Packaging test that runs against a javascript database
193+
# Specifying packs in the config file and inputs.
194+
test-packaging-javascript-config-and-inputs:
195+
needs: [check-js, check-node-modules]
196+
runs-on: ubuntu-latest
197+
198+
steps:
199+
- uses: actions/checkout@v2
200+
- name: Move codeql-action
201+
shell: bash
202+
run: |
203+
mkdir ../action
204+
mv * .github ../action/
205+
mv ../action/tests/multi-language-repo/{*,.github} .
206+
mv ../action/.github/workflows .github
207+
- uses: ./../action/init
208+
with:
209+
config-file: ".github/codeql/codeql-config-packaging3.yml"
210+
packs: +dsp-testing/codeql-pack1@0.0.4
211+
languages: javascript
212+
# TODO: this can be removed when cli v2.5.6 is released and available in the tool cache
213+
tools: https://github.com/dsp-testing/aeisenberg-codeql-action-packaging/releases/download/codeql-bundle-20210615/codeql-bundle-linux64.tar.gz
214+
215+
- name: Build code
216+
shell: bash
217+
run: ./build.sh
218+
- uses: ./../action/analyze
219+
with:
220+
output: "${{ runner.temp }}/results"
221+
env:
222+
TEST_MODE: true
223+
- name: Assert Results
224+
run: |
225+
cd "$RUNNER_TEMP/results"
226+
# We should have 3 hits from these rules
227+
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block"
228+
229+
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
230+
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)"
231+
echo "Found matching rules '$RULES'"
232+
if [ "$RULES" != "$EXPECTED_RULES" ]; then
233+
echo "Did not match expected rules '$EXPECTED_RULES'."
234+
exit 1
235+
fi
236+
237+
146238
# Identify the CodeQL tool versions to integration test against.
147239
check-codeql-versions:
148240
needs: [check-js, check-node-modules]

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CodeQL Action and CodeQL Runner Changelog
22

3+
## 1.0.4 - 28 Jun 2021
4+
5+
- Fix `RUNNER_TEMP environment variable must be set` when using runner. [#594](https://github.com/github/codeql-action/pull/594)
6+
- Fix couting of lines of code for C# projects. [#586](https://github.com/github/codeql-action/pull/586)
7+
38
## 1.0.3 - 23 Jun 2021
49

510
No user facing changes.

init/action.yml

+9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ inputs:
2222
queries:
2323
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries.
2424
required: false
25+
packs:
26+
description: >-
27+
[Experimental] Comma-separated list of packs to run. Reference a pack in the format `scope/name[@version]`. If `version` is not
28+
specified, then the latest version of the pack is used. By default, this overrides the same setting in a
29+
configuration file; prefix with "+" to use both sets of packs.
30+
31+
This input is only available in single-language analyses. To use packs in multi-language
32+
analyses, you must specify packs in the codeql-config.yml file.
33+
required: false
2534
external-repository-token:
2635
description: A token for fetching external config files and queries if they reside in a private repository.
2736
required: false

lib/analysis-paths.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analysis-paths.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js

+28-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.test.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)