Skip to content

Commit 80a5f3c

Browse files
Merge pull request #44 from github/merge-master-v1
Update v1 branch to latest master
2 parents 999c772 + ff40939 commit 80a5f3c

File tree

12,002 files changed

+90320
-1450001
lines changed

Some content is hidden

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

12,002 files changed

+90320
-1450001
lines changed

.github/codeql/codeql-config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
me: "CodeQL config"
1+
name: "CodeQL config"
22
queries:
33
- name: Run custom queries
44
uses: ./queries
5+
paths-ignore:
6+
- tests

.github/workflows/codeql.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ jobs:
1313
- uses: actions/checkout@v1
1414
- uses: ./init
1515
with:
16-
config-file: ./.github/codeql/codeql-config.yml
16+
languages: javascript
17+
config-file: ./.github/codeql/codeql-config.yml
1718
- uses: ./analyze

.github/workflows/integration-testing.yml

Lines changed: 112 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,118 @@ name: "Integration Testing"
33
on: [push]
44

55
jobs:
6-
dispatch-events:
7-
if: github.event.repository.full_name == 'github/codeql-action'
6+
multi-language-repo_test-autodetect-languages:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [ubuntu-latest, windows-latest]
11+
runs-on: ${{ matrix.os }}
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Move codeql-action
16+
shell: bash
17+
run: |
18+
mkdir ../action
19+
shopt -s dotglob
20+
mv * ../action/
21+
mv ../action/tests/multi-language-repo/* .
22+
- uses: ./../action/init
23+
- name: Build code
24+
shell: bash
25+
run: ./build.sh
26+
- uses: ./../action/analyze
27+
env:
28+
TEST_MODE: true
29+
30+
multi-language-repo_test-custom-queries:
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os: [ubuntu-latest, windows-latest, macos-latest]
35+
runs-on: ${{ matrix.os }}
36+
37+
steps:
38+
- uses: actions/checkout@v2
39+
- name: Move codeql-action
40+
shell: bash
41+
run: |
42+
mkdir ../action
43+
shopt -s dotglob
44+
mv * ../action/
45+
mv ../action/tests/multi-language-repo/* .
46+
- uses: ./../action/init
47+
with:
48+
languages: cpp,csharp,java,javascript,python
49+
config-file: ./.github/codeql/custom-queries.yml
50+
- name: Build code
51+
shell: bash
52+
run: ./build.sh
53+
- uses: ./../action/analyze
54+
env:
55+
TEST_MODE: true
56+
57+
# Currently is not possible to analyze Go in conjunction with other languages in macos
58+
multi-language-repo_test-go-custom-queries:
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
os: [ubuntu-latest, windows-latest, macos-latest]
63+
runs-on: ${{ matrix.os }}
64+
65+
steps:
66+
- uses: actions/setup-go@v2
67+
if: ${{ matrix.os == 'macos-latest' }}
68+
with:
69+
go-version: '^1.13.1'
70+
- uses: actions/checkout@v2
71+
- name: Move codeql-action
72+
shell: bash
73+
run: |
74+
mkdir ../action
75+
shopt -s dotglob
76+
mv * ../action/
77+
mv ../action/tests/multi-language-repo/* .
78+
- uses: ./../action/init
79+
with:
80+
languages: go
81+
config-file: ./.github/codeql/custom-queries.yml
82+
- name: Build code
83+
shell: bash
84+
run: ./build.sh
85+
- uses: ./../action/analyze
86+
env:
87+
TEST_MODE: true
88+
89+
90+
multi-language-repo_rubocop:
891
runs-on: ubuntu-latest
92+
993
steps:
10-
- name: Send repository dispatch events
94+
- uses: actions/checkout@v2
95+
- name: Move codeql-action
96+
shell: bash
97+
run: |
98+
mkdir ../action
99+
shopt -s dotglob
100+
mv * ../action/
101+
mv ../action/tests/multi-language-repo/* .
102+
- name: Set up Ruby
103+
uses: ruby/setup-ruby@v1
104+
with:
105+
ruby-version: 2.6
106+
- name: Install Code Scanning integration
107+
run: bundle add code-scanning-rubocop --version 0.2.0 --skip-install
108+
- name: Install dependencies
109+
run: bundle install
110+
- name: Rubocop run
11111
run: |
12-
curl -X POST \
13-
-H "Authorization: Bearer ${{ secrets.CODEQL_TESTING_TOKEN }}" \
14-
-H "Accept: application/vnd.github.everest-preview+json" \
15-
https://api.github.com/repos/Anthophila/amazon-cognito-js-copy/dispatches \
16-
-d '{"event_type":"codeql-integration","client_payload": {"sha": "${{ github.sha }}"}}'
17-
18-
curl -X POST \
19-
-H "Authorization: Bearer ${{ secrets.CODEQL_TESTING_TOKEN }}" \
20-
-H "Accept: application/vnd.github.everest-preview+json" \
21-
https://api.github.com/repos/Anthophila/electron-test-action/dispatches \
22-
-d '{"event_type":"codeql-integration","client_payload": {"sha": "${{ github.sha }}"}}'
112+
bash -c "
113+
bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
114+
[[ $? -ne 2 ]]
115+
"
116+
- uses: ./../action/upload-sarif
117+
with:
118+
sarif_file: rubocop.sarif
119+
env:
120+
TEST_MODE: true

.github/workflows/js-uptodate-check.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/npm-test.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/pr-checks.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "PR checks"
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tslint:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: tslint
12+
run: npm run-script lint
13+
14+
check-js:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Check generated JavaScript
20+
run: |
21+
# Sanity check that repo is clean to start with
22+
if [ ! -z "$(git status --porcelain)" ]; then
23+
# If we get a fail here then this workflow needs attention...
24+
>&2 echo "Failed: Repo should be clean before testing!"
25+
exit 1
26+
fi
27+
# Generate the JavaScript files
28+
npm run-script build
29+
# Check that repo is still clean
30+
if [ ! -z "$(git status --porcelain)" ]; then
31+
# If we get a fail here then the PR needs attention
32+
>&2 echo "Failed: JavaScript files are not up to date. Run 'npm run-script build' to update"
33+
git status
34+
exit 1
35+
fi
36+
echo "Success: JavaScript files are up to date"
37+
38+
check-node-modules:
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- uses: actions/checkout@v1
43+
- name: Check node modules up to date
44+
run: |
45+
# Sanity check that repo is clean to start with
46+
if [ ! -z "$(git status --porcelain)" ]; then
47+
# If we get a fail here then this workflow needs attention...
48+
>&2 echo "Failed: Repo should be clean before testing!"
49+
exit 1
50+
fi
51+
52+
# Reinstall modules and then clean to remove absolute paths
53+
# Use 'npm ci' instead of 'npm install' as this is intended to be reproducible
54+
npm ci
55+
npm run removeNPMAbsolutePaths
56+
# Check that repo is still clean
57+
if [ ! -z "$(git status --porcelain)" ]; then
58+
# If we get a fail here then the PR needs attention
59+
>&2 echo "Failed: node_modules are not up to date. Run 'npm ci' and 'npm run removeNPMAbsolutePaths' to update"
60+
git status
61+
exit 1
62+
fi
63+
echo "Success: node_modules are up to date"
64+
65+
npm-test:
66+
runs-on: ubuntu-latest
67+
68+
steps:
69+
- uses: actions/checkout@v1
70+
- name: npm run-script test
71+
run: npm run-script test

.github/workflows/ts-lint.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
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.
44

5+
## License
6+
7+
This project is released under the [MIT License](LICENSE).
8+
9+
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.
10+
511
## Usage
612

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

138144
to `github/codeql-action/analyze`.
139145

140-
### If you do not use a vendor directory
146+
#### If you do not use a vendor directory
141147

142148
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
143149

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

164170
Version 3 does not require the additional flag.
165171

166-
## License
172+
### Analysing Go together with other languages on `macos-latest`
167173

168-
This project is released under the [MIT License](LICENSE).
174+
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.

analyze/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ inputs:
1212
description: Upload the SARIF file
1313
required: false
1414
default: true
15+
ram:
16+
description: Override the amount of memory in MB to be used by CodeQL. By default, almost all the memory of the machine is used.
17+
required: false
1518
token:
1619
default: ${{ github.token }}
1720
matrix:

lib/analysis-paths.js

Lines changed: 1 addition & 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)