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 #184

Merged
merged 43 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
82000c2
Allow "additive" queries in workflow by prefixing with "+"
sampart Aug 27, 2020
ab8d9ec
Add a test which combines workflow queries and disabling the defaults
sampart Aug 28, 2020
831c686
Add details of queries property to README
sampart Aug 28, 2020
23cf700
Extract common test code to a function
sampart Aug 28, 2020
abf5854
Extract more common test code to function
sampart Aug 28, 2020
2dbd7e8
Fix tracing when there are multiple self-hosted runners
robertbrignull Sep 2, 2020
5c0bd22
set -ExecutionPolicy Bypass
robertbrignull Sep 2, 2020
48df013
add alternative script for in runner mode
robertbrignull Sep 2, 2020
ebb4115
make inputting refs easier
robertbrignull Sep 2, 2020
32eb1c4
Print that we are downloading codeql and it may take a while
robertbrignull Sep 2, 2020
9782622
Print path to file instead of file contents
robertbrignull Sep 2, 2020
0e9b8f4
Merge pull request #168 from github/runner_refs
robertbrignull Sep 7, 2020
789059e
Merge branch 'main' into windows_tracing
robertbrignull Sep 7, 2020
694fa2d
add options to specify process name or level to trace
robertbrignull Sep 7, 2020
1a772a2
Merge branch 'main' into codeql_download_info
robertbrignull Sep 7, 2020
8c43427
Merge pull request #169 from github/codeql_download_info
robertbrignull Sep 7, 2020
c689371
Merge branch 'main' into windows_message
robertbrignull Sep 7, 2020
556aed4
Merge pull request #170 from github/windows_message
robertbrignull Sep 7, 2020
212f448
Merge branch 'main' into windows_tracing
robertbrignull Sep 7, 2020
7d9c81f
Print final process we choose
robertbrignull Sep 7, 2020
d677f16
Merge branch 'main' into allow-additive-queries-in-workflow
sampart Sep 8, 2020
18cd03a
Make variable name less ambiguous
sampart Sep 8, 2020
506e641
Merge pull request #167 from github/windows_tracing
robertbrignull Sep 8, 2020
e4b0068
add more integration tests for the runner
robertbrignull Sep 8, 2020
4ad13df
Merge branch 'main' into allow-additive-queries-in-workflow
sampart Sep 9, 2020
028706c
Merge pull request #165 from github/allow-additive-queries-in-workflow
sampart Sep 9, 2020
67246cd
Update integration-testing.yml
robertbrignull Sep 9, 2020
d82e34b
Merge branch 'main' into runner-integration-tests
robertbrignull Sep 9, 2020
3db0a25
add another fingerprinting test
robertbrignull Sep 9, 2020
3be0e89
make a local repo for checkoutExternalQueries
robertbrignull Sep 9, 2020
4d8719b
Merge pull request #176 from github/fingerprint_test
robertbrignull Sep 10, 2020
e608367
Merge branch 'main' into runner-integration-tests
robertbrignull Sep 10, 2020
c5f77d0
Merge pull request #175 from github/runner-integration-tests
robertbrignull Sep 10, 2020
d4f40db
Merge branch 'main' into external_queries_test
robertbrignull Sep 10, 2020
75af0bf
Merge pull request #177 from github/external_queries_test
robertbrignull Sep 10, 2020
77f767c
add optional workflow input to specify whether snippets are added to …
nickfyson Sep 10, 2020
ea3706d
Fix "Using a custom configuration" link in README
ericcornelissen Sep 10, 2020
a2cdfc8
Merge pull request #180 from ericcornelissen/patch-1
robertbrignull Sep 11, 2020
be681d4
Merge branch 'main' into nickfyson/include-snippets
nickfyson Sep 11, 2020
57ef26c
Merge pull request #178 from github/nickfyson/include-snippets
nickfyson Sep 11, 2020
0b64878
Bump node-fetch from 2.6.0 to 2.6.1
dependabot[bot] Sep 12, 2020
0579b4d
Vendoring node_modules
Sep 13, 2020
6567bff
Merge pull request #183 from github/dependabot/npm_and_yarn/node-fetc…
Sep 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
294 changes: 294 additions & 0 deletions .github/workflows/integration-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,297 @@ jobs:
- uses: ./../action/analyze
env:
TEST_MODE: true

runner-analyze-javascript-ubuntu:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build runner
run: |
cd runner
npm install
npm run build-runner

- name: Run init
run: |
# Pass --config-file here, but not for other jobs in this workflow.
# This means we're testing the config file parsing in the runner
# but not slowing down all jobs unnecessarily as it doesn't add much
# testing the parsing on different operating systems and languages.
runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages javascript --config-file ./.github/codeql/codeql-config.yml --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}

- name: Run analyze
run: |
runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true

runner-analyze-javascript-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: Build runner
run: |
cd runner
npm install
npm run build-runner

- name: Run init
run: |
runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages javascript --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}

- name: Run analyze
run: |
runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true

runner-analyze-javascript-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Build runner
run: |
cd runner
npm install
npm run build-runner

- name: Run init
run: |
runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages javascript --config-file ./.github/codeql/codeql-config.yml --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}

- name: Run analyze
run: |
runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true

runner-analyze-csharp-ubuntu:
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} .

- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner

- name: Run init
run: |
../action/runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}

- name: Build code
run: |
. ./codeql-runner/codeql-env.sh
dotnet build

- name: Run analyze
run: |
../action/runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true

runner-analyze-csharp-windows:
runs-on: windows-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} .

- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner

- name: Run init
run: |
../action/runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages csharp --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}

- name: Build code
shell: powershell
run: |
cat ./codeql-runner/codeql-env.sh | Invoke-Expression
dotnet build

- name: Run analyze
run: |
../action/runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true

runner-analyze-csharp-macos:
runs-on: macos-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} .

- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner

- name: Run init
run: |
../action/runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}

- name: Build code
shell: bash
run: |
. ./codeql-runner/codeql-env.sh
dotnet build

- name: Run analyze
run: |
../action/runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true


runner-analyze-csharp-autobuild-ubuntu:
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} .

- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner

- name: Run init
run: |
../action/runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}

- name: Build code
run: |
../action/runner/dist/codeql-runner-linux autobuild

- name: Run analyze
run: |
../action/runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true

runner-analyze-csharp-autobuild-windows:
runs-on: windows-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} .

- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner

- name: Run init
run: |
../action/runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages csharp --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}

- name: Build code
shell: powershell
run: |
../action/runner/dist/codeql-runner-win.exe autobuild

- name: Run analyze
run: |
../action/runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true

runner-analyze-csharp-autobuild-macos:
runs-on: macos-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} .

- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner

- name: Run init
run: |
../action/runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}

- name: Build code
shell: bash
run: |
../action/runner/dist/codeql-runner-macos autobuild

- name: Run analyze
run: |
../action/runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true

runner-upload-sarif:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build runner
run: |
cd runner
npm install
npm run build-runner

- name: Upload with runner
run: |
# Deliberately don't use TEST_MODE here. This is specifically testing
# the compatibility with the API.
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 }}
26 changes: 0 additions & 26 deletions .github/workflows/runner.yml

This file was deleted.

18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,23 @@ Use the `config-file` parameter of the `init` action to enable the configuration
config-file: ./.github/codeql/codeql-config.yml
```

The configuration file must be located within the local repository. For information on how to write a configuration file, see "[Using a custom configuration](https://help.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#using-a-custom-configuration)."
The configuration file must be located within the local repository. For information on how to write a configuration file, see "[Using a custom configuration file](https://help.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#using-a-custom-configuration-file)."

If you only want to customise the queries used, you can specify them in your workflow instead of creating a config file, using the `queries` property of the `init` action:

```yaml
- uses: github/codeql-action/init@v1
with:
queries: <local-or-remote-query>,<another-query>
```

By default, this will override any queries specified in a config file. If you wish to use both sets of queries, prefix the list of queries in the workflow with `+`:

```yaml
- uses: github/codeql-action/init@v1
with:
queries: +<local-or-remote-query>,<another-query>
```

## Troubleshooting

Expand Down
4 changes: 4 additions & 0 deletions analyze/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
ram:
description: Override the amount of memory in MB to be used by CodeQL. By default, almost all the memory of the machine is used.
required: false
add-snippets:
description: Specify whether or not to add code snippets to the output sarif file.
required: false
default: "true"
threads:
description: The number of threads to be used by CodeQL.
required: false
Expand Down
2 changes: 1 addition & 1 deletion init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inputs:
description: Path of the config file to use
required: false
queries:
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file
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
runs:
using: 'node12'
Expand Down
2 changes: 1 addition & 1 deletion lib/analyze-action.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/analyze-action.js.map

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