Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
43de3a9
start uploading analysis_key parameter
robertbrignull Apr 30, 2020
546d5a8
URL encode the key
robertbrignull Apr 30, 2020
d90fca3
Create undeclared-action-input.ql
robertbrignull Apr 24, 2020
dcd81b5
Make use of getContainer
robertbrignull May 4, 2020
290b34d
Note in readme about go analysis in macos-latest
anaarmas May 4, 2020
ab918b6
use tmp dir for external queries test
robertbrignull May 5, 2020
4fff14b
Update README.md
robertbrignull May 6, 2020
b73b259
Merge pull request #21 from github/clarify-license
robertbrignull May 6, 2020
583f8a9
Add multi-language-repo
Daverlo May 8, 2020
6bab450
Don't analyse tests
Daverlo May 8, 2020
d966ea2
Combine npm related workflows
Daverlo May 8, 2020
baa9c9e
Change integration tests
Daverlo May 8, 2020
c979850
Add test mode
Daverlo May 8, 2020
1f29db5
add multi-language-repo_rubocop
Daverlo May 8, 2020
cf266cb
Move codeql-action
Daverlo May 8, 2020
dc27ff9
Fix rubocop
Daverlo May 8, 2020
4dc964d
Fix go for mac
Daverlo May 8, 2020
c5ecb82
Add gemfile
Daverlo May 8, 2020
189a899
Don't run on mac
Daverlo May 8, 2020
c384705
Fix gemfile
Daverlo May 8, 2020
a511aca
Add separate job for go
Daverlo May 8, 2020
4c11b3d
rephrase Go support limitations
anaarmas May 8, 2020
cc2c18d
Merge branch 'master' into go-macos-readme
anaarmas May 8, 2020
5a800cc
Merge pull request #17 from github/go-macos-readme
anaarmas May 8, 2020
49575f8
Merge branch 'master' into external_queries_tmp_dir
robertbrignull May 11, 2020
538cbdd
Merge pull request #19 from github/external_queries_tmp_dir
robertbrignull May 11, 2020
3aa3d6a
Merge branch 'master' into undeclared-action-input
robertbrignull May 11, 2020
f668f5f
Merge pull request #16 from github/undeclared-action-input
robertbrignull May 11, 2020
3455736
remove URL encoding
robertbrignull May 11, 2020
52cd1f2
Merge branch 'master' into analysisName
robertbrignull May 11, 2020
c0d9de1
Merge pull request #11 from github/analysisName
robertbrignull May 11, 2020
f17ebc8
Add pull_request trigger
Daverlo May 12, 2020
1477a43
Merge branch 'master' into integration-tests
Daverlo May 12, 2020
a76042a
Merge pull request #26 from github/integration-tests
Daverlo May 12, 2020
256c63a
Add and run removeNPMAbsolutePaths
robertbrignull May 12, 2020
15bd158
don't fail-fast on integration tests
robertbrignull May 12, 2020
ec4d38a
add PR check of node modules
robertbrignull May 12, 2020
c88fb69
don't run integration tests on PRs
robertbrignull May 12, 2020
cc471c2
Disable auto-detect language test on macos
Daverlo May 12, 2020
96901ac
Merge pull request #31 from github/macos
Daverlo May 12, 2020
c351304
Merge branch 'master' into fail-slow
robertbrignull May 12, 2020
015ead7
Merge pull request #30 from github/fail-slow
robertbrignull May 12, 2020
51b42fc
Merge branch 'master' into removeNPMAbsolutePaths
robertbrignull May 12, 2020
88c1b7f
provide a better error when codeql fails to download
robertbrignull May 12, 2020
cd95d34
Merge pull request #29 from github/removeNPMAbsolutePaths
robertbrignull May 13, 2020
584df47
Merge branch 'master' into codeql-download-failure
robertbrignull May 13, 2020
27cc8b2
Merge pull request #32 from github/codeql-download-failure
robertbrignull May 13, 2020
0347b72
replace jest with ava
robertbrignull May 4, 2020
572c8bb
switch to using ava
robertbrignull May 4, 2020
d7b9f5a
Merge pull request #18 from github/remove_jest
robertbrignull May 13, 2020
f49335f
upload ref in status report
robertbrignull May 14, 2020
74c9991
Merge pull request #34 from github/upload_ref
robertbrignull May 14, 2020
aa54af7
enable source maps
robertbrignull May 13, 2020
6507fba
Merge pull request #33 from github/source_maps
robertbrignull May 14, 2020
0e6df42
add tests for config-utils
robertbrignull May 5, 2020
fa0a733
Use the full amount of memory available when running queries.
chrisgavin May 14, 2020
b366432
log some stats about the upload
robertbrignull May 15, 2020
5ec6b75
Emit an error if upload happens twice
robertbrignull May 15, 2020
97ef912
Check memory to use is always greater than zero.
chrisgavin May 18, 2020
5c5f422
Merge pull request #37 from github/use-full-memory
chrisgavin May 18, 2020
4e12efc
Merge branch 'master' into upload_stats
robertbrignull May 18, 2020
886b7d3
Merge pull request #38 from github/upload_stats
robertbrignull May 18, 2020
3a883af
Merge branch 'master' into upload_twice
robertbrignull May 18, 2020
63f52e7
Merge pull request #40 from github/upload_twice
robertbrignull May 18, 2020
852b918
Merge branch 'master' into config_utils_tests
robertbrignull May 18, 2020
ff40939
Merge pull request #36 from github/config_utils_tests
robertbrignull May 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 3 additions & 1 deletion .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
me: "CodeQL config"
name: "CodeQL config"
queries:
- name: Run custom queries
uses: ./queries
paths-ignore:
- tests
3 changes: 2 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ jobs:
- uses: actions/checkout@v1
- uses: ./init
with:
config-file: ./.github/codeql/codeql-config.yml
languages: javascript
config-file: ./.github/codeql/codeql-config.yml
- uses: ./analyze
126 changes: 112 additions & 14 deletions .github/workflows/integration-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,118 @@ name: "Integration Testing"
on: [push]

jobs:
dispatch-events:
if: github.event.repository.full_name == 'github/codeql-action'
multi-language-repo_test-autodetect-languages:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
shopt -s dotglob
mv * ../action/
mv ../action/tests/multi-language-repo/* .
- uses: ./../action/init
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
env:
TEST_MODE: true

multi-language-repo_test-custom-queries:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
shopt -s dotglob
mv * ../action/
mv ../action/tests/multi-language-repo/* .
- uses: ./../action/init
with:
languages: cpp,csharp,java,javascript,python
config-file: ./.github/codeql/custom-queries.yml
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
env:
TEST_MODE: true

# Currently is not possible to analyze Go in conjunction with other languages in macos
multi-language-repo_test-go-custom-queries:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/setup-go@v2
if: ${{ matrix.os == 'macos-latest' }}
with:
go-version: '^1.13.1'
- uses: actions/checkout@v2
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
shopt -s dotglob
mv * ../action/
mv ../action/tests/multi-language-repo/* .
- uses: ./../action/init
with:
languages: go
config-file: ./.github/codeql/custom-queries.yml
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
env:
TEST_MODE: true


multi-language-repo_rubocop:
runs-on: ubuntu-latest

steps:
- name: Send repository dispatch events
- uses: actions/checkout@v2
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
shopt -s dotglob
mv * ../action/
mv ../action/tests/multi-language-repo/* .
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Install Code Scanning integration
run: bundle add code-scanning-rubocop --version 0.2.0 --skip-install
- name: Install dependencies
run: bundle install
- name: Rubocop run
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.CODEQL_TESTING_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
https://api.github.com/repos/Anthophila/amazon-cognito-js-copy/dispatches \
-d '{"event_type":"codeql-integration","client_payload": {"sha": "${{ github.sha }}"}}'

curl -X POST \
-H "Authorization: Bearer ${{ secrets.CODEQL_TESTING_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
https://api.github.com/repos/Anthophila/electron-test-action/dispatches \
-d '{"event_type":"codeql-integration","client_payload": {"sha": "${{ github.sha }}"}}'
bash -c "
bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
[[ $? -ne 2 ]]
"
- uses: ./../action/upload-sarif
with:
sarif_file: rubocop.sarif
env:
TEST_MODE: true
27 changes: 0 additions & 27 deletions .github/workflows/js-uptodate-check.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/npm-test.yml

This file was deleted.

71 changes: 71 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: "PR checks"

on: [push, pull_request]

jobs:
tslint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: tslint
run: npm run-script lint

check-js:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Check generated JavaScript
run: |
# Sanity check that repo is clean to start with
if [ ! -z "$(git status --porcelain)" ]; then
# If we get a fail here then this workflow needs attention...
>&2 echo "Failed: Repo should be clean before testing!"
exit 1
fi
# Generate the JavaScript files
npm run-script build
# Check that repo is still clean
if [ ! -z "$(git status --porcelain)" ]; then
# If we get a fail here then the PR needs attention
>&2 echo "Failed: JavaScript files are not up to date. Run 'npm run-script build' to update"
git status
exit 1
fi
echo "Success: JavaScript files are up to date"

check-node-modules:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Check node modules up to date
run: |
# Sanity check that repo is clean to start with
if [ ! -z "$(git status --porcelain)" ]; then
# If we get a fail here then this workflow needs attention...
>&2 echo "Failed: Repo should be clean before testing!"
exit 1
fi

# Reinstall modules and then clean to remove absolute paths
# Use 'npm ci' instead of 'npm install' as this is intended to be reproducible
npm ci
npm run removeNPMAbsolutePaths
# Check that repo is still clean
if [ ! -z "$(git status --porcelain)" ]; then
# If we get a fail here then the PR needs attention
>&2 echo "Failed: node_modules are not up to date. Run 'npm ci' and 'npm run removeNPMAbsolutePaths' to update"
git status
exit 1
fi
echo "Success: node_modules are up to date"

npm-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: npm run-script test
run: npm run-script test
12 changes: 0 additions & 12 deletions .github/workflows/ts-lint.yml

This file was deleted.

12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This action runs GitHub's industry-leading static analysis engine, CodeQL, against a repository's source code to find security vulnerabilities. It then automatically uploads the results to GitHub so they can be displayed in the repository's security tab. CodeQL runs an extensible set of [queries](https://github.com/semmle/ql), which have been developed by the community and the [GitHub Security Lab](https://securitylab.github.com/) to find common vulnerabilities in your code.

## License

This project is released under the [MIT License](LICENSE).

The underlying CodeQL CLI, used in this action, is licensed under the [GitHub CodeQL Terms and Conditions](https://securitylab.github.com/tools/codeql/license). As such, this action may be used on open source projects hosted on GitHub, and on private repositories that are owned by an organisation with GitHub Advanced Security enabled.

## Usage

To get code scanning results from CodeQL analysis on your repo you can use the following workflow as a template:
Expand Down Expand Up @@ -137,7 +143,7 @@ env:

to `github/codeql-action/analyze`.

### If you do not use a vendor directory
#### If you do not use a vendor directory

Dependencies on public repositories should just work. If you have dependencies on private repositories, one option is to use `git config` and a [personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) to authenticate when downloading dependencies. Add a section like

Expand All @@ -163,6 +169,6 @@ dotnet build /p:UseSharedCompilation=false

Version 3 does not require the additional flag.

## License
### Analysing Go together with other languages on `macos-latest`

This project is released under the [MIT License](LICENSE).
When running on macos it is currently not possible to analyze Go in conjunction with any of Java, C/C++, or C#. Each language can still be analyzed separately.
3 changes: 3 additions & 0 deletions analyze/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ inputs:
description: Upload the SARIF file
required: false
default: true
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
token:
default: ${{ github.token }}
matrix:
Expand Down
1 change: 1 addition & 0 deletions lib/analysis-paths.js

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

1 change: 1 addition & 0 deletions lib/analysis-paths.js.map

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

30 changes: 30 additions & 0 deletions lib/analysis-paths.test.js

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

1 change: 1 addition & 0 deletions lib/analysis-paths.test.js.map

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

1 change: 1 addition & 0 deletions lib/autobuild.js

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

1 change: 1 addition & 0 deletions lib/autobuild.js.map

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

Loading