Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into v1 #601

Merged
merged 26 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
476f13e
Upgrade Actions Tool Cache.
chrisgavin Jun 23, 2021
59560e5
Replace custom tool download method with the one in the tool cache li…
chrisgavin Jun 23, 2021
f5a5d3a
Update changelog and version after v1.0.3
invalid-email-address Jun 23, 2021
1496843
1.0.4
invalid-email-address Jun 23, 2021
e684c09
Merge pull request #587 from github/toolcache-upgrade
chrisgavin Jun 23, 2021
c98b431
Merge branch 'main' into mergeback/v1.0.3-to-main-cf6e0194
aeisenberg Jun 23, 2021
7729b51
Merge pull request #588 from github/mergeback/v1.0.3-to-main-cf6e0194
aeisenberg Jun 23, 2021
68b6873
Fix C# line counting and add test
edoardopirovano Jun 23, 2021
6e577cf
Add new `packs` input to init action
aeisenberg Jun 23, 2021
e38356b
Update lock file
aeisenberg Jun 23, 2021
c5434c9
Merge branch 'main' into csharp-loc
aeisenberg Jun 23, 2021
9f37000
Fix dependencies
aeisenberg Jun 23, 2021
ac402bf
Merge pull request #586 from edoardopirovano/csharp-loc
aeisenberg Jun 24, 2021
9200db3
Restore original getCodeQLActionRepository behaviour
simon-engledew Jun 24, 2021
26ade03
Just reverse test case
simon-engledew Jun 24, 2021
a1f71cf
Add Ruby to 'isInterpretedLanguage'
aibaars Jun 24, 2021
590c245
Merge pull request #593 from github/aibaars/ruby-is-interpreted
aibaars Jun 24, 2021
af32a29
Merge branch 'main' into simon-engledew/fix-runner-temp-missing
aeisenberg Jun 24, 2021
db80a9a
Merge pull request #594 from github/simon-engledew/fix-runner-temp-mi…
aeisenberg Jun 24, 2021
40852fa
Improve error messages from CLI invocations
edoardopirovano Jun 24, 2021
85ac9fe
Remove misleading comment.
edoardopirovano Jun 25, 2021
4087f37
Add extra integration test for packaging
aeisenberg Jun 24, 2021
67312df
Merge branch 'main' into aeisenberg/pack-in-inputs
aeisenberg Jun 25, 2021
7726ece
Merge pull request #591 from github/aeisenberg/pack-in-inputs
aeisenberg Jun 25, 2021
6017205
1.0.4
invalid-email-address Jun 28, 2021
440ccbd
Prepare CHANGELOG for 1.0.4
edoardopirovano Jun 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 93 additions & 1 deletion .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ jobs:
fi

# Packaging test that runs against a javascript database
test-packaging-javascript:
# Specifying packs in the config file.
test-packaging-javascript-config:
needs: [check-js, check-node-modules]
runs-on: ubuntu-latest

Expand Down Expand Up @@ -143,6 +144,97 @@ jobs:
exit 1
fi

# Packaging test that runs against a javascript database
# Specifying packs as an input.
test-packaging-javascript-inputs:
needs: [check-js, check-node-modules]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
mv ../action/.github/workflows .github
- uses: ./../action/init
with:
config-file: ".github/codeql/codeql-config-packaging2.yml"
languages: javascript
packs: dsp-testing/codeql-pack1@0.0.4, dsp-testing/codeql-pack2
# TODO: this can be removed when cli v2.5.6 is released and available in the tool cache
tools: https://github.com/dsp-testing/aeisenberg-codeql-action-packaging/releases/download/codeql-bundle-20210615/codeql-bundle-linux64.tar.gz

- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
output: "${{ runner.temp }}/results"
env:
TEST_MODE: true
- name: Assert Results
run: |
cd "$RUNNER_TEMP/results"
# We should have 3 hits from these rules
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block"

# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)"
echo "Found matching rules '$RULES'"
if [ "$RULES" != "$EXPECTED_RULES" ]; then
echo "Did not match expected rules '$EXPECTED_RULES'."
exit 1
fi

# Packaging test that runs against a javascript database
# Specifying packs in the config file and inputs.
test-packaging-javascript-config-and-inputs:
needs: [check-js, check-node-modules]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
mv ../action/.github/workflows .github
- uses: ./../action/init
with:
config-file: ".github/codeql/codeql-config-packaging3.yml"
packs: +dsp-testing/codeql-pack1@0.0.4
languages: javascript
# TODO: this can be removed when cli v2.5.6 is released and available in the tool cache
tools: https://github.com/dsp-testing/aeisenberg-codeql-action-packaging/releases/download/codeql-bundle-20210615/codeql-bundle-linux64.tar.gz

- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
output: "${{ runner.temp }}/results"
env:
TEST_MODE: true
- name: Assert Results
run: |
cd "$RUNNER_TEMP/results"
# We should have 3 hits from these rules
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block"

# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)"
echo "Found matching rules '$RULES'"
if [ "$RULES" != "$EXPECTED_RULES" ]; then
echo "Did not match expected rules '$EXPECTED_RULES'."
exit 1
fi


# Identify the CodeQL tool versions to integration test against.
check-codeql-versions:
needs: [check-js, check-node-modules]
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CodeQL Action and CodeQL Runner Changelog

## 1.0.4 - 28 Jun 2021

- Fix `RUNNER_TEMP environment variable must be set` when using runner. [#594](https://github.com/github/codeql-action/pull/594)
- Fix couting of lines of code for C# projects. [#586](https://github.com/github/codeql-action/pull/586)

## 1.0.3 - 23 Jun 2021

No user facing changes.
Expand Down
9 changes: 9 additions & 0 deletions init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ inputs:
queries:
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.
required: false
packs:
description: >-
[Experimental] Comma-separated list of packs to run. Reference a pack in the format `scope/name[@version]`. If `version` is not
specified, then the latest version of the pack is used. By default, this overrides the same setting in a
configuration file; prefix with "+" to use both sets of packs.

This input is only available in single-language analyses. To use packs in multi-language
analyses, you must specify packs in the codeql-config.yml file.
required: false
external-repository-token:
description: A token for fetching external config files and queries if they reside in a private repository.
required: false
Expand Down
2 changes: 1 addition & 1 deletion lib/analysis-paths.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analysis-paths.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 28 additions & 22 deletions lib/codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/codeql.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading