mirror of
https://github.com/github/codeql-action.git
synced 2025-12-17 21:09:40 +08:00
Compare commits
380 Commits
codeql-bun
...
codeql-bun
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d23060145b | ||
|
|
bd8fec7f9f | ||
|
|
6a8522e57e | ||
|
|
168b99b3c2 | ||
|
|
bc7318da91 | ||
|
|
433fe88bf3 | ||
|
|
c208575433 | ||
|
|
b8ea587211 | ||
|
|
65f42e3768 | ||
|
|
d9ceda3823 | ||
|
|
19f00dc212 | ||
|
|
ec298233c1 | ||
|
|
a92a14621b | ||
|
|
204eadab9d | ||
|
|
0e50a19ce3 | ||
|
|
4775eab92e | ||
|
|
16964e90ba | ||
|
|
74cbab4958 | ||
|
|
b36480d849 | ||
|
|
53f80edaf6 | ||
|
|
b31d983f22 | ||
|
|
485cc11a24 | ||
|
|
fc1366f6ec | ||
|
|
e12a2ecd45 | ||
|
|
d47d4c8047 | ||
|
|
f13b180fb8 | ||
|
|
a3cf96418e | ||
|
|
0c27d0da4a | ||
|
|
4b1f530308 | ||
|
|
d98eadb536 | ||
|
|
e4b846c482 | ||
|
|
c310f094dd | ||
|
|
4366485427 | ||
|
|
8340258886 | ||
|
|
6ef6e50882 | ||
|
|
eb40427b00 | ||
|
|
7806af3040 | ||
|
|
abf1cea835 | ||
|
|
e5ade42937 | ||
|
|
6f079be771 | ||
|
|
100bd7bbef | ||
|
|
a6d3a44519 | ||
|
|
5e4af3a25d | ||
|
|
e812e63bb6 | ||
|
|
a589d4087e | ||
|
|
98d24e5629 | ||
|
|
903be79953 | ||
|
|
18ff14b615 | ||
|
|
36a249f5ae | ||
|
|
041757fc59 | ||
|
|
8f19113f88 | ||
|
|
cf1855ae37 | ||
|
|
652709d1b9 | ||
|
|
32dc499307 | ||
|
|
b742728ac2 | ||
|
|
237a258d2b | ||
|
|
5972e6d72e | ||
|
|
164027e682 | ||
|
|
736263f8fe | ||
|
|
3dde1f3512 | ||
|
|
d7d7567b0e | ||
|
|
0e4e857bab | ||
|
|
08d1f21d4f | ||
|
|
f3bd25eefa | ||
|
|
41f1810e52 | ||
|
|
d87ad69338 | ||
|
|
8242edb8ed | ||
|
|
3095a09bb0 | ||
|
|
e00cd12e3e | ||
|
|
a25536bc80 | ||
|
|
a2487fb969 | ||
|
|
e187d074ed | ||
|
|
89c5165e5a | ||
|
|
ba216f7d34 | ||
|
|
68f4f0d3bb | ||
|
|
12d9a244fa | ||
|
|
17573ee1cc | ||
|
|
b6975b4b1a | ||
|
|
b011dbdedf | ||
|
|
40babc141f | ||
|
|
5492b7d104 | ||
|
|
3c81243bb1 | ||
|
|
e2f72f11e4 | ||
|
|
7ba5ed7eed | ||
|
|
21f3020df6 | ||
|
|
b872c5adfd | ||
|
|
8775e86802 | ||
|
|
a2ad80b966 | ||
|
|
c4e22e9fce | ||
|
|
db534af2ae | ||
|
|
bbe8d375fd | ||
|
|
4369dda4ae | ||
|
|
4f08c2cf20 | ||
|
|
81644f35ff | ||
|
|
9ab6aa64a0 | ||
|
|
256973e279 | ||
|
|
59b25b480f | ||
|
|
39d8d7e78f | ||
|
|
39c954c513 | ||
|
|
8af83634ca | ||
|
|
927de483f0 | ||
|
|
e4c0a1b24d | ||
|
|
d3962273b3 | ||
|
|
c3cb270725 | ||
|
|
2b674f7ab9 | ||
|
|
6d47a7c8b1 | ||
|
|
c6ff11c1c4 | ||
|
|
d3f2b2e6d2 | ||
|
|
d49282c3b5 | ||
|
|
c5c475188a | ||
|
|
f140af5e28 | ||
|
|
e0fc1c91b2 | ||
|
|
b95df0b2e7 | ||
|
|
2fed02cbe2 | ||
|
|
0b2a40fa4a | ||
|
|
395ec04a8b | ||
|
|
e1070bd101 | ||
|
|
3ebbd71c74 | ||
|
|
2ae6e13cc3 | ||
|
|
4664f39699 | ||
|
|
b2e16761f3 | ||
|
|
592a896a53 | ||
|
|
4a6b5a54c2 | ||
|
|
436dbd9100 | ||
|
|
d966969093 | ||
|
|
f6d03f448d | ||
|
|
43f1a6c701 | ||
|
|
75ae065ae6 | ||
|
|
0a9e9db27f | ||
|
|
24ca6b0400 | ||
|
|
ebf6415a7d | ||
|
|
a58e90a9da | ||
|
|
fdff4b0a17 | ||
|
|
8840544b91 | ||
|
|
af42a70c34 | ||
|
|
824a20f6aa | ||
|
|
fa47d5ade1 | ||
|
|
71109eca74 | ||
|
|
5d931ea2a2 | ||
|
|
6b17e95b97 | ||
|
|
14c4412c63 | ||
|
|
ebdd5a069f | ||
|
|
5da183dcc2 | ||
|
|
b873a18a2f | ||
|
|
66ed6f46ba | ||
|
|
90bbfad4eb | ||
|
|
05d21eda44 | ||
|
|
45eb0a66d5 | ||
|
|
78f2db88fc | ||
|
|
604a6c3f8e | ||
|
|
fe9baed306 | ||
|
|
f9ae0b9ced | ||
|
|
5794d966f2 | ||
|
|
64580b3179 | ||
|
|
e05bd5a671 | ||
|
|
d37dce28f6 | ||
|
|
421a1b344f | ||
|
|
42fb057842 | ||
|
|
54f4ea7a62 | ||
|
|
6456115682 | ||
|
|
8e4a1d6e60 | ||
|
|
4dc41e1d1e | ||
|
|
4827181940 | ||
|
|
291cc75959 | ||
|
|
2014c859f1 | ||
|
|
4beb39593b | ||
|
|
be8f7b01a2 | ||
|
|
1b508953b4 | ||
|
|
cb9be70046 | ||
|
|
85f0d840c9 | ||
|
|
ffb06d7053 | ||
|
|
b61b299591 | ||
|
|
68a248623f | ||
|
|
ba93815e25 | ||
|
|
60e5868d6e | ||
|
|
9012214c80 | ||
|
|
4306b97e96 | ||
|
|
d5dcff5766 | ||
|
|
0a11e3fdd9 | ||
|
|
ed9506bbaf | ||
|
|
10695e6a20 | ||
|
|
5f644f971e | ||
|
|
40a75182e7 | ||
|
|
48ae29987c | ||
|
|
16d8967389 | ||
|
|
6d37d7534f | ||
|
|
bb36dc476d | ||
|
|
a34ca99b46 | ||
|
|
48fa82899a | ||
|
|
597c204127 | ||
|
|
3d62f02555 | ||
|
|
8a4abfd10a | ||
|
|
5f1362dd53 | ||
|
|
e0fd640b0c | ||
|
|
d731c012c4 | ||
|
|
6dfc772b5f | ||
|
|
60e58b4a21 | ||
|
|
9b1206e898 | ||
|
|
40cfcb0a3f | ||
|
|
e199504667 | ||
|
|
e6e3bf4923 | ||
|
|
5b9b480165 | ||
|
|
b625b628b7 | ||
|
|
e530813ab8 | ||
|
|
5fe1a9b8af | ||
|
|
ba674fb1af | ||
|
|
e0b20eea50 | ||
|
|
218d40db4c | ||
|
|
28c93a0113 | ||
|
|
4b40a3a20e | ||
|
|
a5b44c1a39 | ||
|
|
b660a383cf | ||
|
|
115587a52c | ||
|
|
ac7e4d772e | ||
|
|
32be38eeff | ||
|
|
eca06a5561 | ||
|
|
13cdac30cc | ||
|
|
12998b7ba3 | ||
|
|
5ed1e985c2 | ||
|
|
4bd9723e2b | ||
|
|
2f6d17472d | ||
|
|
2649b6603a | ||
|
|
b8107301d2 | ||
|
|
ebf1b8f8fc | ||
|
|
932b6a98b8 | ||
|
|
259993b92a | ||
|
|
0be20e5ce1 | ||
|
|
33206d299e | ||
|
|
c2e39e078f | ||
|
|
c9b1be5115 | ||
|
|
28f827aefa | ||
|
|
9578699f19 | ||
|
|
31c7ce1ce4 | ||
|
|
a89ad76881 | ||
|
|
1eeb9df353 | ||
|
|
648838c4a0 | ||
|
|
2073a69919 | ||
|
|
10f2d3c15a | ||
|
|
00c2a84eba | ||
|
|
515828d974 | ||
|
|
caa49ae471 | ||
|
|
e8c12e1f7d | ||
|
|
2f7b9a1280 | ||
|
|
23d151db1c | ||
|
|
c3be36f5cb | ||
|
|
bd2f52fcef | ||
|
|
a76fe4f9bd | ||
|
|
a6dff04fe1 | ||
|
|
cdb90196f2 | ||
|
|
70fdddff11 | ||
|
|
6ba0a36550 | ||
|
|
4a918790cd | ||
|
|
42d6d35dd1 | ||
|
|
e009918fbc | ||
|
|
70a288daae | ||
|
|
bdc7c5d203 | ||
|
|
272d916f23 | ||
|
|
f12f76f047 | ||
|
|
28a9b2d6d7 | ||
|
|
9f8ddbdfd7 | ||
|
|
9203e314a3 | ||
|
|
80b12d6f73 | ||
|
|
620a267204 | ||
|
|
bac4fe1a38 | ||
|
|
166d98c19e | ||
|
|
a9337bc304 | ||
|
|
4023575d64 | ||
|
|
cf1437a514 | ||
|
|
f9c9a2567c | ||
|
|
b9c859bfa1 | ||
|
|
b4187d626b | ||
|
|
bfbb7ab03c | ||
|
|
4e5a06f009 | ||
|
|
e8f7169839 | ||
|
|
6ce923c375 | ||
|
|
b2b478264a | ||
|
|
5eba74a3c9 | ||
|
|
ff3337ee1b | ||
|
|
484236cda4 | ||
|
|
f837e8e761 | ||
|
|
ef21864950 | ||
|
|
4789c1331c | ||
|
|
59ebabde5d | ||
|
|
3224214d91 | ||
|
|
e09fbf5b4a | ||
|
|
e9ff99b027 | ||
|
|
8b9e982393 | ||
|
|
8d1e008ecb | ||
|
|
579411fb6c | ||
|
|
e4818d46c4 | ||
|
|
4778dfbd93 | ||
|
|
0a3f985290 | ||
|
|
04f1897968 | ||
|
|
6ac6037211 | ||
|
|
959cbb7472 | ||
|
|
10ca836463 | ||
|
|
d58039a1e3 | ||
|
|
37a4496237 | ||
|
|
b7028afcb4 | ||
|
|
f629dada4c | ||
|
|
ccee4c68ff | ||
|
|
899bf9c076 | ||
|
|
dd7c3ef80e | ||
|
|
b7b875efff | ||
|
|
53ab991fbe | ||
|
|
54d25f56dd | ||
|
|
d827cf3d65 | ||
|
|
9438015b82 | ||
|
|
5aced81848 | ||
|
|
118e294bb9 | ||
|
|
dc9c1c1a51 | ||
|
|
a409f43c7a | ||
|
|
e67ad6aaed | ||
|
|
896079047b | ||
|
|
e58b8d6a61 | ||
|
|
01330498de | ||
|
|
a669cc5936 | ||
|
|
6fec2ab57a | ||
|
|
aab7a26877 | ||
|
|
2b971a70bb | ||
|
|
4e81e2933a | ||
|
|
bf944d782b | ||
|
|
566a5e6727 | ||
|
|
10c89976dc | ||
|
|
8121f62c54 | ||
|
|
104319fe98 | ||
|
|
aba18b82f7 | ||
|
|
4a5ad5af18 | ||
|
|
19f867a052 | ||
|
|
5e452f0d9d | ||
|
|
8bebf77dbd | ||
|
|
fb74504ab5 | ||
|
|
c51babb6c6 | ||
|
|
79166d0788 | ||
|
|
44ef9d902a | ||
|
|
384a214d60 | ||
|
|
697ed97fa5 | ||
|
|
2207a72006 | ||
|
|
4623c8edb6 | ||
|
|
9085295c40 | ||
|
|
3b0a2f607d | ||
|
|
5566638d56 | ||
|
|
27c1438455 | ||
|
|
1e8d3b8fca | ||
|
|
7fc528c3c6 | ||
|
|
2cbc140ac5 | ||
|
|
1653364141 | ||
|
|
61cc378b7f | ||
|
|
7aa5026a55 | ||
|
|
c80f00a5c9 | ||
|
|
62b14cbbad | ||
|
|
794a4b543a | ||
|
|
ee6ba9c213 | ||
|
|
81f99a8582 | ||
|
|
4b18b7bc24 | ||
|
|
4acf201e5b | ||
|
|
1e5919b22d | ||
|
|
375dacad24 | ||
|
|
e0ff272230 | ||
|
|
98b2ddc7f9 | ||
|
|
77cda4d75d | ||
|
|
3d90c4f911 | ||
|
|
6c5cad784c | ||
|
|
58b2ab08a8 | ||
|
|
e0dec83cfc | ||
|
|
00a3c456fb | ||
|
|
e628ee0ae1 | ||
|
|
7fc3c603aa | ||
|
|
24fd4c0f4e | ||
|
|
d0517be03a | ||
|
|
37b4358e44 | ||
|
|
122b180b66 | ||
|
|
8337c2be0f | ||
|
|
5296a763b1 | ||
|
|
3afc2b194c | ||
|
|
3cf2a1ba2e | ||
|
|
4d4e25083a | ||
|
|
9de6c31571 | ||
|
|
44ae944a29 | ||
|
|
e2338066a1 |
@@ -16,7 +16,10 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"],
|
"filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"],
|
||||||
"i18n-text/no-en": "off",
|
"i18n-text/no-en": "off",
|
||||||
"import/extensions": "error",
|
"import/extensions": ["error", {
|
||||||
|
// Allow importing JSON files
|
||||||
|
"json": {}
|
||||||
|
}],
|
||||||
"import/no-amd": "error",
|
"import/no-amd": "error",
|
||||||
"import/no-commonjs": "error",
|
"import/no-commonjs": "error",
|
||||||
"import/no-dynamic-require": "error",
|
"import/no-dynamic-require": "error",
|
||||||
@@ -30,6 +33,12 @@
|
|||||||
"alphabetize": {"order": "asc"},
|
"alphabetize": {"order": "asc"},
|
||||||
"newlines-between": "always"
|
"newlines-between": "always"
|
||||||
}],
|
}],
|
||||||
|
"max-len": ["error", {
|
||||||
|
"code": 120,
|
||||||
|
"ignoreUrls": true,
|
||||||
|
"ignoreStrings": true,
|
||||||
|
"ignoreTemplateLiterals": true
|
||||||
|
}],
|
||||||
"no-async-foreach/no-async-foreach": "error",
|
"no-async-foreach/no-async-foreach": "error",
|
||||||
"no-console": "off",
|
"no-console": "off",
|
||||||
"no-sequences": "error",
|
"no-sequences": "error",
|
||||||
@@ -55,5 +64,13 @@
|
|||||||
"func-style": "off",
|
"func-style": "off",
|
||||||
"sort-imports": "off"
|
"sort-imports": "off"
|
||||||
}
|
}
|
||||||
}]
|
}],
|
||||||
|
"settings": {
|
||||||
|
"import/resolver": {
|
||||||
|
"node": {
|
||||||
|
"moduleDirectory": ["node_modules", "src"]
|
||||||
|
},
|
||||||
|
"typescript": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
.github/codeql/codeql-config.yml
vendored
1
.github/codeql/codeql-config.yml
vendored
@@ -7,6 +7,7 @@ queries:
|
|||||||
# we include both even though one is a superset of the
|
# we include both even though one is a superset of the
|
||||||
# other, because we're testing the parsing logic and
|
# other, because we're testing the parsing logic and
|
||||||
# that the suites exist in the codeql bundle.
|
# that the suites exist in the codeql bundle.
|
||||||
|
- uses: security-experimental
|
||||||
- uses: security-extended
|
- uses: security-extended
|
||||||
- uses: security-and-quality
|
- uses: security-and-quality
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
|
|||||||
25
.github/dependabot.yml
vendored
25
.github/dependabot.yml
vendored
@@ -1,20 +1,21 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: npm
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: weekly
|
||||||
day: "thursday" # Gives us a working day to merge this before our typical release
|
|
||||||
labels:
|
labels:
|
||||||
- "Update dependencies"
|
- Update dependencies
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "*"
|
- dependency-name: "*"
|
||||||
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
|
update-types:
|
||||||
- package-ecosystem: "npm"
|
- version-update:semver-minor
|
||||||
directory: "/runner"
|
- version-update:semver-patch
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: weekly
|
||||||
day: "thursday" # Gives us a working day to merge this before our typical release
|
- package-ecosystem: github-actions
|
||||||
ignore:
|
directory: "/.github/setup-swift/" # All subdirectories outside of "/.github/workflows" must be explicitly included.
|
||||||
- dependency-name: "*"
|
schedule:
|
||||||
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
|
interval: weekly
|
||||||
|
|||||||
6
.github/prepare-test/action.yml
vendored
6
.github/prepare-test/action.yml
vendored
@@ -2,9 +2,11 @@ name: "Prepare test"
|
|||||||
description: Performs some preparation to run tests
|
description: Performs some preparation to run tests
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
|
description: "The version of the CodeQL CLI to use. Can be 'latest', 'cached', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
|
||||||
required: true
|
required: true
|
||||||
outputs:
|
outputs:
|
||||||
tools-url:
|
tools-url:
|
||||||
|
description: "The value that should be passed as the 'tools' input of the 'init' step."
|
||||||
value: ${{ steps.get-url.outputs.tools-url }}
|
value: ${{ steps.get-url.outputs.tools-url }}
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
@@ -20,6 +22,7 @@ runs:
|
|||||||
name: Determine URL
|
name: Determine URL
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -e # Fail this Action if `gh release list` fails.
|
||||||
if [[ ${{ inputs.version }} == "nightly-latest" ]]; then
|
if [[ ${{ inputs.version }} == "nightly-latest" ]]; then
|
||||||
export LATEST=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
|
export LATEST=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
|
||||||
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
|
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
|
||||||
@@ -34,5 +37,6 @@ runs:
|
|||||||
elif [[ ${{ inputs.version }} == "cached" ]]; then
|
elif [[ ${{ inputs.version }} == "cached" ]]; then
|
||||||
echo "tools-url=" >> $GITHUB_OUTPUT
|
echo "tools-url=" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "::error Unrecognized version specified!"
|
echo "::error::Unrecognized version specified!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
32
.github/setup-swift/action.yml
vendored
Normal file
32
.github/setup-swift/action.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: "Set up Swift"
|
||||||
|
description: Performs necessary steps to set up appropriate Swift version.
|
||||||
|
inputs:
|
||||||
|
codeql-path:
|
||||||
|
required: true
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Get Swift version
|
||||||
|
id: get_swift_version
|
||||||
|
# We don't support Swift on Windows or prior versions of CLI.
|
||||||
|
if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')"
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
CODEQL_PATH: ${{inputs.codeql-path}}
|
||||||
|
run: |
|
||||||
|
if [ $RUNNER_OS = "macOS" ]; then
|
||||||
|
PLATFORM="osx64"
|
||||||
|
else # We do not run this step on Windows.
|
||||||
|
PLATFORM="linux64"
|
||||||
|
fi
|
||||||
|
SWIFT_EXTRACTOR_DIR="$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]')"
|
||||||
|
VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor" --version | awk '/version/ { print $3 }')"
|
||||||
|
# Specify 5.7.0, otherwise setup Action will default to latest minor version.
|
||||||
|
if [ $VERSION = "5.7" ]; then
|
||||||
|
VERSION="5.7.0"
|
||||||
|
fi
|
||||||
|
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT
|
||||||
|
- uses: swift-actions/setup-swift@da0e3e04b5e3e15dbc3861bd835ad9f0afe56296 # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test.
|
||||||
|
if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')"
|
||||||
|
with:
|
||||||
|
swift-version: "${{steps.get_swift_version.outputs.version}}"
|
||||||
178
.github/update-release-branch.py
vendored
178
.github/update-release-branch.py
vendored
@@ -13,14 +13,8 @@ No user facing changes.
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Value of the mode flag for a v1 release
|
SOURCE_BRANCH = 'main'
|
||||||
V1_MODE = 'v1-release'
|
TARGET_BRANCH = 'releases/v2'
|
||||||
|
|
||||||
# Value of the mode flag for a v2 release
|
|
||||||
V2_MODE = 'v2-release'
|
|
||||||
|
|
||||||
SOURCE_BRANCH_FOR_MODE = { V1_MODE: 'releases/v2', V2_MODE: 'main' }
|
|
||||||
TARGET_BRANCH_FOR_MODE = { V1_MODE: 'releases/v1', V2_MODE: 'releases/v2' }
|
|
||||||
|
|
||||||
# Name of the remote
|
# Name of the remote
|
||||||
ORIGIN = 'origin'
|
ORIGIN = 'origin'
|
||||||
@@ -32,7 +26,7 @@ def run_git(*args, allow_non_zero_exit_code=False):
|
|||||||
cmd = ['git', *args]
|
cmd = ['git', *args]
|
||||||
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
if not allow_non_zero_exit_code and p.returncode != 0:
|
if not allow_non_zero_exit_code and p.returncode != 0:
|
||||||
raise Exception('Call to ' + ' '.join(cmd) + ' exited with code ' + str(p.returncode) + ' stderr:' + p.stderr.decode('ascii'))
|
raise Exception(f'Call to {" ".join(cmd)} exited with code {p.returncode} stderr: {p.stderr.decode("ascii")}.')
|
||||||
return p.stdout.decode('ascii')
|
return p.stdout.decode('ascii')
|
||||||
|
|
||||||
# Returns true if the given branch exists on the origin remote
|
# Returns true if the given branch exists on the origin remote
|
||||||
@@ -40,23 +34,21 @@ def branch_exists_on_remote(branch_name):
|
|||||||
return run_git('ls-remote', '--heads', ORIGIN, branch_name).strip() != ''
|
return run_git('ls-remote', '--heads', ORIGIN, branch_name).strip() != ''
|
||||||
|
|
||||||
# Opens a PR from the given branch to the target branch
|
# Opens a PR from the given branch to the target branch
|
||||||
def open_pr(
|
def open_pr(repo, all_commits, source_branch_short_sha, new_branch_name, conductor):
|
||||||
repo, all_commits, source_branch_short_sha, new_branch_name, source_branch, target_branch,
|
|
||||||
conductor, is_v2_release, labels, conflicted_files):
|
|
||||||
# Sort the commits into the pull requests that introduced them,
|
# Sort the commits into the pull requests that introduced them,
|
||||||
# and any commits that don't have a pull request
|
# and any commits that don't have a pull request
|
||||||
pull_requests = []
|
pull_requests = []
|
||||||
commits_without_pull_requests = []
|
commits_without_pull_requests = []
|
||||||
for commit in all_commits:
|
for commit in all_commits:
|
||||||
pr = get_pr_for_commit(repo, commit)
|
pr = get_pr_for_commit(commit)
|
||||||
|
|
||||||
if pr is None:
|
if pr is None:
|
||||||
commits_without_pull_requests.append(commit)
|
commits_without_pull_requests.append(commit)
|
||||||
elif not any(p for p in pull_requests if p.number == pr.number):
|
elif not any(p for p in pull_requests if p.number == pr.number):
|
||||||
pull_requests.append(pr)
|
pull_requests.append(pr)
|
||||||
|
|
||||||
print('Found ' + str(len(pull_requests)) + ' pull requests')
|
print(f'Found {len(pull_requests)} pull requests.')
|
||||||
print('Found ' + str(len(commits_without_pull_requests)) + ' commits not in a pull request')
|
print(f'Found {len(commits_without_pull_requests)} commits not in a pull request.')
|
||||||
|
|
||||||
# Sort PRs and commits by age
|
# Sort PRs and commits by age
|
||||||
pull_requests = sorted(pull_requests, key=lambda pr: pr.number)
|
pull_requests = sorted(pull_requests, key=lambda pr: pr.number)
|
||||||
@@ -64,7 +56,7 @@ def open_pr(
|
|||||||
|
|
||||||
# Start constructing the body text
|
# Start constructing the body text
|
||||||
body = []
|
body = []
|
||||||
body.append('Merging ' + source_branch_short_sha + ' into ' + target_branch)
|
body.append(f'Merging {source_branch_short_sha} into {TARGET_BRANCH}.')
|
||||||
|
|
||||||
body.append('')
|
body.append('')
|
||||||
body.append(f'Conductor for this PR is @{conductor}.')
|
body.append(f'Conductor for this PR is @{conductor}.')
|
||||||
@@ -87,50 +79,33 @@ def open_pr(
|
|||||||
|
|
||||||
body.append('')
|
body.append('')
|
||||||
body.append('Please do the following:')
|
body.append('Please do the following:')
|
||||||
if len(conflicted_files) > 0:
|
|
||||||
body.append(' - [ ] Ensure `package.json` file contains the correct version.')
|
|
||||||
body.append(' - [ ] Add commits to this branch to resolve the merge conflicts ' +
|
|
||||||
'in the following files:')
|
|
||||||
body.extend([f' - [ ] `{file}`' for file in conflicted_files])
|
|
||||||
body.append(' - [ ] Ensure another maintainer has reviewed the additional commits you added to this ' +
|
|
||||||
'branch to resolve the merge conflicts.')
|
|
||||||
body.append(' - [ ] Ensure the CHANGELOG displays the correct version and date.')
|
body.append(' - [ ] Ensure the CHANGELOG displays the correct version and date.')
|
||||||
body.append(' - [ ] Ensure the CHANGELOG includes all relevant, user-facing changes since the last release.')
|
body.append(' - [ ] Ensure the CHANGELOG includes all relevant, user-facing changes since the last release.')
|
||||||
body.append(' - [ ] Check that there are not any unexpected commits being merged into the ' + target_branch + ' branch.')
|
body.append(f' - [ ] Check that there are not any unexpected commits being merged into the {TARGET_BRANCH} branch.')
|
||||||
body.append(' - [ ] Ensure the docs team is aware of any documentation changes that need to be released.')
|
body.append(' - [ ] Ensure the docs team is aware of any documentation changes that need to be released.')
|
||||||
|
|
||||||
if not is_v2_release:
|
|
||||||
body.append(' - [ ] Remove and re-add the "Update dependencies" label to the PR to trigger just this workflow.')
|
|
||||||
body.append(' - [ ] Wait for the "Update dependencies" workflow to push a commit updating the dependencies.')
|
|
||||||
body.append(' - [ ] Mark the PR as ready for review to trigger the full set of PR checks.')
|
|
||||||
|
|
||||||
body.append(' - [ ] Approve and merge this PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`.')
|
body.append(' - [ ] Approve and merge this PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`.')
|
||||||
|
body.append(' - [ ] Merge the mergeback PR that will automatically be created once this PR is merged.')
|
||||||
|
|
||||||
if is_v2_release:
|
title = f'Merge {SOURCE_BRANCH} into {TARGET_BRANCH}'
|
||||||
body.append(' - [ ] Merge the mergeback PR that will automatically be created once this PR is merged.')
|
|
||||||
body.append(' - [ ] Merge the v1 release PR that will automatically be created once this PR is merged.')
|
|
||||||
|
|
||||||
title = 'Merge ' + source_branch + ' into ' + target_branch
|
|
||||||
|
|
||||||
# Create the pull request
|
# Create the pull request
|
||||||
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft so that
|
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft so that
|
||||||
# a maintainer can take the PR out of draft, thereby triggering the PR checks.
|
# a maintainer can take the PR out of draft, thereby triggering the PR checks.
|
||||||
pr = repo.create_pull(title=title, body='\n'.join(body), head=new_branch_name, base=target_branch, draft=True)
|
pr = repo.create_pull(title=title, body='\n'.join(body), head=new_branch_name, base=TARGET_BRANCH, draft=True)
|
||||||
pr.add_to_labels(*labels)
|
print(f'Created PR #{pr.number}')
|
||||||
print('Created PR #' + str(pr.number))
|
|
||||||
|
|
||||||
# Assign the conductor
|
# Assign the conductor
|
||||||
pr.add_to_assignees(conductor)
|
pr.add_to_assignees(conductor)
|
||||||
print('Assigned PR to ' + conductor)
|
print(f'Assigned PR to {conductor}')
|
||||||
|
|
||||||
# Gets a list of the SHAs of all commits that have happened on the source branch
|
# Gets a list of the SHAs of all commits that have happened on the source branch
|
||||||
# since the last release to the target branch.
|
# since the last release to the target branch.
|
||||||
# This will not include any commits that exist on the target branch
|
# This will not include any commits that exist on the target branch
|
||||||
# that aren't on the source branch.
|
# that aren't on the source branch.
|
||||||
def get_commit_difference(repo, source_branch, target_branch):
|
def get_commit_difference(repo):
|
||||||
# Passing split nothing means that the empty string splits to nothing: compare `''.split() == []`
|
# Passing split nothing means that the empty string splits to nothing: compare `''.split() == []`
|
||||||
# to `''.split('\n') == ['']`.
|
# to `''.split('\n') == ['']`.
|
||||||
commits = run_git('log', '--pretty=format:%H', ORIGIN + '/' + target_branch + '..' + ORIGIN + '/' + source_branch).strip().split()
|
commits = run_git('log', '--pretty=format:%H', f'{ORIGIN}/{TARGET_BRANCH}..{ORIGIN}/{SOURCE_BRANCH}').strip().split()
|
||||||
|
|
||||||
# Convert to full-fledged commit objects
|
# Convert to full-fledged commit objects
|
||||||
commits = [repo.get_commit(c) for c in commits]
|
commits = [repo.get_commit(c) for c in commits]
|
||||||
@@ -146,13 +121,13 @@ def is_pr_merge_commit(commit):
|
|||||||
def get_truncated_commit_message(commit):
|
def get_truncated_commit_message(commit):
|
||||||
message = commit.commit.message.split('\n')[0]
|
message = commit.commit.message.split('\n')[0]
|
||||||
if len(message) > 60:
|
if len(message) > 60:
|
||||||
return message[:57] + '...'
|
return f'{message[:57]}...'
|
||||||
else:
|
else:
|
||||||
return message
|
return message
|
||||||
|
|
||||||
# Converts a commit into the PR that introduced it to the source branch.
|
# Converts a commit into the PR that introduced it to the source branch.
|
||||||
# Returns the PR object, or None if no PR could be found.
|
# Returns the PR object, or None if no PR could be found.
|
||||||
def get_pr_for_commit(repo, commit):
|
def get_pr_for_commit(commit):
|
||||||
prs = commit.get_pulls()
|
prs = commit.get_pulls()
|
||||||
|
|
||||||
if prs.totalCount > 0:
|
if prs.totalCount > 0:
|
||||||
@@ -186,7 +161,7 @@ def update_changelog(version):
|
|||||||
else:
|
else:
|
||||||
content = EMPTY_CHANGELOG
|
content = EMPTY_CHANGELOG
|
||||||
|
|
||||||
newContent = content.replace('[UNRELEASED]', version + ' - ' + get_today_string(), 1)
|
newContent = content.replace('[UNRELEASED]', f'{version} - {get_today_string()}', 1)
|
||||||
|
|
||||||
with open('CHANGELOG.md', 'w') as f:
|
with open('CHANGELOG.md', 'w') as f:
|
||||||
f.write(newContent)
|
f.write(newContent)
|
||||||
@@ -207,16 +182,6 @@ def main():
|
|||||||
required=True,
|
required=True,
|
||||||
help='The nwo of the repository, for example github/codeql-action.'
|
help='The nwo of the repository, for example github/codeql-action.'
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
|
||||||
'--mode',
|
|
||||||
type=str,
|
|
||||||
required=True,
|
|
||||||
choices=[V2_MODE, V1_MODE],
|
|
||||||
help=f"Which release to perform. '{V2_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V2_MODE]} as the source " +
|
|
||||||
f"branch and {TARGET_BRANCH_FOR_MODE[V2_MODE]} as the target branch. " +
|
|
||||||
f"'{V1_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V1_MODE]} as the source branch and " +
|
|
||||||
f"{TARGET_BRANCH_FOR_MODE[V1_MODE]} as the target branch."
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--conductor',
|
'--conductor',
|
||||||
type=str,
|
type=str,
|
||||||
@@ -226,110 +191,46 @@ def main():
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
source_branch = SOURCE_BRANCH_FOR_MODE[args.mode]
|
|
||||||
target_branch = TARGET_BRANCH_FOR_MODE[args.mode]
|
|
||||||
|
|
||||||
repo = Github(args.github_token).get_repo(args.repository_nwo)
|
repo = Github(args.github_token).get_repo(args.repository_nwo)
|
||||||
version = get_current_version()
|
version = get_current_version()
|
||||||
|
|
||||||
if args.mode == V1_MODE:
|
|
||||||
# Change the version number to a v1 equivalent
|
|
||||||
version = get_current_version()
|
|
||||||
version = f'1{version[1:]}'
|
|
||||||
|
|
||||||
# Print what we intend to go
|
# Print what we intend to go
|
||||||
print('Considering difference between ' + source_branch + ' and ' + target_branch)
|
print(f'Considering difference between {SOURCE_BRANCH} and {TARGET_BRANCH}...')
|
||||||
source_branch_short_sha = run_git('rev-parse', '--short', ORIGIN + '/' + source_branch).strip()
|
source_branch_short_sha = run_git('rev-parse', '--short', f'{ORIGIN}/{SOURCE_BRANCH}').strip()
|
||||||
print('Current head of ' + source_branch + ' is ' + source_branch_short_sha)
|
print(f'Current head of {SOURCE_BRANCH} is {source_branch_short_sha}.')
|
||||||
|
|
||||||
# See if there are any commits to merge in
|
# See if there are any commits to merge in
|
||||||
commits = get_commit_difference(repo=repo, source_branch=source_branch, target_branch=target_branch)
|
commits = get_commit_difference(repo=repo)
|
||||||
if len(commits) == 0:
|
if len(commits) == 0:
|
||||||
print('No commits to merge from ' + source_branch + ' to ' + target_branch)
|
print(f'No commits to merge from {SOURCE_BRANCH} to {TARGET_BRANCH}.')
|
||||||
return
|
return
|
||||||
|
|
||||||
# The branch name is based off of the name of branch being merged into
|
# The branch name is based off of the name of branch being merged into
|
||||||
# and the SHA of the branch being merged from. Thus if the branch already
|
# and the SHA of the branch being merged from. Thus if the branch already
|
||||||
# exists we can assume we don't need to recreate it.
|
# exists we can assume we don't need to recreate it.
|
||||||
new_branch_name = 'update-v' + version + '-' + source_branch_short_sha
|
new_branch_name = f'update-v{version}-{source_branch_short_sha}'
|
||||||
print('Branch name is ' + new_branch_name)
|
print(f'Branch name is {new_branch_name}.')
|
||||||
|
|
||||||
# Check if the branch already exists. If so we can abort as this script
|
# Check if the branch already exists. If so we can abort as this script
|
||||||
# has already run on this combination of branches.
|
# has already run on this combination of branches.
|
||||||
if branch_exists_on_remote(new_branch_name):
|
if branch_exists_on_remote(new_branch_name):
|
||||||
print('Branch ' + new_branch_name + ' already exists. Nothing to do.')
|
print(f'Branch {new_branch_name} already exists. Nothing to do.')
|
||||||
return
|
return
|
||||||
|
|
||||||
# Create the new branch and push it to the remote
|
# Create the new branch and push it to the remote
|
||||||
print('Creating branch ' + new_branch_name)
|
print(f'Creating branch {new_branch_name}.')
|
||||||
|
|
||||||
# The process of creating the v1 release can run into merge conflicts. We commit the unresolved
|
# If we're performing a standard release, there won't be any new commits on the target branch,
|
||||||
# conflicts so a maintainer can easily resolve them (vs erroring and requiring maintainers to
|
# as these will have already been merged back into the source branch. Therefore we can just
|
||||||
# reconstruct the release manually)
|
# start from the source branch.
|
||||||
conflicted_files = []
|
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/{SOURCE_BRANCH}')
|
||||||
|
|
||||||
if args.mode == V1_MODE:
|
print('Updating changelog')
|
||||||
# If we're performing a backport, start from the target branch
|
update_changelog(version)
|
||||||
print(f'Creating {new_branch_name} from the {ORIGIN}/{target_branch} branch')
|
|
||||||
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/{target_branch}')
|
|
||||||
|
|
||||||
# Revert the commit that we made as part of the last release that updated the version number and
|
# Create a commit that updates the CHANGELOG
|
||||||
# changelog to refer to 1.x.x variants. This avoids merge conflicts in the changelog and
|
run_git('add', 'CHANGELOG.md')
|
||||||
# package.json files when we merge in the v2 branch.
|
run_git('commit', '-m', f'Update changelog for v{version}')
|
||||||
# This commit will not exist the first time we release the v1 branch from the v2 branch, so we
|
|
||||||
# use `git log --grep` to conditionally revert the commit.
|
|
||||||
print('Reverting the 1.x.x version number and changelog updates from the last release to avoid conflicts')
|
|
||||||
v1_update_commits = run_git('log', '--grep', '^Update version and changelog for v', '--format=%H').split()
|
|
||||||
|
|
||||||
if len(v1_update_commits) > 0:
|
|
||||||
print(f' Reverting {v1_update_commits[0]}')
|
|
||||||
# Only revert the newest commit as older ones will already have been reverted in previous
|
|
||||||
# releases.
|
|
||||||
run_git('revert', v1_update_commits[0], '--no-edit')
|
|
||||||
|
|
||||||
# Also revert the "Update checked-in dependencies" commit created by Actions.
|
|
||||||
update_dependencies_commit = run_git('log', '--grep', '^Update checked-in dependencies', '--format=%H').split()[0]
|
|
||||||
print(f' Reverting {update_dependencies_commit}')
|
|
||||||
run_git('revert', update_dependencies_commit, '--no-edit')
|
|
||||||
|
|
||||||
else:
|
|
||||||
print(' Nothing to revert.')
|
|
||||||
|
|
||||||
print(f'Merging {ORIGIN}/{source_branch} into the release prep branch')
|
|
||||||
# Commit any conflicts (see the comment for `conflicted_files`)
|
|
||||||
run_git('merge', f'{ORIGIN}/{source_branch}', allow_non_zero_exit_code=True)
|
|
||||||
conflicted_files = run_git('diff', '--name-only', '--diff-filter', 'U').splitlines()
|
|
||||||
if len(conflicted_files) > 0:
|
|
||||||
run_git('add', '.')
|
|
||||||
run_git('commit', '--no-edit')
|
|
||||||
|
|
||||||
# Migrate the package version number from a v2 version number to a v1 version number
|
|
||||||
print(f'Setting version number to {version}')
|
|
||||||
subprocess.check_output(['npm', 'version', version, '--no-git-tag-version'])
|
|
||||||
run_git('add', 'package.json', 'package-lock.json')
|
|
||||||
|
|
||||||
# Migrate the changelog notes from v2 version numbers to v1 version numbers
|
|
||||||
print('Migrating changelog notes from v2 to v1')
|
|
||||||
subprocess.check_output(['sed', '-i', 's/^## 2\./## 1./g', 'CHANGELOG.md'])
|
|
||||||
|
|
||||||
# Remove changelog notes from v2 that don't apply to v1
|
|
||||||
subprocess.check_output(['sed', '-i', '/^- \[v2+ only\]/d', 'CHANGELOG.md'])
|
|
||||||
|
|
||||||
# Amend the commit generated by `npm version` to update the CHANGELOG
|
|
||||||
run_git('add', 'CHANGELOG.md')
|
|
||||||
run_git('commit', '-m', f'Update version and changelog for v{version}')
|
|
||||||
else:
|
|
||||||
# If we're performing a standard release, there won't be any new commits on the target branch,
|
|
||||||
# as these will have already been merged back into the source branch. Therefore we can just
|
|
||||||
# start from the source branch.
|
|
||||||
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/{source_branch}')
|
|
||||||
|
|
||||||
print('Updating changelog')
|
|
||||||
update_changelog(version)
|
|
||||||
|
|
||||||
# Create a commit that updates the CHANGELOG
|
|
||||||
run_git('add', 'CHANGELOG.md')
|
|
||||||
run_git('commit', '-m', f'Update changelog for v{version}')
|
|
||||||
|
|
||||||
run_git('push', ORIGIN, new_branch_name)
|
run_git('push', ORIGIN, new_branch_name)
|
||||||
|
|
||||||
@@ -339,12 +240,7 @@ def main():
|
|||||||
commits,
|
commits,
|
||||||
source_branch_short_sha,
|
source_branch_short_sha,
|
||||||
new_branch_name,
|
new_branch_name,
|
||||||
source_branch=source_branch,
|
|
||||||
target_branch=target_branch,
|
|
||||||
conductor=args.conductor,
|
conductor=args.conductor,
|
||||||
is_v2_release=args.mode == V2_MODE,
|
|
||||||
labels=['Update dependencies'] if args.mode == V1_MODE else [],
|
|
||||||
conflicted_files=conflicted_files
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
3
.github/workflows/__analyze-ref-input.yml
generated
vendored
3
.github/workflows/__analyze-ref-input.yml
generated
vendored
@@ -7,11 +7,11 @@ name: "PR Check - Analyze: 'ref' and 'sha' from inputs"
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -88,6 +88,7 @@ jobs:
|
|||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
with:
|
with:
|
||||||
|
upload-database: false
|
||||||
ref: refs/heads/main
|
ref: refs/heads/main
|
||||||
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
||||||
env:
|
env:
|
||||||
|
|||||||
4
.github/workflows/__autobuild-action.yml
generated
vendored
4
.github/workflows/__autobuild-action.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - autobuild-action
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -56,6 +56,8 @@ jobs:
|
|||||||
CORECLR_PROFILER: ''
|
CORECLR_PROFILER: ''
|
||||||
CORECLR_PROFILER_PATH_64: ''
|
CORECLR_PROFILER_PATH_64: ''
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
- name: Check database
|
- name: Check database
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
90
.github/workflows/__config-export.yml
generated
vendored
Normal file
90
.github/workflows/__config-export.yml
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
|
# to regenerate this file.
|
||||||
|
|
||||||
|
name: PR Check - Config export
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- releases/v2
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
config-export:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: latest
|
||||||
|
- os: macos-latest
|
||||||
|
version: latest
|
||||||
|
- os: windows-latest
|
||||||
|
version: latest
|
||||||
|
name: Config export
|
||||||
|
timeout-minutes: 45
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Prepare test
|
||||||
|
id: prepare-test
|
||||||
|
uses: ./.github/prepare-test
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
- uses: ./../action/init
|
||||||
|
with:
|
||||||
|
languages: javascript
|
||||||
|
queries: security-extended
|
||||||
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
- uses: ./../action/analyze
|
||||||
|
with:
|
||||||
|
output: ${{ runner.temp }}/results
|
||||||
|
upload-database: false
|
||||||
|
- name: Upload SARIF
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
||||||
|
path: ${{ runner.temp }}/results/javascript.sarif
|
||||||
|
retention-days: 7
|
||||||
|
- name: Check config properties appear in SARIF
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
env:
|
||||||
|
SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
|
||||||
|
const run = sarif.runs[0];
|
||||||
|
const configSummary = run.properties.codeqlConfigSummary;
|
||||||
|
|
||||||
|
if (configSummary === undefined) {
|
||||||
|
core.setFailed('`codeqlConfigSummary` property not found in the SARIF run property bag.');
|
||||||
|
}
|
||||||
|
if (configSummary.disableDefaultQueries !== false) {
|
||||||
|
core.setFailed('`disableDefaultQueries` property incorrect: expected false, got ' +
|
||||||
|
`${JSON.stringify(configSummary.disableDefaultQueries)}.`);
|
||||||
|
}
|
||||||
|
const expectedQueries = [{ type: 'builtinSuite', uses: 'security-extended' }];
|
||||||
|
// Use JSON.stringify to deep-equal the arrays.
|
||||||
|
if (JSON.stringify(configSummary.queries) !== JSON.stringify(expectedQueries)) {
|
||||||
|
core.setFailed(`\`queries\` property incorrect: expected ${JSON.stringify(expectedQueries)}, got ` +
|
||||||
|
`${JSON.stringify(configSummary.queries)}.`);
|
||||||
|
}
|
||||||
|
core.info('Finished config export tests.');
|
||||||
|
env:
|
||||||
|
CODEQL_ACTION_EXPORT_CODE_SCANNING_CONFIG: true
|
||||||
|
CODEQL_PASS_CONFIG_TO_CLI: true
|
||||||
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
14
.github/workflows/__export-file-baseline-information.yml
generated
vendored
14
.github/workflows/__export-file-baseline-information.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Export file baseline information
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -42,18 +42,16 @@ jobs:
|
|||||||
uses: ./.github/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
- uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9
|
|
||||||
# Windows doesn't support Swift, and only macOS latest and nightly-latest support Swift 5.7.1.
|
|
||||||
if: runner.os == 'Linux' || (runner.os == 'macOS' && matrix.version == 'cached')
|
|
||||||
with:
|
|
||||||
swift-version: '5.7'
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: javascript
|
languages: javascript
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
env:
|
env:
|
||||||
CODEQL_FILE_BASELINE_INFORMATION: true
|
CODEQL_FILE_BASELINE_INFORMATION: true
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
@@ -62,7 +60,6 @@ jobs:
|
|||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
env:
|
env:
|
||||||
CODEQL_FILE_BASELINE_INFORMATION: true
|
CODEQL_FILE_BASELINE_INFORMATION: true
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true
|
|
||||||
- name: Upload SARIF
|
- name: Upload SARIF
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -87,4 +84,5 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
env:
|
env:
|
||||||
|
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true # Remove when Swift is GA.
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
|
|||||||
2
.github/workflows/__extractor-ram-threads.yml
generated
vendored
2
.github/workflows/__extractor-ram-threads.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Extractor ram and threads options test
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
|
|||||||
4
.github/workflows/__go-custom-queries.yml
generated
vendored
4
.github/workflows/__go-custom-queries.yml
generated
vendored
@@ -7,11 +7,11 @@ name: 'PR Check - Go: Custom queries'
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -86,6 +86,8 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
env:
|
env:
|
||||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
|
|||||||
4
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
4
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
@@ -7,11 +7,11 @@ name: 'PR Check - Go: tracing with autobuilder step'
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -71,6 +71,8 @@ jobs:
|
|||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
- uses: ./../action/autobuild
|
- uses: ./../action/autobuild
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then
|
if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then
|
||||||
|
|||||||
4
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
4
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
@@ -7,11 +7,11 @@ name: 'PR Check - Go: tracing with custom build steps'
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -73,6 +73,8 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: go build main.go
|
run: go build main.go
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
# Once we start running Bash 4.2 in all environments, we can replace the
|
# Once we start running Bash 4.2 in all environments, we can replace the
|
||||||
|
|||||||
4
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
4
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
@@ -7,11 +7,11 @@ name: 'PR Check - Go: tracing with legacy workflow'
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -70,6 +70,8 @@ jobs:
|
|||||||
languages: go
|
languages: go
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd "$RUNNER_TEMP/codeql_databases"
|
cd "$RUNNER_TEMP/codeql_databases"
|
||||||
|
|||||||
44
.github/workflows/__init-with-registries.yml
generated
vendored
44
.github/workflows/__init-with-registries.yml
generated
vendored
@@ -7,11 +7,11 @@ name: 'PR Check - Packaging: Download using registries'
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -25,6 +25,18 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: cached
|
||||||
|
- os: macos-latest
|
||||||
|
version: cached
|
||||||
|
- os: windows-latest
|
||||||
|
version: cached
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: latest
|
||||||
|
- os: macos-latest
|
||||||
|
version: latest
|
||||||
|
- os: windows-latest
|
||||||
|
version: latest
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: nightly-latest
|
version: nightly-latest
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
@@ -75,5 +87,35 @@ jobs:
|
|||||||
echo "::error $CODEQL_PACK1 pack was not installed."
|
echo "::error $CODEQL_PACK1 pack was not installed."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Verify qlconfig.yml file was created
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml
|
||||||
|
echo "Expected qlconfig.yml file to be created at $QLCONFIG_PATH"
|
||||||
|
if [[ -f $QLCONFIG_PATH ]]
|
||||||
|
then
|
||||||
|
echo "qlconfig.yml file was created."
|
||||||
|
else
|
||||||
|
echo "::error qlconfig.yml file was not created."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Verify contents of qlconfig.yml
|
||||||
|
# yq is not available on windows
|
||||||
|
if: runner.os != 'Windows'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml
|
||||||
|
cat $QLCONFIG_PATH | yq -e '.registries[] | select(.url == "https://ghcr.io/v2/") | select(.packages == "*/*")'
|
||||||
|
if [[ $? -eq 0 ]]
|
||||||
|
then
|
||||||
|
echo "Registry was added to qlconfig.yml file."
|
||||||
|
else
|
||||||
|
echo "::error Registry was not added to qlconfig.yml file."
|
||||||
|
echo "Contents of qlconfig.yml file:"
|
||||||
|
cat $QLCONFIG_PATH
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
|
|||||||
3
.github/workflows/__javascript-source-root.yml
generated
vendored
3
.github/workflows/__javascript-source-root.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Custom source root
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -54,6 +54,7 @@ jobs:
|
|||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
with:
|
with:
|
||||||
|
upload-database: false
|
||||||
skip-queries: true
|
skip-queries: true
|
||||||
upload: false
|
upload: false
|
||||||
- name: Assert database exists
|
- name: Assert database exists
|
||||||
|
|||||||
2
.github/workflows/__ml-powered-queries.yml
generated
vendored
2
.github/workflows/__ml-powered-queries.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - ML-powered queries
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
|
|||||||
19
.github/workflows/__multi-language-autodetect.yml
generated
vendored
19
.github/workflows/__multi-language-autodetect.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Multi-language repository
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -65,23 +65,24 @@ jobs:
|
|||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: ^1.13.1
|
go-version: ^1.13.1
|
||||||
- uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9
|
|
||||||
# Only macOS latest and nightly-latest support Swift 5.7.1
|
|
||||||
if: runner.os == 'Linux' || matrix.version == 'cached'
|
|
||||||
with:
|
|
||||||
swift-version: '5.7'
|
|
||||||
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
db-location: ${{ runner.temp }}/customDbLocation
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
|
||||||
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
|
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
|
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
id: analysis
|
id: analysis
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
|
|
||||||
- name: Check language autodetect for all languages excluding Ruby, Swift
|
- name: Check language autodetect for all languages excluding Ruby, Swift
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -129,8 +130,8 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check language autodetect for Swift
|
- name: Check language autodetect for Swift
|
||||||
if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'cached' || matrix.version\
|
if: (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version
|
||||||
\ == 'latest' || matrix.version == 'nightly-latest')"
|
== 'nightly-latest')
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
|
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
|
||||||
|
|||||||
3
.github/workflows/__packaging-codescanning-config-inputs-js.yml
generated
vendored
3
.github/workflows/__packaging-codescanning-config-inputs-js.yml
generated
vendored
@@ -7,11 +7,11 @@ name: 'PR Check - Packaging: Config and input passed to the CLI'
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -66,6 +66,7 @@ jobs:
|
|||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
with:
|
with:
|
||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
|
upload-database: false
|
||||||
|
|
||||||
- name: Check results
|
- name: Check results
|
||||||
uses: ./../action/.github/check-sarif
|
uses: ./../action/.github/check-sarif
|
||||||
|
|||||||
3
.github/workflows/__packaging-config-inputs-js.yml
generated
vendored
3
.github/workflows/__packaging-config-inputs-js.yml
generated
vendored
@@ -7,11 +7,11 @@ name: 'PR Check - Packaging: Config and input'
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -66,6 +66,7 @@ jobs:
|
|||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
with:
|
with:
|
||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
|
upload-database: false
|
||||||
|
|
||||||
- name: Check results
|
- name: Check results
|
||||||
uses: ./../action/.github/check-sarif
|
uses: ./../action/.github/check-sarif
|
||||||
|
|||||||
3
.github/workflows/__packaging-config-js.yml
generated
vendored
3
.github/workflows/__packaging-config-js.yml
generated
vendored
@@ -7,11 +7,11 @@ name: 'PR Check - Packaging: Config file'
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -65,6 +65,7 @@ jobs:
|
|||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
with:
|
with:
|
||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
|
upload-database: false
|
||||||
|
|
||||||
- name: Check results
|
- name: Check results
|
||||||
uses: ./../action/.github/check-sarif
|
uses: ./../action/.github/check-sarif
|
||||||
|
|||||||
2
.github/workflows/__packaging-inputs-js.yml
generated
vendored
2
.github/workflows/__packaging-inputs-js.yml
generated
vendored
@@ -7,11 +7,11 @@ name: 'PR Check - Packaging: Action input'
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
|
|||||||
2
.github/workflows/__remote-config.yml
generated
vendored
2
.github/workflows/__remote-config.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Remote config file
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
|
|||||||
2
.github/workflows/__rubocop-multi-language.yml
generated
vendored
2
.github/workflows/__rubocop-multi-language.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - RuboCop multi-language
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
|
|||||||
4
.github/workflows/__ruby.yml
generated
vendored
4
.github/workflows/__ruby.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Ruby analysis
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -54,6 +54,8 @@ jobs:
|
|||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
id: analysis
|
id: analysis
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
- name: Check database
|
- name: Check database
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
3
.github/workflows/__split-workflow.yml
generated
vendored
3
.github/workflows/__split-workflow.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Split workflow
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -61,6 +61,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
skip-queries: true
|
skip-queries: true
|
||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
|
upload-database: false
|
||||||
|
|
||||||
- name: Assert No Results
|
- name: Assert No Results
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
72
.github/workflows/__submit-sarif-failure.yml
generated
vendored
Normal file
72
.github/workflows/__submit-sarif-failure.yml
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
|
# to regenerate this file.
|
||||||
|
|
||||||
|
name: PR Check - Submit SARIF after failure
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- releases/v2
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
submit-sarif-failure:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: latest
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: cached
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: nightly-latest
|
||||||
|
name: Submit SARIF after failure
|
||||||
|
timeout-minutes: 45
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Prepare test
|
||||||
|
id: prepare-test
|
||||||
|
uses: ./.github/prepare-test
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./init
|
||||||
|
with:
|
||||||
|
languages: javascript
|
||||||
|
- name: Fail
|
||||||
|
# We want this job to pass if the Action correctly uploads the SARIF file for
|
||||||
|
# the failed run.
|
||||||
|
# Setting this step to continue on error means that it is marked as completing
|
||||||
|
# successfully, so will not fail the job.
|
||||||
|
continue-on-error: true
|
||||||
|
run: exit 1
|
||||||
|
- uses: ./analyze
|
||||||
|
# In a real workflow, this step wouldn't run. Since we used `continue-on-error`
|
||||||
|
# above, we manually disable it with an `if` condition.
|
||||||
|
if: false
|
||||||
|
with:
|
||||||
|
category: /test-codeql-version:${{ matrix.version }}
|
||||||
|
env:
|
||||||
|
# Internal-only environment variable used to indicate that the post-init Action
|
||||||
|
# should expect to upload a SARIF file for the failed run.
|
||||||
|
CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF: true
|
||||||
|
# Make sure the uploading SARIF files feature is enabled.
|
||||||
|
CODEQL_ACTION_UPLOAD_FAILED_SARIF: true
|
||||||
|
# Upload the failed SARIF file as an integration test of the API endpoint.
|
||||||
|
CODEQL_ACTION_TEST_MODE: false
|
||||||
|
# Mark telemetry for this workflow so it can be treated separately.
|
||||||
|
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
|
||||||
|
|
||||||
19
.github/workflows/__swift-autobuild.yml
generated
vendored
19
.github/workflows/__swift-autobuild.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Swift analysis using autobuild
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -42,18 +42,23 @@ jobs:
|
|||||||
uses: ./.github/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
- uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9
|
|
||||||
# Only macOS latest and nightly-latest support Swift 5.7.1
|
|
||||||
if: runner.os == 'Linux' || matrix.version == 'cached'
|
|
||||||
with:
|
|
||||||
swift-version: '5.7'
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: swift
|
languages: swift
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
|
- name: Check working directory
|
||||||
|
shell: bash
|
||||||
|
run: pwd
|
||||||
- uses: ./../action/autobuild
|
- uses: ./../action/autobuild
|
||||||
|
timeout-minutes: 10
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
id: analysis
|
id: analysis
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
- name: Check database
|
- name: Check database
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -63,5 +68,5 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true'
|
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true' # Remove when Swift is GA.
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
|
|||||||
18
.github/workflows/__swift-custom-build.yml
generated
vendored
18
.github/workflows/__swift-custom-build.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Swift analysis using a custom build command
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -48,20 +48,24 @@ jobs:
|
|||||||
uses: ./.github/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
- uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9
|
|
||||||
# Only macOS latest and nightly-latest support Swift 5.7.1
|
|
||||||
if: runner.os == 'Linux' || matrix.version == 'cached'
|
|
||||||
with:
|
|
||||||
swift-version: '5.7'
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: swift
|
languages: swift
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
|
- name: Check working directory
|
||||||
|
shell: bash
|
||||||
|
run: pwd
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
id: analysis
|
id: analysis
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
- name: Check database
|
- name: Check database
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -71,6 +75,6 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true'
|
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true' # Remove when Swift is GA.
|
||||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
|
|||||||
4
.github/workflows/__test-autobuild-working-dir.yml
generated
vendored
4
.github/workflows/__test-autobuild-working-dir.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Autobuild working directory
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -53,6 +53,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
working-directory: autobuild-dir
|
working-directory: autobuild-dir
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
- name: Check database
|
- name: Check database
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
4
.github/workflows/__test-local-codeql.yml
generated
vendored
4
.github/workflows/__test-local-codeql.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Local CodeQL bundle
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -51,5 +51,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
|
|||||||
4
.github/workflows/__test-proxy.yml
generated
vendored
4
.github/workflows/__test-proxy.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Proxy test
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -43,6 +43,8 @@ jobs:
|
|||||||
languages: javascript
|
languages: javascript
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
env:
|
env:
|
||||||
https_proxy: http://squid-proxy:3128
|
https_proxy: http://squid-proxy:3128
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
|
|||||||
9
.github/workflows/__unset-environment.yml
generated
vendored
9
.github/workflows/__unset-environment.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Test unsetting environment variables
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -59,9 +59,14 @@ jobs:
|
|||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: env -i PATH="$PATH" HOME="$HOME" ./build.sh
|
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
|
||||||
|
# workaround for our PR checks.
|
||||||
|
run: env -i CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN=true PATH="$PATH" HOME="$HOME"
|
||||||
|
./build.sh
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
id: analysis
|
id: analysis
|
||||||
|
with:
|
||||||
|
upload-database: false
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}"
|
CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}"
|
||||||
|
|||||||
3
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
3
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
@@ -7,11 +7,11 @@ name: "PR Check - Upload-sarif: 'ref' and 'sha' from inputs"
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -88,6 +88,7 @@ jobs:
|
|||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
with:
|
with:
|
||||||
|
upload-database: false
|
||||||
ref: refs/heads/main
|
ref: refs/heads/main
|
||||||
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
||||||
upload: false
|
upload: false
|
||||||
|
|||||||
3
.github/workflows/__with-checkout-path.yml
generated
vendored
3
.github/workflows/__with-checkout-path.yml
generated
vendored
@@ -7,11 +7,11 @@ name: PR Check - Use a custom `checkout_path`
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -104,6 +104,7 @@ jobs:
|
|||||||
ref: v1.1.0
|
ref: v1.1.0
|
||||||
sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
|
sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
|
||||||
upload: false
|
upload: false
|
||||||
|
upload-database: false
|
||||||
|
|
||||||
- uses: ./../action/upload-sarif
|
- uses: ./../action/upload-sarif
|
||||||
with:
|
with:
|
||||||
|
|||||||
18
.github/workflows/codeql.yml
vendored
18
.github/workflows/codeql.yml
vendored
@@ -2,12 +2,15 @@ name: "CodeQL action"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main, releases/v1, releases/v2]
|
branches: [main, releases/v2]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main, releases/v1, releases/v2]
|
branches: [main, releases/v2]
|
||||||
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
||||||
# by other workflows.
|
# by other workflows.
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
|
schedule:
|
||||||
|
# Weekly on Sunday.
|
||||||
|
- cron: '30 1 * * 0'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
|
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
|
||||||
@@ -54,7 +57,7 @@ jobs:
|
|||||||
# be the same as `tools: null`. This allows us to make the job for each of the bundles a
|
# be the same as `tools: null`. This allows us to make the job for each of the bundles a
|
||||||
# required status check.
|
# required status check.
|
||||||
#
|
#
|
||||||
# If we're running on push, then we can skip running with `tools: latest` when it would be
|
# If we're running on push or schedule, then we can skip running with `tools: latest` when it would be
|
||||||
# the same as running with `tools: null`.
|
# the same as running with `tools: null`.
|
||||||
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
|
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
|
||||||
VERSIONS_JSON='[null]'
|
VERSIONS_JSON='[null]'
|
||||||
@@ -78,8 +81,10 @@ jobs:
|
|||||||
security-events: write
|
security-events: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
- uses: ./init
|
uses: actions/checkout@v3
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: ./init
|
||||||
id: init
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: javascript
|
languages: javascript
|
||||||
@@ -88,4 +93,5 @@ jobs:
|
|||||||
# confirm steps.init.outputs.codeql-path points to the codeql binary
|
# confirm steps.init.outputs.codeql-path points to the codeql binary
|
||||||
- name: Print CodeQL Version
|
- name: Print CodeQL Version
|
||||||
run: ${{steps.init.outputs.codeql-path}} version --format=json
|
run: ${{steps.init.outputs.codeql-path}} version --format=json
|
||||||
- uses: ./analyze
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: ./analyze
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
|
|||||||
@@ -2,12 +2,14 @@
|
|||||||
# when the analyze step fails.
|
# when the analyze step fails.
|
||||||
name: PR Check - Debug artifacts after failure
|
name: PR Check - Debug artifacts after failure
|
||||||
env:
|
env:
|
||||||
|
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
|
||||||
|
# workaround for our PR checks.
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: true
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
|
|||||||
4
.github/workflows/debug-artifacts.yml
vendored
4
.github/workflows/debug-artifacts.yml
vendored
@@ -1,12 +1,14 @@
|
|||||||
# Checks logs, SARIF, and database bundle debug artifacts exist.
|
# Checks logs, SARIF, and database bundle debug artifacts exist.
|
||||||
name: PR Check - Debug artifact upload
|
name: PR Check - Debug artifact upload
|
||||||
env:
|
env:
|
||||||
|
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
|
||||||
|
# workaround for our PR checks.
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: true
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
|
|||||||
1
.github/workflows/expected-queries-runs.yml
vendored
1
.github/workflows/expected-queries-runs.yml
vendored
@@ -4,7 +4,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
|
|||||||
14
.github/workflows/post-release-mergeback.yml
vendored
14
.github/workflows/post-release-mergeback.yml
vendored
@@ -1,8 +1,9 @@
|
|||||||
# This workflow runs after a release of the action. For v2 releases, it merges any changes from the
|
# This workflow runs after a release of the action. It:
|
||||||
# release back into the main branch. Typically, this is just a single commit that updates the
|
# 1. Merges any changes from the release back into the main branch. Typically, this is just a single
|
||||||
# changelog. For v2 and v1 releases, it then (a) tags the merge commit on the release branch that
|
# commit that updates the changelog.
|
||||||
# represents the new release with an `vx.y.z` tag and (b) updates the `vx` tag to refer to this
|
# 2. Tags the merge commit on the release branch that represents the new release with an `v2.x.y`
|
||||||
# commit.
|
# tag
|
||||||
|
# 3. Updates the `v2` tag to refer to this merge commit.
|
||||||
name: Tag release and merge back
|
name: Tag release and merge back
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -15,7 +16,6 @@ on:
|
|||||||
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -105,7 +105,7 @@ jobs:
|
|||||||
git push origin --atomic --force refs/tags/"${VERSION}" refs/tags/"${major_version_tag}"
|
git push origin --atomic --force refs/tags/"${VERSION}" refs/tags/"${major_version_tag}"
|
||||||
|
|
||||||
- name: Create mergeback branch
|
- name: Create mergeback branch
|
||||||
if: steps.check.outputs.exists != 'true' && contains(github.ref, 'releases/v2')
|
if: steps.check.outputs.exists != 'true'
|
||||||
env:
|
env:
|
||||||
VERSION: "${{ steps.getVersion.outputs.version }}"
|
VERSION: "${{ steps.getVersion.outputs.version }}"
|
||||||
NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}"
|
NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}"
|
||||||
|
|||||||
47
.github/workflows/pr-checks.yml
vendored
47
.github/workflows/pr-checks.yml
vendored
@@ -2,7 +2,7 @@ name: PR Checks
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main, releases/v1, releases/v2]
|
branches: [main, releases/v2]
|
||||||
pull_request:
|
pull_request:
|
||||||
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
||||||
# by other workflows.
|
# by other workflows.
|
||||||
@@ -15,10 +15,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-types-version: [12.12, current]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -26,28 +22,6 @@ jobs:
|
|||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run-script lint
|
run: npm run-script lint
|
||||||
|
|
||||||
- name: Update version of @types/node
|
|
||||||
if: matrix.node-types-version != 'current'
|
|
||||||
env:
|
|
||||||
NODE_TYPES_VERSION: ${{ matrix.node-types-version }}
|
|
||||||
run: |
|
|
||||||
# Export `NODE_TYPES_VERSION` so it's available to jq
|
|
||||||
export NODE_TYPES_VERSION="${NODE_TYPES_VERSION}"
|
|
||||||
contents=$(jq '.devDependencies."@types/node" = env.NODE_TYPES_VERSION' package.json)
|
|
||||||
echo "${contents}" > package.json
|
|
||||||
# Usually we run `npm install` on macOS to ensure that we pick up macOS-only dependencies.
|
|
||||||
# However we're not checking in the updated lockfile here, so it's fine to run
|
|
||||||
# `npm install` on Linux.
|
|
||||||
npm install
|
|
||||||
|
|
||||||
if [ ! -z "$(git status --porcelain)" ]; then
|
|
||||||
git config --global user.email "github-actions@github.com"
|
|
||||||
git config --global user.name "github-actions[bot]"
|
|
||||||
# The period in `git add --all .` ensures that we stage deleted files too.
|
|
||||||
git add --all .
|
|
||||||
git commit -m "Use @types/node=${NODE_TYPES_VERSION}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Check generated JS
|
- name: Check generated JS
|
||||||
run: .github/workflows/script/check-js.sh
|
run: .github/workflows/script/check-js.sh
|
||||||
|
|
||||||
@@ -70,25 +44,8 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
# Checks for any conflict markers created by git. This check is primarily intended to validate that
|
|
||||||
# any merge conflicts in the v2 -> v1 backport PR are fixed before the PR is merged.
|
|
||||||
- name: Check for merge conflicts
|
|
||||||
run: |
|
|
||||||
# Use `|| true` since grep returns exit code 1 if there are no matches, and we don't want
|
|
||||||
# this to fail the workflow.
|
|
||||||
FILES_WITH_CONFLICTS=$(grep --extended-regexp --ignore-case --line-number --recursive \
|
|
||||||
'^(<<<<<<<|>>>>>>>)' . || true)
|
|
||||||
if [[ "${FILES_WITH_CONFLICTS}" ]]; then
|
|
||||||
echo "Fail: Found merge conflict markers in the following files:"
|
|
||||||
echo ""
|
|
||||||
echo "${FILES_WITH_CONFLICTS}"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "Success: Found no merge conflict markers."
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.8
|
python-version: 3.8
|
||||||
|
|
||||||
|
|||||||
36
.github/workflows/python-deps.yml
vendored
36
.github/workflows/python-deps.yml
vendored
@@ -1,8 +1,8 @@
|
|||||||
name: Test Python Package Installation on Linux and Mac
|
name: Test Python Package Installation
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main, releases/v1, releases/v2]
|
branches: [main, releases/v2]
|
||||||
pull_request:
|
pull_request:
|
||||||
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
||||||
# by other workflows.
|
# by other workflows.
|
||||||
@@ -28,17 +28,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-20.04, ubuntu-22.04, macos-latest]
|
os: [ubuntu-20.04, ubuntu-22.04, macos-latest]
|
||||||
python_deps_type: [pipenv, poetry, requirements, setup_py]
|
python_deps_type: [pipenv, poetry, requirements, setup_py]
|
||||||
python_version: [2, 3]
|
python_version: [3]
|
||||||
exclude:
|
|
||||||
# Python2 and poetry are not supported. See https://github.com/actions/setup-python/issues/374
|
|
||||||
- python_version: 2
|
|
||||||
python_deps_type: poetry
|
|
||||||
# Python2 and pipenv are not supported since pipenv v2021.11.5
|
|
||||||
- python_version: 2
|
|
||||||
python_deps_type: pipenv
|
|
||||||
# Python2 is not available on ubuntu-22.04 by default -- see https://github.com/github/codeql-action/pull/1257
|
|
||||||
- python_version: 2
|
|
||||||
os: ubuntu-22.04
|
|
||||||
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -138,14 +128,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python_deps_type: [pipenv, poetry, requirements, setup_py]
|
python_deps_type: [pipenv, poetry, requirements, setup_py]
|
||||||
python_version: [2, 3]
|
python_version: [3]
|
||||||
exclude:
|
|
||||||
# Python2 and poetry are not supported. See https://github.com/actions/setup-python/issues/374
|
|
||||||
- python_version: 2
|
|
||||||
python_deps_type: poetry
|
|
||||||
# Python2 and pipenv are not supported since pipenv v2021.11.5
|
|
||||||
- python_version: 2
|
|
||||||
python_deps_type: pipenv
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
@@ -156,11 +139,12 @@ jobs:
|
|||||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/setup-python@v3
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python_version }}
|
python-version: ${{ matrix.python_version }}
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
|
id: init
|
||||||
uses: ./init
|
uses: ./init
|
||||||
with:
|
with:
|
||||||
tools: latest
|
tools: latest
|
||||||
@@ -168,15 +152,15 @@ jobs:
|
|||||||
setup-python-dependencies: false
|
setup-python-dependencies: false
|
||||||
|
|
||||||
- name: Test Auto Package Installation
|
- name: Test Auto Package Installation
|
||||||
|
env:
|
||||||
|
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
|
||||||
run: |
|
run: |
|
||||||
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\install_tools.ps1"
|
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\install_tools.ps1"
|
||||||
powershell -File $cmd
|
powershell -File $cmd
|
||||||
|
|
||||||
cd $Env:GITHUB_WORKSPACE\\python-setup/tests/$Env:PYTHON_DEPS_TYPE/requests-$Env:PYTHON_VERSION
|
cd $Env:GITHUB_WORKSPACE\\python-setup/tests/$Env:PYTHON_DEPS_TYPE/requests-$Env:PYTHON_VERSION
|
||||||
$DefaultsPath = Join-Path (Join-Path $Env:GITHUB_WORKSPACE "src") "defaults.json"
|
$codeql_dist = (get-item $Env:CODEQL_PATH).Directory.FullName
|
||||||
$CodeQLBundleName = (Get-Content -Raw -Path $DefaultsPath | ConvertFrom-Json).bundleVersion
|
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py $codeql_dist
|
||||||
$CodeQLVersion = "0.0.0-" + $CodeQLBundleName.split("-")[-1]
|
|
||||||
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\$CodeQLVersion\\x64\\codeql
|
|
||||||
|
|
||||||
- name: Setup for extractor
|
- name: Setup for extractor
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
1
.github/workflows/query-filters.yml
vendored
1
.github/workflows/query-filters.yml
vendored
@@ -4,7 +4,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v1
|
|
||||||
- releases/v2
|
- releases/v2
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
|
|||||||
11
.github/workflows/script/check-node-modules.sh
vendored
11
.github/workflows/script/check-node-modules.sh
vendored
@@ -7,14 +7,9 @@ if [ ! -z "$(git status --porcelain)" ]; then
|
|||||||
>&2 echo "Failed: Repo should be clean before testing!"
|
>&2 echo "Failed: Repo should be clean before testing!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Pin npm to v8 since v9 doesn't support Node 12.
|
|
||||||
# When updating this, make sure to update the npm version in
|
"$(dirname "$0")/update-node-modules.sh" check-only
|
||||||
# `.github/workflows/update-dependencies.yml` too.
|
|
||||||
sudo npm install --force -g npm@^8.19.3
|
|
||||||
# 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
|
# Check that repo is still clean
|
||||||
if [ ! -z "$(git status --porcelain)" ]; then
|
if [ ! -z "$(git status --porcelain)" ]; then
|
||||||
# If we get a fail here then the PR needs attention
|
# If we get a fail here then the PR needs attention
|
||||||
|
|||||||
18
.github/workflows/script/update-node-modules.sh
vendored
Executable file
18
.github/workflows/script/update-node-modules.sh
vendored
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
if [ "$1" != "update" && "$1" != "check-only" ]; then
|
||||||
|
>&2 echo "Failed: Invalid argument. Must be 'update' or 'check-only'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo npm install --force -g npm@9.2.0
|
||||||
|
|
||||||
|
# clean the npm cache to ensure we don't have any files owned by root
|
||||||
|
sudo npm cache clean --force
|
||||||
|
|
||||||
|
if [ "$1" = "update" ]; then
|
||||||
|
npm install
|
||||||
|
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
|
||||||
@@ -10,7 +10,7 @@ fi
|
|||||||
|
|
||||||
if [ "$#" -eq 1 ]; then
|
if [ "$#" -eq 1 ]; then
|
||||||
# If we were passed an argument, use that as the SHA
|
# If we were passed an argument, use that as the SHA
|
||||||
GITHUB_SHA="$0"
|
GITHUB_SHA="$1"
|
||||||
elif [ "$#" -gt 1 ]; then
|
elif [ "$#" -gt 1 ]; then
|
||||||
echo "Usage: $0 [SHA]"
|
echo "Usage: $0 [SHA]"
|
||||||
echo "Update the required checks based on the SHA, or main."
|
echo "Update the required checks based on the SHA, or main."
|
||||||
@@ -23,13 +23,13 @@ fi
|
|||||||
echo "Getting checks for $GITHUB_SHA"
|
echo "Getting checks for $GITHUB_SHA"
|
||||||
|
|
||||||
# Ignore any checks with "https://", CodeQL, LGTM, and Update checks.
|
# Ignore any checks with "https://", CodeQL, LGTM, and Update checks.
|
||||||
CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs | .[].name | select(contains("https://") or . == "CodeQL" or . == "LGTM.com" or contains("Update") or contains("update") or contains("test-setup-python-scripts") | not)] | unique | sort')"
|
CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs | .[].name | select(contains("https://") or . == "CodeQL" or . == "LGTM.com" or . == "check-expected-release-files" or contains("Update") or contains("update") or contains("test-setup-python-scripts") | not)] | unique | sort')"
|
||||||
|
|
||||||
echo "$CHECKS" | jq
|
echo "$CHECKS" | jq
|
||||||
|
|
||||||
echo "{\"contexts\": ${CHECKS}}" > checks.json
|
echo "{\"contexts\": ${CHECKS}}" > checks.json
|
||||||
|
|
||||||
for BRANCH in main releases/v2 releases/v1; do
|
for BRANCH in main releases/v2; do
|
||||||
echo "Updating $BRANCH"
|
echo "Updating $BRANCH"
|
||||||
gh api --silent -X "PATCH" "repos/github/codeql-action/branches/$BRANCH/protection/required_status_checks" --input checks.json
|
gh api --silent -X "PATCH" "repos/github/codeql-action/branches/$BRANCH/protection/required_status_checks" --input checks.json
|
||||||
done
|
done
|
||||||
|
|||||||
8
.github/workflows/update-dependencies.yml
vendored
8
.github/workflows/update-dependencies.yml
vendored
@@ -27,13 +27,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git fetch origin "$BRANCH" --depth=1
|
git fetch origin "$BRANCH" --depth=1
|
||||||
git checkout "origin/$BRANCH"
|
git checkout "origin/$BRANCH"
|
||||||
# Pin npm to v8 since v9 doesn't support Node 12.
|
.github/workflows/script/update-node-modules.sh update
|
||||||
# When updating this, make sure to update the npm version in
|
|
||||||
# `.github/workflows/script/check-node-modules.sh` too.
|
|
||||||
sudo npm install --force -g npm@^8.19.3
|
|
||||||
npm install
|
|
||||||
npm ci
|
|
||||||
npm run removeNPMAbsolutePaths
|
|
||||||
if [ ! -z "$(git status --porcelain)" ]; then
|
if [ ! -z "$(git status --porcelain)" ]; then
|
||||||
git config --global user.email "github-actions@github.com"
|
git config --global user.email "github-actions@github.com"
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
|
|||||||
20
.github/workflows/update-release-branch.yml
vendored
20
.github/workflows/update-release-branch.yml
vendored
@@ -4,11 +4,6 @@ on:
|
|||||||
# This will open a PR to update the v2 release branch.
|
# This will open a PR to update the v2 release branch.
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# When the v2 release is complete, this workflow will open a PR to update the v1 release branch.
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- releases/v2
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update:
|
update:
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
@@ -29,7 +24,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.8
|
python-version: 3.8
|
||||||
|
|
||||||
@@ -43,20 +38,9 @@ jobs:
|
|||||||
git config --global user.email "github-actions@github.com"
|
git config --global user.email "github-actions@github.com"
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
|
|
||||||
- name: Update v2 release branch
|
- name: Update release branch
|
||||||
if: github.event_name == 'workflow_dispatch'
|
|
||||||
run: |
|
run: |
|
||||||
python .github/update-release-branch.py \
|
python .github/update-release-branch.py \
|
||||||
--github-token ${{ secrets.GITHUB_TOKEN }} \
|
--github-token ${{ secrets.GITHUB_TOKEN }} \
|
||||||
--repository-nwo ${{ github.repository }} \
|
--repository-nwo ${{ github.repository }} \
|
||||||
--mode v2-release \
|
|
||||||
--conductor ${GITHUB_ACTOR}
|
|
||||||
|
|
||||||
- name: Update v1 release branch
|
|
||||||
if: github.event_name == 'push'
|
|
||||||
run: |
|
|
||||||
python .github/update-release-branch.py \
|
|
||||||
--github-token ${{ secrets.GITHUB_TOKEN }} \
|
|
||||||
--repository-nwo ${{ github.repository }} \
|
|
||||||
--mode v1-release \
|
|
||||||
--conductor ${GITHUB_ACTOR}
|
--conductor ${GITHUB_ACTOR}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.7"
|
python-version: "3.7"
|
||||||
- name: Checkout CodeQL Action
|
- name: Checkout CodeQL Action
|
||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
ENTERPRISE_RELEASES_PATH: ${{ github.workspace }}/enterprise-releases/
|
ENTERPRISE_RELEASES_PATH: ${{ github.workspace }}/enterprise-releases/
|
||||||
- name: Commit Changes
|
- name: Commit Changes
|
||||||
uses: peter-evans/create-pull-request@c7f493a8000b8aeb17a1332e326ba76b57cb83eb # v3.4.1
|
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
|
||||||
with:
|
with:
|
||||||
commit-message: Update supported GitHub Enterprise Server versions.
|
commit-message: Update supported GitHub Enterprise Server versions.
|
||||||
title: Update supported GitHub Enterprise Server versions.
|
title: Update supported GitHub Enterprise Server versions.
|
||||||
|
|||||||
73
CHANGELOG.md
73
CHANGELOG.md
@@ -4,6 +4,75 @@
|
|||||||
|
|
||||||
No user facing changes.
|
No user facing changes.
|
||||||
|
|
||||||
|
## 2.2.7 - 15 Mar 2023
|
||||||
|
|
||||||
|
No user facing changes.
|
||||||
|
|
||||||
|
## 2.2.6 - 10 Mar 2023
|
||||||
|
|
||||||
|
- Update default CodeQL bundle version to 2.12.4.
|
||||||
|
|
||||||
|
## 2.2.5 - 24 Feb 2023
|
||||||
|
|
||||||
|
- Update default CodeQL bundle version to 2.12.3. [#1543](https://github.com/github/codeql-action/pull/1543)
|
||||||
|
|
||||||
|
## 2.2.4 - 10 Feb 2023
|
||||||
|
|
||||||
|
No user facing changes.
|
||||||
|
|
||||||
|
## 2.2.3 - 08 Feb 2023
|
||||||
|
|
||||||
|
- Update default CodeQL bundle version to 2.12.2. [#1518](https://github.com/github/codeql-action/pull/1518)
|
||||||
|
|
||||||
|
## 2.2.2 - 06 Feb 2023
|
||||||
|
|
||||||
|
- Fix an issue where customers using the CodeQL Action with the [CodeQL Action sync tool](https://docs.github.com/en/enterprise-server@3.7/admin/code-security/managing-github-advanced-security-for-your-enterprise/configuring-code-scanning-for-your-appliance#configuring-codeql-analysis-on-a-server-without-internet-access) would not be able to obtain the CodeQL tools. [#1517](https://github.com/github/codeql-action/pull/1517)
|
||||||
|
|
||||||
|
## 2.2.1 - 27 Jan 2023
|
||||||
|
|
||||||
|
No user facing changes.
|
||||||
|
|
||||||
|
## 2.2.0 - 26 Jan 2023
|
||||||
|
|
||||||
|
- Improve stability when choosing the default version of CodeQL to use in code scanning workflow runs on Actions on GitHub.com. [#1475](https://github.com/github/codeql-action/pull/1475)
|
||||||
|
- This change addresses customer reports of code scanning alerts on GitHub.com being closed and reopened during the rollout of new versions of CodeQL in the GitHub Actions [runner images](https://github.com/actions/runner-images).
|
||||||
|
- **No change is required for the majority of workflows**, including:
|
||||||
|
- Workflows on GitHub.com hosted runners using the latest version (`v2`) of the CodeQL Action.
|
||||||
|
- Workflows on GitHub.com hosted runners that are pinned to specific versions of the CodeQL Action from `v2.2.0` onwards.
|
||||||
|
- Workflows on GitHub Enterprise Server.
|
||||||
|
- **A change may be required** for workflows on GitHub.com hosted runners that are pinned to specific versions of the CodeQL Action before `v2.2.0` (e.g. `v2.1.32`):
|
||||||
|
- Previously, these workflows would obtain the latest version of CodeQL from the Actions runner image.
|
||||||
|
- Now, these workflows will download an older, compatible version of CodeQL from GitHub Releases. To use this older version, no change is required. To use the newest version of CodeQL, please update your workflows to reference the latest version of the CodeQL Action (`v2`).
|
||||||
|
- **Internal changes**
|
||||||
|
- These changes will not affect the majority of code scanning workflows. Continue reading only if your workflow uses [@actions/tool-cache](https://github.com/actions/toolkit/tree/main/packages/tool-cache) or relies on the precise location of CodeQL within the Actions tool cache.
|
||||||
|
- The tool cache now contains **two** recent CodeQL versions (previously **one**).
|
||||||
|
- Each CodeQL version is located under a directory named after the release date and version number, e.g. CodeQL 2.11.6 is now located under `CodeQL/2.11.6-20221211/x64/codeql` (previously `CodeQL/0.0.0-20221211/x64/codeql`).
|
||||||
|
- The maximum number of [SARIF runs](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#run-object) per file has been increased from 15 to 20 for users uploading SARIF files to GitHub.com. This change will help ensure that Code Scanning can process SARIF files generated by third-party tools that have many runs. See the [GitHub API documentation](https://docs.github.com/en/rest/code-scanning#upload-an-analysis-as-sarif-data) for a list of all the limits around uploading SARIF. This change will be released to GitHub Enterprise Server as part of GHES 3.9.
|
||||||
|
- Update default CodeQL bundle version to 2.12.1. [#1498](https://github.com/github/codeql-action/pull/1498)
|
||||||
|
- Fix a bug that forced the `init` Action to run for at least two minutes on JavaScript. [#1494](https://github.com/github/codeql-action/pull/1494)
|
||||||
|
|
||||||
|
## 2.1.39 - 18 Jan 2023
|
||||||
|
|
||||||
|
- CodeQL Action v1 is now deprecated, and is no longer updated or supported. For better performance, improved security, and new features, upgrade to v2. For more information, see [this changelog post](https://github.blog/changelog/2023-01-18-code-scanning-codeql-action-v1-is-now-deprecated/). [#1467](https://github.com/github/codeql-action/pull/1466)
|
||||||
|
- Python automatic dependency installation will no longer fail for projects using Poetry that specify `virtualenvs.options.no-pip = true` in their `poetry.toml`. [#1431](https://github.com/github/codeql-action/pull/1431)
|
||||||
|
- Avoid printing a stack trace and error message when the action fails to find the SHA at the
|
||||||
|
current directory. This will happen in several non-error states and so we now avoid cluttering the
|
||||||
|
log with this message. [#1485](https://github.com/github/codeql-action/pull/1485)
|
||||||
|
|
||||||
|
## 2.1.38 - 12 Jan 2023
|
||||||
|
|
||||||
|
- Update default CodeQL bundle version to 2.12.0. [#1466](https://github.com/github/codeql-action/pull/1466)
|
||||||
|
|
||||||
|
## 2.1.37 - 14 Dec 2022
|
||||||
|
|
||||||
|
- Update default CodeQL bundle version to 2.11.6. [#1433](https://github.com/github/codeql-action/pull/1433)
|
||||||
|
|
||||||
|
## 2.1.36 - 08 Dec 2022
|
||||||
|
|
||||||
|
- Update default CodeQL bundle version to 2.11.5. [#1412](https://github.com/github/codeql-action/pull/1412)
|
||||||
|
- Add a step that tries to upload a SARIF file for the workflow run when that workflow run fails. This will help better surface failed code scanning workflow runs. [#1393](https://github.com/github/codeql-action/pull/1393)
|
||||||
|
- Python automatic dependency installation will no longer consider dependency code installed in venv as user-written, for projects using Poetry that specify `virtualenvs.in-project = true` in their `poetry.toml`. [#1419](https://github.com/github/codeql-action/pull/1419)
|
||||||
|
|
||||||
## 2.1.35 - 01 Dec 2022
|
## 2.1.35 - 01 Dec 2022
|
||||||
|
|
||||||
No user facing changes.
|
No user facing changes.
|
||||||
@@ -51,7 +120,7 @@ No user facing changes.
|
|||||||
## 2.1.25 - 21 Sep 2022
|
## 2.1.25 - 21 Sep 2022
|
||||||
|
|
||||||
- We will soon be rolling out a feature of the CodeQL Action that stores some information used to make future runs faster in the GitHub Actions cache. Initially, this will only be enabled on JavaScript repositories, but we plan to add more languages to this soon. The new feature can be disabled by passing the `trap-caching: false` option to your workflow's `init` step, for example if you are already using the GitHub Actions cache for a different purpose and are near the storage limit for it.
|
- We will soon be rolling out a feature of the CodeQL Action that stores some information used to make future runs faster in the GitHub Actions cache. Initially, this will only be enabled on JavaScript repositories, but we plan to add more languages to this soon. The new feature can be disabled by passing the `trap-caching: false` option to your workflow's `init` step, for example if you are already using the GitHub Actions cache for a different purpose and are near the storage limit for it.
|
||||||
- Add support for Python automatic dependency installation with Poetry 1.2 [#1258](https://github.com/github/codeql-action/pull/1258).
|
- Add support for Python automatic dependency installation with Poetry 1.2 [#1258](https://github.com/github/codeql-action/pull/1258)
|
||||||
|
|
||||||
## 2.1.24 - 16 Sep 2022
|
## 2.1.24 - 16 Sep 2022
|
||||||
|
|
||||||
@@ -303,7 +372,7 @@ No user facing changes.
|
|||||||
## 1.0.4 - 28 Jun 2021
|
## 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 `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)
|
- Fix counting of lines of code for C# projects. [#586](https://github.com/github/codeql-action/pull/586)
|
||||||
|
|
||||||
## 1.0.3 - 23 Jun 2021
|
## 1.0.3 - 23 Jun 2021
|
||||||
|
|
||||||
|
|||||||
@@ -67,12 +67,8 @@ Here are a few things you can do that will increase the likelihood of your pull
|
|||||||
This mergeback incorporates the changelog updates into `main`, tags the release using the merge commit of the "Merge main into releases/v2" pull request, and bumps the patch version of the CodeQL Action.
|
This mergeback incorporates the changelog updates into `main`, tags the release using the merge commit of the "Merge main into releases/v2" pull request, and bumps the patch version of the CodeQL Action.
|
||||||
|
|
||||||
Approve the mergeback PR and automerge it.
|
Approve the mergeback PR and automerge it.
|
||||||
1. When the "Merge main into releases/v2" pull request is merged into the `releases/v2` branch, the "Update release branch" workflow will create a "Merge releases/v2 into releases/v1" pull request to merge the changes since the last release into the `releases/v1` release branch.
|
|
||||||
This ensures we keep both the `releases/v1` and `releases/v2` release branches up to date and fully supported.
|
|
||||||
|
|
||||||
Review the checklist items in the pull request description.
|
Once the mergeback has been merged to `main`, the release is complete.
|
||||||
Once you've checked off all the items, approve the PR and automerge it.
|
|
||||||
1. Once the mergeback has been merged to `main` and the "Merge releases/v2 into releases/v1" PR has been merged to `releases/v1`, the release is complete.
|
|
||||||
|
|
||||||
## Keeping the PR checks up to date (admin access required)
|
## Keeping the PR checks up to date (admin access required)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# CodeQL Action
|
# CodeQL Action
|
||||||
|
|
||||||
This action runs GitHub's industry-leading semantic code 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/github/codeql), which have been developed by the community and the [GitHub Security Lab](https://securitylab.github.com/) to find common vulnerabilities in your code.
|
This action runs GitHub's industry-leading semantic code analysis engine, [CodeQL](https://codeql.github.com/), 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/github/codeql), which have been developed by the community and the [GitHub Security Lab](https://securitylab.github.com/) to find common vulnerabilities in your code.
|
||||||
|
|
||||||
For a list of recent changes, see the CodeQL Action's [changelog](CHANGELOG.md).
|
For a list of recent changes, see the CodeQL Action's [changelog](CHANGELOG.md).
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ inputs:
|
|||||||
upload:
|
upload:
|
||||||
description: Upload the SARIF file to Code Scanning
|
description: Upload the SARIF file to Code Scanning
|
||||||
required: false
|
required: false
|
||||||
|
# If changing this, make sure to update workflow.ts accordingly.
|
||||||
default: "true"
|
default: "true"
|
||||||
cleanup-level:
|
cleanup-level:
|
||||||
description: "Level of cleanup to perform on CodeQL databases at the end of the analyze step. This should either be 'none' to skip cleanup, or be a valid argument for the --mode flag of the CodeQL CLI command 'codeql database cleanup' as documented at https://codeql.github.com/docs/codeql-cli/manual/database-cleanup"
|
description: "Level of cleanup to perform on CodeQL databases at the end of the analyze step. This should either be 'none' to skip cleanup, or be a valid argument for the --mode flag of the CodeQL CLI command 'codeql database cleanup' as documented at https://codeql.github.com/docs/codeql-cli/manual/database-cleanup"
|
||||||
@@ -44,6 +45,7 @@ inputs:
|
|||||||
checkout_path:
|
checkout_path:
|
||||||
description: "The path at which the analyzed repository was checked out. Used to relativize any absolute paths in the uploaded SARIF file."
|
description: "The path at which the analyzed repository was checked out. Used to relativize any absolute paths in the uploaded SARIF file."
|
||||||
required: false
|
required: false
|
||||||
|
# If changing this, make sure to update workflow.ts accordingly.
|
||||||
default: ${{ github.workspace }}
|
default: ${{ github.workspace }}
|
||||||
ref:
|
ref:
|
||||||
description: "The ref where results will be uploaded. If not provided, the Action will use the GITHUB_REF environment variable. If provided, the sha input must be provided as well. This input is not available in pull requests from forks."
|
description: "The ref where results will be uploaded. If not provided, the Action will use the GITHUB_REF environment variable. If provided, the sha input must be provided as well. This input is not available in pull requests from forks."
|
||||||
|
|||||||
30
lib/actions-util.js
generated
30
lib/actions-util.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -19,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.printDebugLogs = exports.isAnalyzingDefaultBranch = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.workflowEventName = exports.sendStatusReport = exports.createStatusReportBase = exports.getActionsStatus = exports.getRef = exports.computeAutomationID = exports.getAutomationID = exports.getAnalysisKey = exports.determineMergeBaseCommitOid = exports.getCommitOid = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0;
|
exports.printDebugLogs = exports.isAnalyzingDefaultBranch = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.workflowEventName = exports.sendStatusReport = exports.createStatusReportBase = exports.getActionVersion = exports.getActionsStatus = exports.getRef = exports.computeAutomationID = exports.getAutomationID = exports.getAnalysisKey = exports.determineMergeBaseCommitOid = exports.getCommitOid = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const os = __importStar(require("os"));
|
const os = __importStar(require("os"));
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
@@ -88,8 +92,9 @@ const getCommitOid = async function (checkoutPath, ref = "HEAD") {
|
|||||||
return commitOid.trim();
|
return commitOid.trim();
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
core.info(`Failed to call git to get current commit. Continuing with data from environment or input: ${e}`);
|
core.info("Could not determine current commit SHA using git. Continuing with data from user input or environment.");
|
||||||
core.info(e.stack || "NO STACK");
|
core.debug(`Reason: ${e.message}`);
|
||||||
|
core.debug(e.stack || "NO STACK");
|
||||||
return (0, exports.getOptionalInput)("sha") || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
return (0, exports.getOptionalInput)("sha") || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -173,10 +178,10 @@ async function getAutomationID() {
|
|||||||
exports.getAutomationID = getAutomationID;
|
exports.getAutomationID = getAutomationID;
|
||||||
function computeAutomationID(analysis_key, environment) {
|
function computeAutomationID(analysis_key, environment) {
|
||||||
let automationID = `${analysis_key}/`;
|
let automationID = `${analysis_key}/`;
|
||||||
// the id has to be deterministic so we sort the fields
|
const matrix = (0, util_1.parseMatrixInput)(environment);
|
||||||
if (environment !== undefined && environment !== "null") {
|
if (matrix !== undefined) {
|
||||||
const environmentObject = JSON.parse(environment);
|
// the id has to be deterministic so we sort the fields
|
||||||
for (const entry of Object.entries(environmentObject).sort()) {
|
for (const entry of Object.entries(matrix).sort()) {
|
||||||
if (typeof entry[1] === "string") {
|
if (typeof entry[1] === "string") {
|
||||||
automationID += `${entry[0]}:${entry[1]}/`;
|
automationID += `${entry[0]}:${entry[1]}/`;
|
||||||
}
|
}
|
||||||
@@ -269,6 +274,10 @@ function getActionsStatus(error, otherFailureCause) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.getActionsStatus = getActionsStatus;
|
exports.getActionsStatus = getActionsStatus;
|
||||||
|
function getActionVersion() {
|
||||||
|
return pkg.version;
|
||||||
|
}
|
||||||
|
exports.getActionVersion = getActionVersion;
|
||||||
/**
|
/**
|
||||||
* Compose a StatusReport.
|
* Compose a StatusReport.
|
||||||
*
|
*
|
||||||
@@ -318,7 +327,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
|
|||||||
status,
|
status,
|
||||||
testing_environment: testingEnvironment,
|
testing_environment: testingEnvironment,
|
||||||
runner_os: runnerOs,
|
runner_os: runnerOs,
|
||||||
action_version: pkg.version,
|
action_version: getActionVersion(),
|
||||||
};
|
};
|
||||||
// Add optional parameters
|
// Add optional parameters
|
||||||
if (cause) {
|
if (cause) {
|
||||||
@@ -472,12 +481,11 @@ function removeRefsHeadsPrefix(ref) {
|
|||||||
// Is the version of the repository we are currently analyzing from the default branch,
|
// Is the version of the repository we are currently analyzing from the default branch,
|
||||||
// or alternatively from another branch or a pull request.
|
// or alternatively from another branch or a pull request.
|
||||||
async function isAnalyzingDefaultBranch() {
|
async function isAnalyzingDefaultBranch() {
|
||||||
var _a;
|
|
||||||
// Get the current ref and trim and refs/heads/ prefix
|
// Get the current ref and trim and refs/heads/ prefix
|
||||||
let currentRef = await getRef();
|
let currentRef = await getRef();
|
||||||
currentRef = removeRefsHeadsPrefix(currentRef);
|
currentRef = removeRefsHeadsPrefix(currentRef);
|
||||||
const event = getWorkflowEvent();
|
const event = getWorkflowEvent();
|
||||||
let defaultBranch = (_a = event === null || event === void 0 ? void 0 : event.repository) === null || _a === void 0 ? void 0 : _a.default_branch;
|
let defaultBranch = event?.repository?.default_branch;
|
||||||
if (process.env.GITHUB_EVENT_NAME === "schedule") {
|
if (process.env.GITHUB_EVENT_NAME === "schedule") {
|
||||||
defaultBranch = removeRefsHeadsPrefix((0, util_1.getRequiredEnvParam)("GITHUB_REF"));
|
defaultBranch = removeRefsHeadsPrefix((0, util_1.getRequiredEnvParam)("GITHUB_REF"));
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
30
lib/actions-util.test.js
generated
30
lib/actions-util.test.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -94,6 +98,30 @@ const util_1 = require("./util");
|
|||||||
getAdditionalInputStub.restore();
|
getAdditionalInputStub.restore();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
(0, ava_1.default)("getRef() returns CODE_SCANNING_REF as a fallback for GITHUB_REF", async (t) => {
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
const expectedRef = "refs/pull/1/HEAD";
|
||||||
|
const currentSha = "a".repeat(40);
|
||||||
|
process.env["CODE_SCANNING_REF"] = expectedRef;
|
||||||
|
process.env["GITHUB_REF"] = "";
|
||||||
|
process.env["GITHUB_SHA"] = currentSha;
|
||||||
|
const actualRef = await actionsutil.getRef();
|
||||||
|
t.deepEqual(actualRef, expectedRef);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("getRef() returns GITHUB_REF over CODE_SCANNING_REF if both are provided", async (t) => {
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
const expectedRef = "refs/pull/1/merge";
|
||||||
|
const currentSha = "a".repeat(40);
|
||||||
|
process.env["CODE_SCANNING_REF"] = "refs/pull/1/HEAD";
|
||||||
|
process.env["GITHUB_REF"] = expectedRef;
|
||||||
|
process.env["GITHUB_SHA"] = currentSha;
|
||||||
|
const actualRef = await actionsutil.getRef();
|
||||||
|
t.deepEqual(actualRef, expectedRef);
|
||||||
|
});
|
||||||
|
});
|
||||||
(0, ava_1.default)("getRef() throws an error if only `ref` is provided as an input", async (t) => {
|
(0, ava_1.default)("getRef() throws an error if only `ref` is provided as an input", async (t) => {
|
||||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
6
lib/analysis-paths.js
generated
6
lib/analysis-paths.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analysis-paths.js","sourceRoot":"","sources":["../src/analysis-paths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAK7B,SAAS,qBAAqB,CAAC,QAAQ;IACrC,OAAO,CACL,QAAQ,KAAK,YAAY,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,MAAM,CAC1E,CAAC;AACJ,CAAC;AAED,6FAA6F;AAChF,QAAA,+BAA+B,GAAG,cAAc,CAAC;AAE9D,uFAAuF;AACvF,SAAS,yBAAyB,CAAC,KAAe;IAChD,iCAAiC;IACjC,KAAK,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QACvC,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,EACvC;QACA,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;KACzD;IACD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;QAC5B,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,yBAAyB,CAAC,WAAW,CAAC,CAAC;KAC5E;IAED,yEAAyE;IACzE,6EAA6E;IAC7E,wDAAwD;IACxD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;IACzD,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACxD;AACH,CAAC;AAjCD,wEAiCC"}
|
||||||
6
lib/analysis-paths.test.js
generated
6
lib/analysis-paths.test.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analysis-paths.test.js","sourceRoot":"","sources":["../src/analysis-paths.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,8CAAuB;AAEvB,gEAAkD;AAClD,mDAA6C;AAC7C,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,IAAA,aAAI,EAAC,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC7B,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAG;YACb,SAAS,EAAE,EAAE;YACb,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,EAAE;YACf,KAAK,EAAE,EAAE;YACT,iBAAiB,EAAE,EAAE;YACrB,OAAO,EAAE,MAAM;YACf,SAAS,EAAE,EAAE;YACb,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAwB;YACxE,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,kBAAkB,CAAC;YACpD,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,KAAK;YAChB,iBAAiB,EAAE,IAAI,CAAC,2BAA2B;YACnD,iBAAiB,EAAE,IAAI,CAAC,2BAA2B;YACnD,sBAAsB,EAAE;gBACtB,iBAAiB,EAAE,KAAK;gBACxB,kBAAkB,EAAE,KAAK;gBACzB,oBAAoB,EAAE,KAAK;aAC5B;YACD,UAAU,EAAE,EAAE;YACd,qBAAqB,EAAE,CAAC;SACzB,CAAC;QACF,aAAa,CAAC,8BAA8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OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,SAAS,CAAC,CAAC;IACnD,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC,CAAC;IAC9D,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,SAAS,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}
|
||||||
6
lib/analyze-action-env.test.js
generated
6
lib/analyze-action-env.test.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analyze-action-env.test.js","sourceRoot":"","sources":["../src/analyze-action-env.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,mDAAqC;AACrC,4DAA8C;AAC9C,mDAIyB;AACzB,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E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uEAAuE;QACvE,oEAAoE;QACpE,4EAA4E;QAC5E,wEAAwE;QACxE,MAAM,aAAa,CAAC,UAAU,CAAC;QAE/B,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC/D,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QAC7D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC9D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
||||||
6
lib/analyze-action-input.test.js
generated
6
lib/analyze-action-input.test.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analyze-action-input.test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AE,CAAC,CAAC;QAEpC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;QAEnC,4DAA4D;QAC5D,iBAAiB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACpD,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAElD,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAC3D,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACzD,MAAM,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAElD,uEAAuE;QACvE,oEAAoE;QACpE,4EAA4E;QAC5E,wEAAwE;QACxE,MAAM,aAAa,CAAC,UAAU,CAAC;QAE/B,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC/D,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QAC7D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC9D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
||||||
8
lib/analyze-action-post-helper.js
generated
8
lib/analyze-action-post-helper.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -31,7 +35,7 @@ async function run(uploadSarifDebugArtifact) {
|
|||||||
throw new Error("Config file could not be found at expected location. Did the 'init' action fail to start?");
|
throw new Error("Config file could not be found at expected location. Did the 'init' action fail to start?");
|
||||||
}
|
}
|
||||||
// Upload Actions SARIF artifacts for debugging
|
// Upload Actions SARIF artifacts for debugging
|
||||||
if (config === null || config === void 0 ? void 0 : config.debugMode) {
|
if (config?.debugMode) {
|
||||||
core.info("Debug mode is on. Uploading available SARIF files as Actions debugging artifact...");
|
core.info("Debug mode is on. Uploading available SARIF files as Actions debugging artifact...");
|
||||||
const outputDir = actionsUtil.getRequiredInput("output");
|
const outputDir = actionsUtil.getRequiredInput("output");
|
||||||
await uploadSarifDebugArtifact(config, outputDir);
|
await uploadSarifDebugArtifact(config, outputDir);
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analyze-action-post-helper.js","sourceRoot":"","sources":["../src/analyze-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,iDAA2C;AAC3C,uCAA6C;AAEtC,KAAK,UAAU,GAAG,CAAC,wBAAkC;IAC1D,MAA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}
|
||||||
6
lib/analyze-action-post-helper.test.js
generated
6
lib/analyze-action-post-helper.test.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analyze-action-post-helper.test.js","sourceRoot":"","sources":["../src/analyze-action-post-helper.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,sFAAwE;AACxE,4DAA8C;AAC9C,mDAA6C;AAC7C,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,IAAA,aAAI,EAAC,0CAA0C,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC3D,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAC5C,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC;QAEpC,MAAM,aAAa,GAAuB;YACxC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;SAChC,CAAC;QACF,KAAK,CAA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SAChC,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC;YAC5C,SAAS,EAAE,IAAI;YACf,aAAa;YACb,SAAS,EAAE,EAAE;YACb,KAAK,EAAE,EAAE;SACuB,CAAC,CAAC;QAEpC,MAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QACtE,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAEhE,MAAM,cAAc,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;QAEnC,MAAM,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAElD,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
||||||
6
lib/analyze-action-post.js
generated
6
lib/analyze-action-post.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analyze-action-post.js","sourceRoot":"","sources":["../src/analyze-action-post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,oDAAsC;AAEtC,sFAAwE;AACxE,kEAAoD;AAEpD,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;KAC5E;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,oCAAoC,KAAK,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
{"version":3,"file":"analyze-action-post.js","sourceRoot":"","sources":["../src/analyze-action-post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,oDAAsC;AAEtC,sFAAwE;AACxE,kEAAoD;AAEpD,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;KAC5E;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,oCAAoC,KAAK,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||||
20
lib/analyze-action.js
generated
20
lib/analyze-action.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -25,7 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
exports.runPromise = exports.sendStatusReport = void 0;
|
exports.runPromise = exports.sendStatusReport = void 0;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const path_1 = __importDefault(require("path"));
|
const path_1 = __importDefault(require("path"));
|
||||||
// We need to import `performance` on Node 12
|
|
||||||
const perf_hooks_1 = require("perf_hooks");
|
const perf_hooks_1 = require("perf_hooks");
|
||||||
const core = __importStar(require("@actions/core"));
|
const core = __importStar(require("@actions/core"));
|
||||||
const actionsUtil = __importStar(require("./actions-util"));
|
const actionsUtil = __importStar(require("./actions-util"));
|
||||||
@@ -39,15 +42,14 @@ const feature_flags_1 = require("./feature-flags");
|
|||||||
const languages_1 = require("./languages");
|
const languages_1 = require("./languages");
|
||||||
const logging_1 = require("./logging");
|
const logging_1 = require("./logging");
|
||||||
const repository_1 = require("./repository");
|
const repository_1 = require("./repository");
|
||||||
|
const shared_environment_1 = require("./shared-environment");
|
||||||
const trap_caching_1 = require("./trap-caching");
|
const trap_caching_1 = require("./trap-caching");
|
||||||
const upload_lib = __importStar(require("./upload-lib"));
|
const upload_lib = __importStar(require("./upload-lib"));
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
// eslint-disable-next-line import/no-commonjs
|
|
||||||
const pkg = require("../package.json");
|
|
||||||
async function sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger) {
|
async function sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger) {
|
||||||
const status = actionsUtil.getActionsStatus(error, stats === null || stats === void 0 ? void 0 : stats.analyze_failure_language);
|
const status = actionsUtil.getActionsStatus(error, stats?.analyze_failure_language);
|
||||||
const statusReportBase = await actionsUtil.createStatusReportBase("finish", status, startedAt, error === null || error === void 0 ? void 0 : error.message, error === null || error === void 0 ? void 0 : error.stack);
|
const statusReportBase = await actionsUtil.createStatusReportBase("finish", status, startedAt, error?.message, error?.stack);
|
||||||
const statusReport = {
|
const statusReport = {
|
||||||
...statusReportBase,
|
...statusReportBase,
|
||||||
...(config
|
...(config
|
||||||
@@ -140,8 +142,7 @@ async function run() {
|
|||||||
let trapCacheUploadTime = undefined;
|
let trapCacheUploadTime = undefined;
|
||||||
let dbCreationTimings = undefined;
|
let dbCreationTimings = undefined;
|
||||||
let didUploadTrapCaches = false;
|
let didUploadTrapCaches = false;
|
||||||
util.initializeEnvironment(pkg.version);
|
util.initializeEnvironment(actionsUtil.getActionVersion());
|
||||||
await util.checkActionVersion(pkg.version);
|
|
||||||
const logger = (0, logging_1.getActionsLogger)();
|
const logger = (0, logging_1.getActionsLogger)();
|
||||||
try {
|
try {
|
||||||
if (!(await actionsUtil.sendStatusReport(await actionsUtil.createStatusReportBase("finish", "starting", startedAt)))) {
|
if (!(await actionsUtil.sendStatusReport(await actionsUtil.createStatusReportBase("finish", "starting", startedAt)))) {
|
||||||
@@ -176,7 +177,7 @@ async function run() {
|
|||||||
}
|
}
|
||||||
core.setOutput("db-locations", dbLocations);
|
core.setOutput("db-locations", dbLocations);
|
||||||
if (runStats && actionsUtil.getRequiredInput("upload") === "true") {
|
if (runStats && actionsUtil.getRequiredInput("upload") === "true") {
|
||||||
uploadResult = await upload_lib.uploadFromActions(outputDir, logger);
|
uploadResult = await upload_lib.uploadFromActions(outputDir, actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger);
|
||||||
core.setOutput("sarif-id", uploadResult.sarifID);
|
core.setOutput("sarif-id", uploadResult.sarifID);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -201,6 +202,7 @@ async function run() {
|
|||||||
if (actionsUtil.getOptionalInput("expect-error") === "true") {
|
if (actionsUtil.getOptionalInput("expect-error") === "true") {
|
||||||
core.setFailed(`expect-error input was set to true but no error was thrown.`);
|
core.setFailed(`expect-error input was set to true but no error was thrown.`);
|
||||||
}
|
}
|
||||||
|
core.exportVariable(shared_environment_1.CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY, "true");
|
||||||
}
|
}
|
||||||
catch (origError) {
|
catch (origError) {
|
||||||
const error = origError instanceof Error ? origError : new Error(String(origError));
|
const error = origError instanceof Error ? origError : new Error(String(origError));
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
78
lib/analyze.js
generated
78
lib/analyze.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -25,7 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
exports.validateQueryFilters = exports.runCleanup = exports.runFinalize = exports.createQuerySuiteContents = exports.convertPackToQuerySuiteEntry = exports.runQueries = exports.dbIsFinalized = exports.createdDBForScannedLanguages = exports.CodeQLAnalysisError = void 0;
|
exports.validateQueryFilters = exports.runCleanup = exports.runFinalize = exports.createQuerySuiteContents = exports.convertPackToQuerySuiteEntry = exports.runQueries = exports.dbIsFinalized = exports.createdDBForScannedLanguages = exports.CodeQLAnalysisError = void 0;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
const perf_hooks_1 = require("perf_hooks"); // We need to import `performance` on Node 12
|
const perf_hooks_1 = require("perf_hooks");
|
||||||
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
||||||
const del_1 = __importDefault(require("del"));
|
const del_1 = __importDefault(require("del"));
|
||||||
const yaml = __importStar(require("js-yaml"));
|
const yaml = __importStar(require("js-yaml"));
|
||||||
@@ -50,6 +54,7 @@ async function setupPythonExtractor(logger) {
|
|||||||
// If CODEQL_PYTHON is not set, no dependencies were installed, so we don't need to do anything
|
// If CODEQL_PYTHON is not set, no dependencies were installed, so we don't need to do anything
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const scriptsFolder = path.resolve(__dirname, "../python-setup");
|
||||||
let output = "";
|
let output = "";
|
||||||
const options = {
|
const options = {
|
||||||
listeners: {
|
listeners: {
|
||||||
@@ -58,10 +63,7 @@ async function setupPythonExtractor(logger) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
await new toolrunner.ToolRunner(codeqlPython, [
|
await new toolrunner.ToolRunner(codeqlPython, [path.join(scriptsFolder, "find_site_packages.py")], options).exec();
|
||||||
"-c",
|
|
||||||
"import os; import pip; print(os.path.dirname(os.path.dirname(pip.__file__)))",
|
|
||||||
], options).exec();
|
|
||||||
logger.info(`Setting LGTM_INDEX_IMPORT_PATH=${output}`);
|
logger.info(`Setting LGTM_INDEX_IMPORT_PATH=${output}`);
|
||||||
process.env["LGTM_INDEX_IMPORT_PATH"] = output;
|
process.env["LGTM_INDEX_IMPORT_PATH"] = output;
|
||||||
output = "";
|
output = "";
|
||||||
@@ -121,22 +123,17 @@ async function finalizeDatabaseCreation(config, threadsFlag, memoryFlag, logger)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
// Runs queries and creates sarif files in the given folder
|
// Runs queries and creates sarif files in the given folder
|
||||||
async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag, automationDetailsId, config, logger, featureEnablement) {
|
async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag, automationDetailsId, config, logger, features) {
|
||||||
const statusReport = {};
|
const statusReport = {};
|
||||||
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
|
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
|
||||||
await util.logCodeScanningConfigInCli(codeql, featureEnablement, logger);
|
const queryFlags = [memoryFlag, threadsFlag];
|
||||||
|
await util.logCodeScanningConfigInCli(codeql, features, logger);
|
||||||
for (const language of config.languages) {
|
for (const language of config.languages) {
|
||||||
const queries = config.queries[language];
|
const queries = config.queries[language];
|
||||||
const queryFilters = validateQueryFilters(config.originalUserInput["query-filters"]);
|
const queryFilters = validateQueryFilters(config.originalUserInput["query-filters"]);
|
||||||
const packsWithVersion = config.packs[language] || [];
|
const packsWithVersion = config.packs[language] || [];
|
||||||
const hasBuiltinQueries = (queries === null || queries === void 0 ? void 0 : queries.builtin.length) > 0;
|
|
||||||
const hasCustomQueries = (queries === null || queries === void 0 ? void 0 : queries.custom.length) > 0;
|
|
||||||
const hasPackWithCustomQueries = packsWithVersion.length > 0;
|
|
||||||
if (!hasBuiltinQueries && !hasCustomQueries && !hasPackWithCustomQueries) {
|
|
||||||
throw new Error(`Unable to analyze ${language} as no queries were selected for this language`);
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
if (await util.useCodeScanningConfigInCli(codeql, featureEnablement)) {
|
if (await util.useCodeScanningConfigInCli(codeql, features)) {
|
||||||
// If we are using the code scanning config in the CLI,
|
// If we are using the code scanning config in the CLI,
|
||||||
// much of the work needed to generate the query suites
|
// much of the work needed to generate the query suites
|
||||||
// is done in the CLI. We just need to make a single
|
// is done in the CLI. We just need to make a single
|
||||||
@@ -144,7 +141,7 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
|
|||||||
// another to interpret the results.
|
// another to interpret the results.
|
||||||
logger.startGroup(`Running queries for ${language}`);
|
logger.startGroup(`Running queries for ${language}`);
|
||||||
const startTimeBuiltIn = new Date().getTime();
|
const startTimeBuiltIn = new Date().getTime();
|
||||||
await runQueryGroup(language, "all", undefined, undefined);
|
await runQueryGroup(language, "all", undefined, undefined, true);
|
||||||
// TODO should not be using `builtin` here. We should be using `all` instead.
|
// TODO should not be using `builtin` here. We should be using `all` instead.
|
||||||
// The status report does not support `all` yet.
|
// The status report does not support `all` yet.
|
||||||
statusReport[`analyze_builtin_queries_${language}_duration_ms`] =
|
statusReport[`analyze_builtin_queries_${language}_duration_ms`] =
|
||||||
@@ -159,24 +156,38 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
|
|||||||
logger.info(analysisSummary);
|
logger.info(analysisSummary);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// config was generated by the action, so must be interpreted by the action.
|
||||||
|
const hasBuiltinQueries = queries?.builtin.length > 0;
|
||||||
|
const hasCustomQueries = queries?.custom.length > 0;
|
||||||
|
const hasPackWithCustomQueries = packsWithVersion.length > 0;
|
||||||
|
if (!hasBuiltinQueries &&
|
||||||
|
!hasCustomQueries &&
|
||||||
|
!hasPackWithCustomQueries) {
|
||||||
|
throw new Error(`Unable to analyze ${language} as no queries were selected for this language`);
|
||||||
|
}
|
||||||
|
const customQueryIndices = [];
|
||||||
|
for (let i = 0; i < queries.custom.length; ++i) {
|
||||||
|
if (queries.custom[i].queries.length > 0) {
|
||||||
|
customQueryIndices.push(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
logger.startGroup(`Running queries for ${language}`);
|
logger.startGroup(`Running queries for ${language}`);
|
||||||
const querySuitePaths = [];
|
const querySuitePaths = [];
|
||||||
if (queries["builtin"].length > 0) {
|
if (queries.builtin.length > 0) {
|
||||||
const startTimeBuiltIn = new Date().getTime();
|
const startTimeBuiltIn = new Date().getTime();
|
||||||
querySuitePaths.push((await runQueryGroup(language, "builtin", createQuerySuiteContents(queries["builtin"], queryFilters), undefined)));
|
querySuitePaths.push((await runQueryGroup(language, "builtin", createQuerySuiteContents(queries.builtin, queryFilters), undefined, customQueryIndices.length === 0 && packsWithVersion.length === 0)));
|
||||||
statusReport[`analyze_builtin_queries_${language}_duration_ms`] =
|
statusReport[`analyze_builtin_queries_${language}_duration_ms`] =
|
||||||
new Date().getTime() - startTimeBuiltIn;
|
new Date().getTime() - startTimeBuiltIn;
|
||||||
}
|
}
|
||||||
const startTimeCustom = new Date().getTime();
|
const startTimeCustom = new Date().getTime();
|
||||||
let ranCustom = false;
|
let ranCustom = false;
|
||||||
for (let i = 0; i < queries["custom"].length; ++i) {
|
for (const i of customQueryIndices) {
|
||||||
if (queries["custom"][i].queries.length > 0) {
|
querySuitePaths.push((await runQueryGroup(language, `custom-${i}`, createQuerySuiteContents(queries.custom[i].queries, queryFilters), queries.custom[i].searchPath, i === customQueryIndices[customQueryIndices.length - 1] &&
|
||||||
querySuitePaths.push((await runQueryGroup(language, `custom-${i}`, createQuerySuiteContents(queries["custom"][i].queries, queryFilters), queries["custom"][i].searchPath)));
|
packsWithVersion.length === 0)));
|
||||||
ranCustom = true;
|
ranCustom = true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (packsWithVersion.length > 0) {
|
if (packsWithVersion.length > 0) {
|
||||||
querySuitePaths.push(await runQueryPacks(language, "packs", packsWithVersion, queryFilters));
|
querySuitePaths.push(await runQueryPacks(language, "packs", packsWithVersion, queryFilters, true));
|
||||||
ranCustom = true;
|
ranCustom = true;
|
||||||
}
|
}
|
||||||
if (ranCustom) {
|
if (ranCustom) {
|
||||||
@@ -207,13 +218,13 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
|
|||||||
return statusReport;
|
return statusReport;
|
||||||
async function runInterpretResults(language, queries, sarifFile, enableDebugLogging) {
|
async function runInterpretResults(language, queries, sarifFile, enableDebugLogging) {
|
||||||
const databasePath = util.getCodeQLDatabasePath(config, language);
|
const databasePath = util.getCodeQLDatabasePath(config, language);
|
||||||
return await codeql.databaseInterpretResults(databasePath, queries, sarifFile, addSnippetsFlag, threadsFlag, enableDebugLogging ? "-vv" : "-v", automationDetailsId, featureEnablement);
|
return await codeql.databaseInterpretResults(databasePath, queries, sarifFile, addSnippetsFlag, threadsFlag, enableDebugLogging ? "-vv" : "-v", automationDetailsId, config, features);
|
||||||
}
|
}
|
||||||
async function runPrintLinesOfCode(language) {
|
async function runPrintLinesOfCode(language) {
|
||||||
const databasePath = util.getCodeQLDatabasePath(config, language);
|
const databasePath = util.getCodeQLDatabasePath(config, language);
|
||||||
return await codeql.databasePrintBaseline(databasePath);
|
return await codeql.databasePrintBaseline(databasePath);
|
||||||
}
|
}
|
||||||
async function runQueryGroup(language, type, querySuiteContents, searchPath) {
|
async function runQueryGroup(language, type, querySuiteContents, searchPath, optimizeForLastQueryRun) {
|
||||||
const databasePath = util.getCodeQLDatabasePath(config, language);
|
const databasePath = util.getCodeQLDatabasePath(config, language);
|
||||||
// Pass the queries to codeql using a file instead of using the command
|
// Pass the queries to codeql using a file instead of using the command
|
||||||
// line to avoid command line length restrictions, particularly on windows.
|
// line to avoid command line length restrictions, particularly on windows.
|
||||||
@@ -224,11 +235,11 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
|
|||||||
fs.writeFileSync(querySuitePath, querySuiteContents);
|
fs.writeFileSync(querySuitePath, querySuiteContents);
|
||||||
logger.debug(`Query suite file for ${language}-${type}...\n${querySuiteContents}`);
|
logger.debug(`Query suite file for ${language}-${type}...\n${querySuiteContents}`);
|
||||||
}
|
}
|
||||||
await codeql.databaseRunQueries(databasePath, searchPath, querySuitePath, memoryFlag, threadsFlag);
|
await codeql.databaseRunQueries(databasePath, searchPath, querySuitePath, queryFlags, optimizeForLastQueryRun);
|
||||||
logger.debug(`BQRS results produced for ${language} (queries: ${type})"`);
|
logger.debug(`BQRS results produced for ${language} (queries: ${type})"`);
|
||||||
return querySuitePath;
|
return querySuitePath;
|
||||||
}
|
}
|
||||||
async function runQueryPacks(language, type, packs, queryFilters) {
|
async function runQueryPacks(language, type, packs, queryFilters, optimizeForLastQueryRun) {
|
||||||
const databasePath = util.getCodeQLDatabasePath(config, language);
|
const databasePath = util.getCodeQLDatabasePath(config, language);
|
||||||
for (const pack of packs) {
|
for (const pack of packs) {
|
||||||
logger.debug(`Running query pack for ${language}-${type}: ${pack}`);
|
logger.debug(`Running query pack for ${language}-${type}: ${pack}`);
|
||||||
@@ -238,23 +249,22 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
|
|||||||
const querySuitePath = `${databasePath}-queries-${type}.qls`;
|
const querySuitePath = `${databasePath}-queries-${type}.qls`;
|
||||||
fs.writeFileSync(querySuitePath, yaml.dump(querySuite));
|
fs.writeFileSync(querySuitePath, yaml.dump(querySuite));
|
||||||
logger.debug(`BQRS results produced for ${language} (queries: ${type})"`);
|
logger.debug(`BQRS results produced for ${language} (queries: ${type})"`);
|
||||||
await codeql.databaseRunQueries(databasePath, undefined, querySuitePath, memoryFlag, threadsFlag);
|
await codeql.databaseRunQueries(databasePath, undefined, querySuitePath, queryFlags, optimizeForLastQueryRun);
|
||||||
return querySuitePath;
|
return querySuitePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.runQueries = runQueries;
|
exports.runQueries = runQueries;
|
||||||
function convertPackToQuerySuiteEntry(packStr) {
|
function convertPackToQuerySuiteEntry(packStr) {
|
||||||
var _a, _b, _c, _d;
|
|
||||||
const pack = configUtils.parsePacksSpecification(packStr);
|
const pack = configUtils.parsePacksSpecification(packStr);
|
||||||
return {
|
return {
|
||||||
qlpack: !pack.path ? pack.name : undefined,
|
qlpack: !pack.path ? pack.name : undefined,
|
||||||
from: pack.path ? pack.name : undefined,
|
from: pack.path ? pack.name : undefined,
|
||||||
version: pack.version,
|
version: pack.version,
|
||||||
query: ((_a = pack.path) === null || _a === void 0 ? void 0 : _a.endsWith(".ql")) ? pack.path : undefined,
|
query: pack.path?.endsWith(".ql") ? pack.path : undefined,
|
||||||
queries: !((_b = pack.path) === null || _b === void 0 ? void 0 : _b.endsWith(".ql")) && !((_c = pack.path) === null || _c === void 0 ? void 0 : _c.endsWith(".qls"))
|
queries: !pack.path?.endsWith(".ql") && !pack.path?.endsWith(".qls")
|
||||||
? pack.path
|
? pack.path
|
||||||
: undefined,
|
: undefined,
|
||||||
apply: ((_d = pack.path) === null || _d === void 0 ? void 0 : _d.endsWith(".qls")) ? pack.path : undefined,
|
apply: pack.path?.endsWith(".qls") ? pack.path : undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.convertPackToQuerySuiteEntry = convertPackToQuerySuiteEntry;
|
exports.convertPackToQuerySuiteEntry = convertPackToQuerySuiteEntry;
|
||||||
@@ -267,7 +277,7 @@ async function runFinalize(outputDir, threadsFlag, memoryFlag, config, logger) {
|
|||||||
await (0, del_1.default)(outputDir, { force: true });
|
await (0, del_1.default)(outputDir, { force: true });
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
if ((error === null || error === void 0 ? void 0 : error.code) !== "ENOENT") {
|
if (error?.code !== "ENOENT") {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
129
lib/analyze.test.js
generated
129
lib/analyze.test.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -26,8 +30,10 @@ const fs = __importStar(require("fs"));
|
|||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
const ava_1 = __importDefault(require("ava"));
|
const ava_1 = __importDefault(require("ava"));
|
||||||
const yaml = __importStar(require("js-yaml"));
|
const yaml = __importStar(require("js-yaml"));
|
||||||
|
const sinon = __importStar(require("sinon"));
|
||||||
const analyze_1 = require("./analyze");
|
const analyze_1 = require("./analyze");
|
||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
|
const feature_flags_1 = require("./feature-flags");
|
||||||
const languages_1 = require("./languages");
|
const languages_1 = require("./languages");
|
||||||
const logging_1 = require("./logging");
|
const logging_1 = require("./logging");
|
||||||
const testing_utils_1 = require("./testing-utils");
|
const testing_utils_1 = require("./testing-utils");
|
||||||
@@ -184,6 +190,126 @@ const util = __importStar(require("./util"));
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
function mockCodeQL() {
|
||||||
|
return {
|
||||||
|
getVersion: async () => "2.12.2",
|
||||||
|
databaseRunQueries: sinon.spy(),
|
||||||
|
databaseInterpretResults: async () => "",
|
||||||
|
databasePrintBaseline: async () => "",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function createBaseConfig(tmpDir) {
|
||||||
|
return {
|
||||||
|
languages: [],
|
||||||
|
queries: {},
|
||||||
|
pathsIgnore: [],
|
||||||
|
paths: [],
|
||||||
|
originalUserInput: {},
|
||||||
|
tempDir: "tempDir",
|
||||||
|
codeQLCmd: "",
|
||||||
|
gitHubVersion: {
|
||||||
|
type: util.GitHubVariant.DOTCOM,
|
||||||
|
},
|
||||||
|
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
||||||
|
packs: {},
|
||||||
|
debugMode: false,
|
||||||
|
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||||
|
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||||
|
augmentationProperties: {
|
||||||
|
injectedMlQueries: false,
|
||||||
|
packsInputCombines: false,
|
||||||
|
queriesInputCombines: false,
|
||||||
|
},
|
||||||
|
trapCaches: {},
|
||||||
|
trapCacheDownloadTime: 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function createQueryConfig(builtin, custom) {
|
||||||
|
return {
|
||||||
|
builtin,
|
||||||
|
custom: custom.map((c) => ({ searchPath: "/search", queries: [c] })),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
async function runQueriesWithConfig(config, features) {
|
||||||
|
for (const language of config.languages) {
|
||||||
|
fs.mkdirSync(util.getCodeQLDatabasePath(config, language), {
|
||||||
|
recursive: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return (0, analyze_1.runQueries)("sarif-folder", "--memFlag", "--addSnippetsFlag", "--threadsFlag", undefined, config, (0, logging_1.getRunnerLogger)(true), (0, testing_utils_1.createFeatures)(features));
|
||||||
|
}
|
||||||
|
function getDatabaseRunQueriesCalls(mock) {
|
||||||
|
return mock.databaseRunQueries.getCalls();
|
||||||
|
}
|
||||||
|
(0, ava_1.default)("optimizeForLastQueryRun for one language", async (t) => {
|
||||||
|
return await util.withTmpDir(async (tmpDir) => {
|
||||||
|
const codeql = mockCodeQL();
|
||||||
|
(0, codeql_1.setCodeQL)(codeql);
|
||||||
|
const config = createBaseConfig(tmpDir);
|
||||||
|
config.languages = [languages_1.Language.cpp];
|
||||||
|
config.queries.cpp = createQueryConfig(["foo.ql"], []);
|
||||||
|
await runQueriesWithConfig(config, []);
|
||||||
|
t.deepEqual(getDatabaseRunQueriesCalls(codeql).map((c) => c.args[4]), [true]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("optimizeForLastQueryRun for two languages", async (t) => {
|
||||||
|
return await util.withTmpDir(async (tmpDir) => {
|
||||||
|
const codeql = mockCodeQL();
|
||||||
|
(0, codeql_1.setCodeQL)(codeql);
|
||||||
|
const config = createBaseConfig(tmpDir);
|
||||||
|
config.languages = [languages_1.Language.cpp, languages_1.Language.java];
|
||||||
|
config.queries.cpp = createQueryConfig(["foo.ql"], []);
|
||||||
|
config.queries.java = createQueryConfig(["bar.ql"], []);
|
||||||
|
await runQueriesWithConfig(config, []);
|
||||||
|
t.deepEqual(getDatabaseRunQueriesCalls(codeql).map((c) => c.args[4]), [true, true]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("optimizeForLastQueryRun for two languages, with custom queries", async (t) => {
|
||||||
|
return await util.withTmpDir(async (tmpDir) => {
|
||||||
|
const codeql = mockCodeQL();
|
||||||
|
(0, codeql_1.setCodeQL)(codeql);
|
||||||
|
const config = createBaseConfig(tmpDir);
|
||||||
|
config.languages = [languages_1.Language.cpp, languages_1.Language.java];
|
||||||
|
config.queries.cpp = createQueryConfig(["foo.ql"], ["c1.ql", "c2.ql"]);
|
||||||
|
config.queries.java = createQueryConfig(["bar.ql"], ["c3.ql"]);
|
||||||
|
await runQueriesWithConfig(config, []);
|
||||||
|
t.deepEqual(getDatabaseRunQueriesCalls(codeql).map((c) => c.args[4]), [false, false, true, false, true]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("optimizeForLastQueryRun for two languages, with custom queries and packs", async (t) => {
|
||||||
|
return await util.withTmpDir(async (tmpDir) => {
|
||||||
|
const codeql = mockCodeQL();
|
||||||
|
(0, codeql_1.setCodeQL)(codeql);
|
||||||
|
const config = createBaseConfig(tmpDir);
|
||||||
|
config.languages = [languages_1.Language.cpp, languages_1.Language.java];
|
||||||
|
config.queries.cpp = createQueryConfig(["foo.ql"], ["c1.ql", "c2.ql"]);
|
||||||
|
config.queries.java = createQueryConfig(["bar.ql"], ["c3.ql"]);
|
||||||
|
config.packs.cpp = ["a/cpp-pack1@0.1.0"];
|
||||||
|
config.packs.java = ["b/java-pack1@0.2.0", "b/java-pack2@0.3.3"];
|
||||||
|
await runQueriesWithConfig(config, []);
|
||||||
|
t.deepEqual(getDatabaseRunQueriesCalls(codeql).map((c) => c.args[4]), [false, false, false, true, false, false, true]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("optimizeForLastQueryRun for one language, CliConfigFileEnabled", async (t) => {
|
||||||
|
return await util.withTmpDir(async (tmpDir) => {
|
||||||
|
const codeql = mockCodeQL();
|
||||||
|
(0, codeql_1.setCodeQL)(codeql);
|
||||||
|
const config = createBaseConfig(tmpDir);
|
||||||
|
config.languages = [languages_1.Language.cpp];
|
||||||
|
await runQueriesWithConfig(config, [feature_flags_1.Feature.CliConfigFileEnabled]);
|
||||||
|
t.deepEqual(getDatabaseRunQueriesCalls(codeql).map((c) => c.args[4]), [true]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("optimizeForLastQueryRun for two languages, CliConfigFileEnabled", async (t) => {
|
||||||
|
return await util.withTmpDir(async (tmpDir) => {
|
||||||
|
const codeql = mockCodeQL();
|
||||||
|
(0, codeql_1.setCodeQL)(codeql);
|
||||||
|
const config = createBaseConfig(tmpDir);
|
||||||
|
config.languages = [languages_1.Language.cpp, languages_1.Language.java];
|
||||||
|
await runQueriesWithConfig(config, [feature_flags_1.Feature.CliConfigFileEnabled]);
|
||||||
|
t.deepEqual(getDatabaseRunQueriesCalls(codeql).map((c) => c.args[4]), [true, true]);
|
||||||
|
});
|
||||||
|
});
|
||||||
(0, ava_1.default)("validateQueryFilters", (t) => {
|
(0, ava_1.default)("validateQueryFilters", (t) => {
|
||||||
t.notThrows(() => (0, analyze_1.validateQueryFilters)([]));
|
t.notThrows(() => (0, analyze_1.validateQueryFilters)([]));
|
||||||
t.notThrows(() => (0, analyze_1.validateQueryFilters)(undefined));
|
t.notThrows(() => (0, analyze_1.validateQueryFilters)(undefined));
|
||||||
@@ -227,6 +353,7 @@ const util = __importStar(require("./util"));
|
|||||||
return (0, analyze_1.validateQueryFilters)([{ xxx: "foo" }]);
|
return (0, analyze_1.validateQueryFilters)([{ xxx: "foo" }]);
|
||||||
}, { message: /Only "include" or "exclude" filters are allowed/ });
|
}, { message: /Only "include" or "exclude" filters are allowed/ });
|
||||||
t.throws(() => {
|
t.throws(() => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||||
return (0, analyze_1.validateQueryFilters)({ exclude: "foo" });
|
return (0, analyze_1.validateQueryFilters)({ exclude: "foo" });
|
||||||
}, {
|
}, {
|
||||||
message: /Query filters must be an array of "include" or "exclude" entries/,
|
message: /Query filters must be an array of "include" or "exclude" entries/,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
10
lib/api-client.js
generated
10
lib/api-client.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -29,8 +33,6 @@ const console_log_level_1 = __importDefault(require("console-log-level"));
|
|||||||
const actions_util_1 = require("./actions-util");
|
const actions_util_1 = require("./actions-util");
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
// eslint-disable-next-line import/no-commonjs
|
|
||||||
const pkg = require("../package.json");
|
|
||||||
var DisallowedAPIVersionReason;
|
var DisallowedAPIVersionReason;
|
||||||
(function (DisallowedAPIVersionReason) {
|
(function (DisallowedAPIVersionReason) {
|
||||||
DisallowedAPIVersionReason[DisallowedAPIVersionReason["ACTION_TOO_OLD"] = 0] = "ACTION_TOO_OLD";
|
DisallowedAPIVersionReason[DisallowedAPIVersionReason["ACTION_TOO_OLD"] = 0] = "ACTION_TOO_OLD";
|
||||||
@@ -41,7 +43,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {})
|
|||||||
const retryingOctokit = githubUtils.GitHub.plugin(retry.retry);
|
const retryingOctokit = githubUtils.GitHub.plugin(retry.retry);
|
||||||
return new retryingOctokit(githubUtils.getOctokitOptions(auth, {
|
return new retryingOctokit(githubUtils.getOctokitOptions(auth, {
|
||||||
baseUrl: apiDetails.apiURL,
|
baseUrl: apiDetails.apiURL,
|
||||||
userAgent: `CodeQL-Action/${pkg.version}`,
|
userAgent: `CodeQL-Action/${(0, actions_util_1.getActionVersion)()}`,
|
||||||
log: (0, console_log_level_1.default)({ level: "debug" }),
|
log: (0, console_log_level_1.default)({ level: "debug" }),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||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EAAE,IAAA,2BAAe,EAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;KACzC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,SAAgB,aAAa;IAC3B,OAAO;QACL,IAAI,EAAE,IAAA,+BAAgB,EAAC,OAAO,CAAC;QAC/B,GAAG,EAAE,IAAA,0BAAmB,EAAC,mBAAmB,CAAC;QAC7C,MAAM,EAAE,IAAA,0BAAmB,EAAC,gBAAgB,CAAC;KAC9C,CAAC;AACJ,CAAC;AAND,sCAMC;AAED,SAAgB,YAAY;IAC1B,OAAO,0BAA0B,CAAC,aAAa,EAAE,CAAC,CAAC;AACrD,CAAC;AAFD,oCAEC;AAED,SAAgB,4BAA4B,CAC1C,UAAoC;IAEpC,OAAO,0BAA0B,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AACzE,CAAC;AAJD,oEAIC;AAED,IAAI,mBAAmB,GAA8B,SAAS,CAAC;AAE/D;;;;;;GAMG;AACI,KAAK,UAAU,gBAAgB;IACpC,IAAI,mBAAmB,KAAK,SAAS,EAAE;QACrC,mBAAmB,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAC;KACpE;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AALD,4CAKC"}
|
||||||
12
lib/api-client.test.js
generated
12
lib/api-client.test.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -29,8 +33,6 @@ const actionsUtil = __importStar(require("./actions-util"));
|
|||||||
const api_client_1 = require("./api-client");
|
const api_client_1 = require("./api-client");
|
||||||
const testing_utils_1 = require("./testing-utils");
|
const testing_utils_1 = require("./testing-utils");
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
// eslint-disable-next-line import/no-commonjs
|
|
||||||
const pkg = require("../package.json");
|
|
||||||
(0, testing_utils_1.setupTests)(ava_1.default);
|
(0, testing_utils_1.setupTests)(ava_1.default);
|
||||||
let pluginStub;
|
let pluginStub;
|
||||||
let githubStub;
|
let githubStub;
|
||||||
@@ -38,7 +40,7 @@ ava_1.default.beforeEach(() => {
|
|||||||
pluginStub = sinon.stub(githubUtils.GitHub, "plugin");
|
pluginStub = sinon.stub(githubUtils.GitHub, "plugin");
|
||||||
githubStub = sinon.stub();
|
githubStub = sinon.stub();
|
||||||
pluginStub.returns(githubStub);
|
pluginStub.returns(githubStub);
|
||||||
util.initializeEnvironment(pkg.version);
|
util.initializeEnvironment(actionsUtil.getActionVersion());
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("getApiClient", async (t) => {
|
(0, ava_1.default)("getApiClient", async (t) => {
|
||||||
sinon.stub(actionsUtil, "getRequiredInput").withArgs("token").returns("xyz");
|
sinon.stub(actionsUtil, "getRequiredInput").withArgs("token").returns("xyz");
|
||||||
@@ -54,7 +56,7 @@ ava_1.default.beforeEach(() => {
|
|||||||
auth: "token xyz",
|
auth: "token xyz",
|
||||||
baseUrl: "http://api.github.localhost",
|
baseUrl: "http://api.github.localhost",
|
||||||
log: sinon.match.any,
|
log: sinon.match.any,
|
||||||
userAgent: `CodeQL-Action/${pkg.version}`,
|
userAgent: `CodeQL-Action/${actionsUtil.getActionVersion()}`,
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
//# sourceMappingURL=api-client.test.js.map
|
//# sourceMappingURL=api-client.test.js.map
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"api-client.test.js","sourceRoot":"","sources":["../src/api-client.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uEAAyD;AACzD,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,6CAA4C;AAC5C,mDAA6C;AAC7C,6CAA+B;AAE/B,8CAA8C;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEvC,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,IAAI,UAA2B,CAAC;AAChC,IAAI,UAA2B,CAAC;AAEhC,aAAI,CAAC,UAAU,CAAC,GAAG,EAAE;IACnB,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtD,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1B,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/B,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,cAAc,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/B,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7E,MAAM,oBAAoB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;IACrE,oBAAoB;SACjB,QAAQ,CAAC,mBAAmB,CAAC;SAC7B,OAAO,CAAC,yBAAyB,CAAC,CAA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AAC,IAAI,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;IACrE,oBAAoB;SACjB,QAAQ,CAAC,mBAAmB,CAAC;SAC7B,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACtC,oBAAoB;SACjB,QAAQ,CAAC,gBAAgB,CAAC;SAC1B,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAE1C,IAAA,yBAAY,GAAE,CAAC;IAEf,CAAC,CAAC,MAAM,CACN,UAAU,CAAC,qBAAqB,CAAC;QAC/B,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,6BAA6B;QACtC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG;QACpB,SAAS,EAAE,iBAAiB,WAAW,CAAC,gBAAgB,EAAE,EAAE;KAC7D,CAAC,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
||||||
@@ -1 +1 @@
|
|||||||
{ "maximumVersion": "3.8", "minimumVersion": "3.3" }
|
{ "maximumVersion": "3.8", "minimumVersion": "3.4" }
|
||||||
|
|||||||
17
lib/autobuild-action.js
generated
17
lib/autobuild-action.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -27,12 +31,10 @@ const configUtils = __importStar(require("./config-utils"));
|
|||||||
const languages_1 = require("./languages");
|
const languages_1 = require("./languages");
|
||||||
const logging_1 = require("./logging");
|
const logging_1 = require("./logging");
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
// eslint-disable-next-line import/no-commonjs
|
|
||||||
const pkg = require("../package.json");
|
|
||||||
async function sendCompletedStatusReport(startedAt, allLanguages, failingLanguage, cause) {
|
async function sendCompletedStatusReport(startedAt, allLanguages, failingLanguage, cause) {
|
||||||
(0, util_1.initializeEnvironment)(pkg.version);
|
(0, util_1.initializeEnvironment)((0, actions_util_1.getActionVersion)());
|
||||||
const status = (0, actions_util_1.getActionsStatus)(cause, failingLanguage);
|
const status = (0, actions_util_1.getActionsStatus)(cause, failingLanguage);
|
||||||
const statusReportBase = await (0, actions_util_1.createStatusReportBase)("autobuild", status, startedAt, cause === null || cause === void 0 ? void 0 : cause.message, cause === null || cause === void 0 ? void 0 : cause.stack);
|
const statusReportBase = await (0, actions_util_1.createStatusReportBase)("autobuild", status, startedAt, cause?.message, cause?.stack);
|
||||||
const statusReport = {
|
const statusReport = {
|
||||||
...statusReportBase,
|
...statusReportBase,
|
||||||
autobuild_languages: allLanguages.join(","),
|
autobuild_languages: allLanguages.join(","),
|
||||||
@@ -43,7 +45,6 @@ async function sendCompletedStatusReport(startedAt, allLanguages, failingLanguag
|
|||||||
async function run() {
|
async function run() {
|
||||||
const startedAt = new Date();
|
const startedAt = new Date();
|
||||||
const logger = (0, logging_1.getActionsLogger)();
|
const logger = (0, logging_1.getActionsLogger)();
|
||||||
await (0, util_1.checkActionVersion)(pkg.version);
|
|
||||||
let currentLanguage = undefined;
|
let currentLanguage = undefined;
|
||||||
let languages = undefined;
|
let languages = undefined;
|
||||||
try {
|
try {
|
||||||
@@ -75,10 +76,10 @@ async function run() {
|
|||||||
catch (error) {
|
catch (error) {
|
||||||
core.setFailed(`We were unable to automatically build your code. Please replace the call to the autobuild action with your custom build steps. ${error instanceof Error ? error.message : String(error)}`);
|
core.setFailed(`We were unable to automatically build your code. Please replace the call to the autobuild action with your custom build steps. ${error instanceof Error ? error.message : String(error)}`);
|
||||||
console.log(error);
|
console.log(error);
|
||||||
await sendCompletedStatusReport(startedAt, languages !== null && languages !== void 0 ? languages : [], currentLanguage, error instanceof Error ? error : new Error(String(error)));
|
await sendCompletedStatusReport(startedAt, languages ?? [], currentLanguage, error instanceof Error ? error : new Error(String(error)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await sendCompletedStatusReport(startedAt, languages !== null && languages !== void 0 ? languages : []);
|
await sendCompletedStatusReport(startedAt, languages ?? []);
|
||||||
}
|
}
|
||||||
async function runWrapper() {
|
async function runWrapper() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"autobuild-action.js","sourceRoot":"","sources":["../src/autobuild-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAOwB;AACxB,6CAAgD;AAChD,2CAAwE;AACxE,4DAA8C;AAC9C,2CAAuC;AACvC,uCAA6C;AAC7C,iCAKgB;AAEhB,8CAA8C;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AASvC,KAAK,UAAU,yBAAyB,CACtC,SAAe,EACf,YAAsB,EACtB,eAAwB,EACxB,KAAa;IAEb,IAAA,4BAAqB,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnC,MAAM,MAAM,GAAG,IAAA,+BAAgB,EAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,MAAM,IAAA,qCAAsB,EACnD,WAAW,EACX,MAAM,EACN,SAAS,EACT,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,EACd,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CACb,CAAC;IACF,MAAM,YAAY,G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;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,4BAA4B,KAAK,EAAE,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||||
328
lib/codeql.js
generated
328
lib/codeql.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -18,30 +22,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getExtraOptions = exports.getCodeQLForTesting = exports.getCachedCodeQL = exports.setCodeQL = exports.getCodeQL = exports.convertToSemVer = exports.getCodeQLURLVersion = exports.setupCodeQL = exports.getCodeQLActionRepository = exports.CODEQL_VERSION_BETTER_RESOLVE_LANGUAGES = exports.CODEQL_VERSION_ML_POWERED_QUERIES_WINDOWS = exports.CODEQL_VERSION_TRACING_GLIBC_2_34 = exports.CODEQL_VERSION_NEW_TRACING = exports.CODEQL_VERSION_GHES_PACK_DOWNLOAD = exports.CODEQL_VERSION_CONFIG_FILES = exports.CODEQL_DEFAULT_ACTION_REPOSITORY = exports.CommandInvocationError = void 0;
|
exports.getExtraOptions = exports.getCodeQLForCmd = exports.getCodeQLForTesting = exports.getCachedCodeQL = exports.setCodeQL = exports.getCodeQL = exports.setupCodeQL = exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = exports.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = exports.CODEQL_VERSION_BETTER_RESOLVE_LANGUAGES = exports.CODEQL_VERSION_ML_POWERED_QUERIES_WINDOWS = exports.CODEQL_VERSION_TRACING_GLIBC_2_34 = exports.CODEQL_VERSION_NEW_TRACING = exports.CODEQL_VERSION_GHES_PACK_DOWNLOAD = exports.CommandInvocationError = void 0;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
||||||
const toolcache = __importStar(require("@actions/tool-cache"));
|
|
||||||
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
||||||
const yaml = __importStar(require("js-yaml"));
|
const yaml = __importStar(require("js-yaml"));
|
||||||
const query_string_1 = __importDefault(require("query-string"));
|
|
||||||
const semver = __importStar(require("semver"));
|
|
||||||
const uuid_1 = require("uuid");
|
|
||||||
const actions_util_1 = require("./actions-util");
|
const actions_util_1 = require("./actions-util");
|
||||||
const api = __importStar(require("./api-client"));
|
const config_utils_1 = require("./config-utils");
|
||||||
const defaults = __importStar(require("./defaults.json")); // Referenced from codeql-action-sync-tool!
|
|
||||||
const error_matcher_1 = require("./error-matcher");
|
const error_matcher_1 = require("./error-matcher");
|
||||||
const feature_flags_1 = require("./feature-flags");
|
const feature_flags_1 = require("./feature-flags");
|
||||||
const languages_1 = require("./languages");
|
const languages_1 = require("./languages");
|
||||||
|
const setupCodeql = __importStar(require("./setup-codeql"));
|
||||||
const toolrunner_error_catcher_1 = require("./toolrunner-error-catcher");
|
const toolrunner_error_catcher_1 = require("./toolrunner-error-catcher");
|
||||||
const trap_caching_1 = require("./trap-caching");
|
const trap_caching_1 = require("./trap-caching");
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
const util_1 = require("./util");
|
|
||||||
class CommandInvocationError extends Error {
|
class CommandInvocationError extends Error {
|
||||||
constructor(cmd, args, exitCode, error, output) {
|
constructor(cmd, args, exitCode, error, output) {
|
||||||
super(`Failure invoking ${cmd} with arguments ${args}.\n
|
super(`Failure invoking ${cmd} with arguments ${args}.\n
|
||||||
@@ -56,8 +51,6 @@ exports.CommandInvocationError = CommandInvocationError;
|
|||||||
* Can be overridden in tests using `setCodeQL`.
|
* Can be overridden in tests using `setCodeQL`.
|
||||||
*/
|
*/
|
||||||
let cachedCodeQL = undefined;
|
let cachedCodeQL = undefined;
|
||||||
const CODEQL_BUNDLE_VERSION = defaults.bundleVersion;
|
|
||||||
exports.CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action";
|
|
||||||
/**
|
/**
|
||||||
* The oldest version of CodeQL that the Action will run with. This should be
|
* The oldest version of CodeQL that the Action will run with. This should be
|
||||||
* at least three minor versions behind the current version and must include the
|
* at least three minor versions behind the current version and must include the
|
||||||
@@ -74,9 +67,9 @@ const CODEQL_MINIMUM_VERSION = "2.6.3";
|
|||||||
*/
|
*/
|
||||||
const CODEQL_VERSION_CUSTOM_QUERY_HELP = "2.7.1";
|
const CODEQL_VERSION_CUSTOM_QUERY_HELP = "2.7.1";
|
||||||
const CODEQL_VERSION_LUA_TRACER_CONFIG = "2.10.0";
|
const CODEQL_VERSION_LUA_TRACER_CONFIG = "2.10.0";
|
||||||
exports.CODEQL_VERSION_CONFIG_FILES = "2.10.1";
|
|
||||||
const CODEQL_VERSION_LUA_TRACING_GO_WINDOWS_FIXED = "2.10.4";
|
const CODEQL_VERSION_LUA_TRACING_GO_WINDOWS_FIXED = "2.10.4";
|
||||||
exports.CODEQL_VERSION_GHES_PACK_DOWNLOAD = "2.10.4";
|
exports.CODEQL_VERSION_GHES_PACK_DOWNLOAD = "2.10.4";
|
||||||
|
const CODEQL_VERSION_FILE_BASELINE_INFORMATION = "2.11.3";
|
||||||
/**
|
/**
|
||||||
* This variable controls using the new style of tracing from the CodeQL
|
* This variable controls using the new style of tracing from the CodeQL
|
||||||
* CLI. In particular, with versions above this we will use both indirect
|
* CLI. In particular, with versions above this we will use both indirect
|
||||||
@@ -103,190 +96,30 @@ exports.CODEQL_VERSION_ML_POWERED_QUERIES_WINDOWS = "2.9.0";
|
|||||||
* --extractor-options-verbosity that we need.
|
* --extractor-options-verbosity that we need.
|
||||||
*/
|
*/
|
||||||
exports.CODEQL_VERSION_BETTER_RESOLVE_LANGUAGES = "2.10.3";
|
exports.CODEQL_VERSION_BETTER_RESOLVE_LANGUAGES = "2.10.3";
|
||||||
function getCodeQLBundleName() {
|
/**
|
||||||
let platform;
|
* Versions 2.11.1+ of the CodeQL Bundle include a `security-experimental` built-in query suite for each language.
|
||||||
if (process.platform === "win32") {
|
*/
|
||||||
platform = "win64";
|
exports.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = "2.12.1";
|
||||||
}
|
/**
|
||||||
else if (process.platform === "linux") {
|
* Versions 2.12.4+ of the CodeQL CLI support the `--qlconfig-file` flag in calls to `database init`.
|
||||||
platform = "linux64";
|
*/
|
||||||
}
|
exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = "2.12.4";
|
||||||
else if (process.platform === "darwin") {
|
|
||||||
platform = "osx64";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return "codeql-bundle.tar.gz";
|
|
||||||
}
|
|
||||||
return `codeql-bundle-${platform}.tar.gz`;
|
|
||||||
}
|
|
||||||
function getCodeQLActionRepository(logger) {
|
|
||||||
if ((0, actions_util_1.isRunningLocalAction)()) {
|
|
||||||
// This handles the case where the Action does not come from an Action repository,
|
|
||||||
// e.g. our integration tests which use the Action code from the current checkout.
|
|
||||||
// In these cases, the GITHUB_ACTION_REPOSITORY environment variable is not set.
|
|
||||||
logger.info("The CodeQL Action is checked out locally. Using the default CodeQL Action repository.");
|
|
||||||
return exports.CODEQL_DEFAULT_ACTION_REPOSITORY;
|
|
||||||
}
|
|
||||||
return util.getRequiredEnvParam("GITHUB_ACTION_REPOSITORY");
|
|
||||||
}
|
|
||||||
exports.getCodeQLActionRepository = getCodeQLActionRepository;
|
|
||||||
async function getCodeQLBundleDownloadURL(apiDetails, variant, logger) {
|
|
||||||
const codeQLActionRepository = getCodeQLActionRepository(logger);
|
|
||||||
const potentialDownloadSources = [
|
|
||||||
// This GitHub instance, and this Action.
|
|
||||||
[apiDetails.url, codeQLActionRepository],
|
|
||||||
// This GitHub instance, and the canonical Action.
|
|
||||||
[apiDetails.url, exports.CODEQL_DEFAULT_ACTION_REPOSITORY],
|
|
||||||
// GitHub.com, and the canonical Action.
|
|
||||||
[util.GITHUB_DOTCOM_URL, exports.CODEQL_DEFAULT_ACTION_REPOSITORY],
|
|
||||||
];
|
|
||||||
// We now filter out any duplicates.
|
|
||||||
// Duplicates will happen either because the GitHub instance is GitHub.com, or because the Action is not a fork.
|
|
||||||
const uniqueDownloadSources = potentialDownloadSources.filter((source, index, self) => {
|
|
||||||
return !self.slice(0, index).some((other) => (0, fast_deep_equal_1.default)(source, other));
|
|
||||||
});
|
|
||||||
const codeQLBundleName = getCodeQLBundleName();
|
|
||||||
if (variant === util.GitHubVariant.GHAE) {
|
|
||||||
try {
|
|
||||||
const release = await api
|
|
||||||
.getApiClient()
|
|
||||||
.request("GET /enterprise/code-scanning/codeql-bundle/find/{tag}", {
|
|
||||||
tag: CODEQL_BUNDLE_VERSION,
|
|
||||||
});
|
|
||||||
const assetID = release.data.assets[codeQLBundleName];
|
|
||||||
if (assetID !== undefined) {
|
|
||||||
const download = await api
|
|
||||||
.getApiClient()
|
|
||||||
.request("GET /enterprise/code-scanning/codeql-bundle/download/{asset_id}", { asset_id: assetID });
|
|
||||||
const downloadURL = download.data.url;
|
|
||||||
logger.info(`Found CodeQL bundle at GitHub AE endpoint with URL ${downloadURL}.`);
|
|
||||||
return downloadURL;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
logger.info(`Attempted to fetch bundle from GitHub AE endpoint but the bundle ${codeQLBundleName} was not found in the assets ${JSON.stringify(release.data.assets)}.`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
logger.info(`Attempted to fetch bundle from GitHub AE endpoint but got error ${e}.`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (const downloadSource of uniqueDownloadSources) {
|
|
||||||
const [apiURL, repository] = downloadSource;
|
|
||||||
// If we've reached the final case, short-circuit the API check since we know the bundle exists and is public.
|
|
||||||
if (apiURL === util.GITHUB_DOTCOM_URL &&
|
|
||||||
repository === exports.CODEQL_DEFAULT_ACTION_REPOSITORY) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
const [repositoryOwner, repositoryName] = repository.split("/");
|
|
||||||
try {
|
|
||||||
const release = await api.getApiClient().repos.getReleaseByTag({
|
|
||||||
owner: repositoryOwner,
|
|
||||||
repo: repositoryName,
|
|
||||||
tag: CODEQL_BUNDLE_VERSION,
|
|
||||||
});
|
|
||||||
for (const asset of release.data.assets) {
|
|
||||||
if (asset.name === codeQLBundleName) {
|
|
||||||
logger.info(`Found CodeQL bundle in ${downloadSource[1]} on ${downloadSource[0]} with URL ${asset.url}.`);
|
|
||||||
return asset.url;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
logger.info(`Looked for CodeQL bundle in ${downloadSource[1]} on ${downloadSource[0]} but got error ${e}.`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return `https://github.com/${exports.CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${CODEQL_BUNDLE_VERSION}/${codeQLBundleName}`;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Set up CodeQL CLI access.
|
* Set up CodeQL CLI access.
|
||||||
*
|
*
|
||||||
* @param codeqlURL
|
* @param toolsInput
|
||||||
* @param apiDetails
|
* @param apiDetails
|
||||||
* @param tempDir
|
* @param tempDir
|
||||||
* @param variant
|
* @param variant
|
||||||
* @param features
|
* @param defaultCliVersion
|
||||||
* @param logger
|
* @param logger
|
||||||
* @param checkVersion Whether to check that CodeQL CLI meets the minimum
|
* @param checkVersion Whether to check that CodeQL CLI meets the minimum
|
||||||
* version requirement. Must be set to true outside tests.
|
* version requirement. Must be set to true outside tests.
|
||||||
* @returns a { CodeQL, toolsVersion } object.
|
* @returns a { CodeQL, toolsVersion } object.
|
||||||
*/
|
*/
|
||||||
async function setupCodeQL(codeqlURL, apiDetails, tempDir, variant, bypassToolcache, logger, checkVersion) {
|
async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger, checkVersion) {
|
||||||
try {
|
try {
|
||||||
const forceLatestReason =
|
const { codeqlFolder, toolsDownloadDurationMs, toolsSource, toolsVersion } = await setupCodeql.setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger);
|
||||||
// We use the special value of 'latest' to prioritize the version in the
|
|
||||||
// defaults over any pinned cached version.
|
|
||||||
codeqlURL === "latest"
|
|
||||||
? '"tools: latest" was requested'
|
|
||||||
: // If the user hasn't requested a particular CodeQL version, then bypass
|
|
||||||
// the toolcache when the appropriate feature is enabled. This
|
|
||||||
// allows us to quickly rollback a broken bundle that has made its way
|
|
||||||
// into the toolcache.
|
|
||||||
codeqlURL === undefined && bypassToolcache
|
|
||||||
? "a specific version of CodeQL was not requested and the bypass toolcache feature is enabled"
|
|
||||||
: undefined;
|
|
||||||
const forceLatest = forceLatestReason !== undefined;
|
|
||||||
if (forceLatest) {
|
|
||||||
logger.debug(`Forcing the latest version of the CodeQL tools since ${forceLatestReason}.`);
|
|
||||||
codeqlURL = undefined;
|
|
||||||
}
|
|
||||||
let codeqlFolder;
|
|
||||||
let codeqlURLVersion;
|
|
||||||
if (codeqlURL && !codeqlURL.startsWith("http")) {
|
|
||||||
codeqlFolder = await toolcache.extractTar(codeqlURL);
|
|
||||||
codeqlURLVersion = "local";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
codeqlURLVersion = getCodeQLURLVersion(codeqlURL || `/${CODEQL_BUNDLE_VERSION}/`);
|
|
||||||
const codeqlURLSemVer = convertToSemVer(codeqlURLVersion, logger);
|
|
||||||
// If we find the specified version, we always use that.
|
|
||||||
codeqlFolder = toolcache.find("CodeQL", codeqlURLSemVer);
|
|
||||||
// If we don't find the requested version, in some cases we may allow a
|
|
||||||
// different version to save download time if the version hasn't been
|
|
||||||
// specified explicitly (in which case we always honor it).
|
|
||||||
if (!codeqlFolder && !codeqlURL && !forceLatest) {
|
|
||||||
const codeqlVersions = toolcache.findAllVersions("CodeQL");
|
|
||||||
if (codeqlVersions.length === 1 && (0, util_1.isGoodVersion)(codeqlVersions[0])) {
|
|
||||||
const tmpCodeqlFolder = toolcache.find("CodeQL", codeqlVersions[0]);
|
|
||||||
if (fs.existsSync(path.join(tmpCodeqlFolder, "pinned-version"))) {
|
|
||||||
logger.debug(`CodeQL in cache overriding the default ${CODEQL_BUNDLE_VERSION}`);
|
|
||||||
codeqlFolder = tmpCodeqlFolder;
|
|
||||||
codeqlURLVersion = codeqlVersions[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (codeqlFolder) {
|
|
||||||
logger.debug(`CodeQL found in cache ${codeqlFolder}`);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (!codeqlURL) {
|
|
||||||
codeqlURL = await getCodeQLBundleDownloadURL(apiDetails, variant, logger);
|
|
||||||
}
|
|
||||||
const parsedCodeQLURL = new URL(codeqlURL);
|
|
||||||
const parsedQueryString = query_string_1.default.parse(parsedCodeQLURL.search);
|
|
||||||
const headers = {
|
|
||||||
accept: "application/octet-stream",
|
|
||||||
};
|
|
||||||
// We only want to provide an authorization header if we are downloading
|
|
||||||
// from the same GitHub instance the Action is running on.
|
|
||||||
// This avoids leaking Enterprise tokens to dotcom.
|
|
||||||
// We also don't want to send an authorization header if there's already a token provided in the URL.
|
|
||||||
if (codeqlURL.startsWith(`${apiDetails.url}/`) &&
|
|
||||||
parsedQueryString["token"] === undefined) {
|
|
||||||
logger.debug("Downloading CodeQL bundle with token.");
|
|
||||||
headers.authorization = `token ${apiDetails.auth}`;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
logger.debug("Downloading CodeQL bundle without token.");
|
|
||||||
}
|
|
||||||
logger.info(`Downloading CodeQL tools from ${codeqlURL}. This may take a while.`);
|
|
||||||
const dest = path.join(tempDir, (0, uuid_1.v4)());
|
|
||||||
const finalHeaders = Object.assign({ "User-Agent": "CodeQL Action" }, headers);
|
|
||||||
const codeqlPath = await toolcache.downloadTool(codeqlURL, dest, undefined, finalHeaders);
|
|
||||||
logger.debug(`CodeQL bundle download to ${codeqlPath} complete.`);
|
|
||||||
const codeqlExtracted = await toolcache.extractTar(codeqlPath);
|
|
||||||
codeqlFolder = await toolcache.cacheDir(codeqlExtracted, "CodeQL", codeqlURLSemVer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let codeqlCmd = path.join(codeqlFolder, "codeql", "codeql");
|
let codeqlCmd = path.join(codeqlFolder, "codeql", "codeql");
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
codeqlCmd += ".exe";
|
codeqlCmd += ".exe";
|
||||||
@@ -295,7 +128,12 @@ async function setupCodeQL(codeqlURL, apiDetails, tempDir, variant, bypassToolca
|
|||||||
throw new Error(`Unsupported platform: ${process.platform}`);
|
throw new Error(`Unsupported platform: ${process.platform}`);
|
||||||
}
|
}
|
||||||
cachedCodeQL = await getCodeQLForCmd(codeqlCmd, checkVersion);
|
cachedCodeQL = await getCodeQLForCmd(codeqlCmd, checkVersion);
|
||||||
return { codeql: cachedCodeQL, toolsVersion: codeqlURLVersion };
|
return {
|
||||||
|
codeql: cachedCodeQL,
|
||||||
|
toolsDownloadDurationMs,
|
||||||
|
toolsSource,
|
||||||
|
toolsVersion,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
logger.error(e instanceof Error ? e : new Error(String(e)));
|
logger.error(e instanceof Error ? e : new Error(String(e)));
|
||||||
@@ -303,26 +141,6 @@ async function setupCodeQL(codeqlURL, apiDetails, tempDir, variant, bypassToolca
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.setupCodeQL = setupCodeQL;
|
exports.setupCodeQL = setupCodeQL;
|
||||||
function getCodeQLURLVersion(url) {
|
|
||||||
const match = url.match(/\/codeql-bundle-(.*)\//);
|
|
||||||
if (match === null || match.length < 2) {
|
|
||||||
throw new Error(`Malformed tools url: ${url}. Version could not be inferred`);
|
|
||||||
}
|
|
||||||
return match[1];
|
|
||||||
}
|
|
||||||
exports.getCodeQLURLVersion = getCodeQLURLVersion;
|
|
||||||
function convertToSemVer(version, logger) {
|
|
||||||
if (!semver.valid(version)) {
|
|
||||||
logger.debug(`Bundle version ${version} is not in SemVer format. Will treat it as pre-release 0.0.0-${version}.`);
|
|
||||||
version = `0.0.0-${version}`;
|
|
||||||
}
|
|
||||||
const s = semver.clean(version);
|
|
||||||
if (!s) {
|
|
||||||
throw new Error(`Bundle version ${version} is not in SemVer format.`);
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
exports.convertToSemVer = convertToSemVer;
|
|
||||||
/**
|
/**
|
||||||
* Use the CodeQL executable located at the given path.
|
* Use the CodeQL executable located at the given path.
|
||||||
*/
|
*/
|
||||||
@@ -371,6 +189,7 @@ function setCodeQL(partialCodeql) {
|
|||||||
databaseRunQueries: resolveFunction(partialCodeql, "databaseRunQueries"),
|
databaseRunQueries: resolveFunction(partialCodeql, "databaseRunQueries"),
|
||||||
databaseInterpretResults: resolveFunction(partialCodeql, "databaseInterpretResults"),
|
databaseInterpretResults: resolveFunction(partialCodeql, "databaseInterpretResults"),
|
||||||
databasePrintBaseline: resolveFunction(partialCodeql, "databasePrintBaseline"),
|
databasePrintBaseline: resolveFunction(partialCodeql, "databasePrintBaseline"),
|
||||||
|
diagnosticsExport: resolveFunction(partialCodeql, "diagnosticsExport"),
|
||||||
};
|
};
|
||||||
return cachedCodeQL;
|
return cachedCodeQL;
|
||||||
}
|
}
|
||||||
@@ -489,7 +308,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
...getExtraOptionsFromEnv(["database", "init"]),
|
...getExtraOptionsFromEnv(["database", "init"]),
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
async databaseInitCluster(config, sourceRoot, processName, featureEnablement) {
|
async databaseInitCluster(config, sourceRoot, processName, features, qlconfigFile, logger) {
|
||||||
const extraArgs = config.languages.map((language) => `--language=${language}`);
|
const extraArgs = config.languages.map((language) => `--language=${language}`);
|
||||||
if (config.languages.filter((l) => (0, languages_1.isTracedLanguage)(l)).length > 0) {
|
if (config.languages.filter((l) => (0, languages_1.isTracedLanguage)(l)).length > 0) {
|
||||||
extraArgs.push("--begin-tracing");
|
extraArgs.push("--begin-tracing");
|
||||||
@@ -507,9 +326,20 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
extraArgs.push("--no-internal-use-lua-tracing");
|
extraArgs.push("--no-internal-use-lua-tracing");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const configLocation = await generateCodeScanningConfig(codeql, config, featureEnablement);
|
// A code scanning config file is only generated if the CliConfigFileEnabled feature flag is enabled.
|
||||||
if (configLocation) {
|
const codeScanningConfigFile = await generateCodeScanningConfig(codeql, config, features, logger);
|
||||||
extraArgs.push(`--codescanning-config=${configLocation}`);
|
// Only pass external repository token if a config file is going to be parsed by the CLI.
|
||||||
|
let externalRepositoryToken;
|
||||||
|
if (codeScanningConfigFile) {
|
||||||
|
externalRepositoryToken = (0, actions_util_1.getOptionalInput)("external-repository-token");
|
||||||
|
extraArgs.push(`--codescanning-config=${codeScanningConfigFile}`);
|
||||||
|
if (externalRepositoryToken) {
|
||||||
|
extraArgs.push("--external-repository-token-stdin");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (qlconfigFile !== undefined &&
|
||||||
|
(await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_INIT_WITH_QLCONFIG))) {
|
||||||
|
extraArgs.push(`--qlconfig-file=${qlconfigFile}`);
|
||||||
}
|
}
|
||||||
await runTool(cmd, [
|
await runTool(cmd, [
|
||||||
"database",
|
"database",
|
||||||
@@ -519,7 +349,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
`--source-root=${sourceRoot}`,
|
`--source-root=${sourceRoot}`,
|
||||||
...extraArgs,
|
...extraArgs,
|
||||||
...getExtraOptionsFromEnv(["database", "init"]),
|
...getExtraOptionsFromEnv(["database", "init"]),
|
||||||
]);
|
], { stdin: externalRepositoryToken });
|
||||||
},
|
},
|
||||||
async runAutobuild(language) {
|
async runAutobuild(language) {
|
||||||
const cmdName = process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh";
|
const cmdName = process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh";
|
||||||
@@ -555,6 +385,9 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
async extractScannedLanguage(config, language) {
|
async extractScannedLanguage(config, language) {
|
||||||
const databasePath = util.getCodeQLDatabasePath(config, language);
|
const databasePath = util.getCodeQLDatabasePath(config, language);
|
||||||
// Get extractor location
|
// Get extractor location
|
||||||
|
//
|
||||||
|
// Request it using `format=json` so we don't need to strip the trailing new line generated by
|
||||||
|
// the CLI.
|
||||||
let extractorPath = "";
|
let extractorPath = "";
|
||||||
await new toolrunner.ToolRunner(cmd, [
|
await new toolrunner.ToolRunner(cmd, [
|
||||||
"resolve",
|
"resolve",
|
||||||
@@ -649,17 +482,20 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
throw new Error(`Unexpected output from codeql resolve queries: ${e}`);
|
throw new Error(`Unexpected output from codeql resolve queries: ${e}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async databaseRunQueries(databasePath, extraSearchPath, querySuitePath, memoryFlag, threadsFlag) {
|
async databaseRunQueries(databasePath, extraSearchPath, querySuitePath, flags, optimizeForLastQueryRun) {
|
||||||
const codeqlArgs = [
|
const codeqlArgs = [
|
||||||
"database",
|
"database",
|
||||||
"run-queries",
|
"run-queries",
|
||||||
memoryFlag,
|
...flags,
|
||||||
threadsFlag,
|
|
||||||
databasePath,
|
databasePath,
|
||||||
"--min-disk-free=1024",
|
"--min-disk-free=1024",
|
||||||
"-v",
|
"-v",
|
||||||
...getExtraOptionsFromEnv(["database", "run-queries"]),
|
...getExtraOptionsFromEnv(["database", "run-queries"]),
|
||||||
];
|
];
|
||||||
|
if (optimizeForLastQueryRun &&
|
||||||
|
(await util.supportExpectDiscardedCache(this))) {
|
||||||
|
codeqlArgs.push("--expect-discarded-cache");
|
||||||
|
}
|
||||||
if (extraSearchPath !== undefined) {
|
if (extraSearchPath !== undefined) {
|
||||||
codeqlArgs.push("--additional-packs", extraSearchPath);
|
codeqlArgs.push("--additional-packs", extraSearchPath);
|
||||||
}
|
}
|
||||||
@@ -668,7 +504,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
}
|
}
|
||||||
await (0, toolrunner_error_catcher_1.toolrunnerErrorCatcher)(cmd, codeqlArgs, error_matcher_1.errorMatchers);
|
await (0, toolrunner_error_catcher_1.toolrunnerErrorCatcher)(cmd, codeqlArgs, error_matcher_1.errorMatchers);
|
||||||
},
|
},
|
||||||
async databaseInterpretResults(databasePath, querySuitePaths, sarifFile, addSnippetsFlag, threadsFlag, verbosityFlag, automationDetailsId, featureEnablement) {
|
async databaseInterpretResults(databasePath, querySuitePaths, sarifFile, addSnippetsFlag, threadsFlag, verbosityFlag, automationDetailsId, config, features) {
|
||||||
const codeqlArgs = [
|
const codeqlArgs = [
|
||||||
"database",
|
"database",
|
||||||
"interpret-results",
|
"interpret-results",
|
||||||
@@ -680,6 +516,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
"--print-diagnostics-summary",
|
"--print-diagnostics-summary",
|
||||||
"--print-metrics-summary",
|
"--print-metrics-summary",
|
||||||
"--sarif-group-rules-by-pack",
|
"--sarif-group-rules-by-pack",
|
||||||
|
...(await getCodeScanningConfigExportArguments(config, this, features)),
|
||||||
...getExtraOptionsFromEnv(["database", "interpret-results"]),
|
...getExtraOptionsFromEnv(["database", "interpret-results"]),
|
||||||
];
|
];
|
||||||
if (await util.codeQlVersionAbove(this, CODEQL_VERSION_CUSTOM_QUERY_HELP))
|
if (await util.codeQlVersionAbove(this, CODEQL_VERSION_CUSTOM_QUERY_HELP))
|
||||||
@@ -687,7 +524,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
if (automationDetailsId !== undefined) {
|
if (automationDetailsId !== undefined) {
|
||||||
codeqlArgs.push("--sarif-category", automationDetailsId);
|
codeqlArgs.push("--sarif-category", automationDetailsId);
|
||||||
}
|
}
|
||||||
if (await featureEnablement.getValue(feature_flags_1.Feature.FileBaselineInformationEnabled, this)) {
|
if (await util.codeQlVersionAbove(this, CODEQL_VERSION_FILE_BASELINE_INFORMATION)) {
|
||||||
codeqlArgs.push("--sarif-add-baseline-file-info");
|
codeqlArgs.push("--sarif-add-baseline-file-info");
|
||||||
}
|
}
|
||||||
codeqlArgs.push(databasePath);
|
codeqlArgs.push(databasePath);
|
||||||
@@ -772,6 +609,20 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
];
|
];
|
||||||
await new toolrunner.ToolRunner(cmd, args).exec();
|
await new toolrunner.ToolRunner(cmd, args).exec();
|
||||||
},
|
},
|
||||||
|
async diagnosticsExport(sarifFile, automationDetailsId, config, features) {
|
||||||
|
const args = [
|
||||||
|
"diagnostics",
|
||||||
|
"export",
|
||||||
|
"--format=sarif-latest",
|
||||||
|
`--output=${sarifFile}`,
|
||||||
|
...(await getCodeScanningConfigExportArguments(config, this, features)),
|
||||||
|
...getExtraOptionsFromEnv(["diagnostics", "export"]),
|
||||||
|
];
|
||||||
|
if (automationDetailsId !== undefined) {
|
||||||
|
args.push("--sarif-category", automationDetailsId);
|
||||||
|
}
|
||||||
|
await new toolrunner.ToolRunner(cmd, args).exec();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
// To ensure that status reports include the CodeQL CLI version wherever
|
// To ensure that status reports include the CodeQL CLI version wherever
|
||||||
// possible, we want to call getVersion(), which populates the version value
|
// possible, we want to call getVersion(), which populates the version value
|
||||||
@@ -787,6 +638,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
}
|
}
|
||||||
return codeql;
|
return codeql;
|
||||||
}
|
}
|
||||||
|
exports.getCodeQLForCmd = getCodeQLForCmd;
|
||||||
/**
|
/**
|
||||||
* Gets the options for `path` of `options` as an array of extra option strings.
|
* Gets the options for `path` of `options` as an array of extra option strings.
|
||||||
*/
|
*/
|
||||||
@@ -825,10 +677,10 @@ function asExtraOptions(options, pathInfo) {
|
|||||||
* Exported for testing.
|
* Exported for testing.
|
||||||
*/
|
*/
|
||||||
function getExtraOptions(options, paths, pathInfo) {
|
function getExtraOptions(options, paths, pathInfo) {
|
||||||
const all = asExtraOptions(options === null || options === void 0 ? void 0 : options["*"], pathInfo.concat("*"));
|
const all = asExtraOptions(options?.["*"], pathInfo.concat("*"));
|
||||||
const specific = paths.length === 0
|
const specific = paths.length === 0
|
||||||
? asExtraOptions(options, pathInfo)
|
? asExtraOptions(options, pathInfo)
|
||||||
: getExtraOptions(options === null || options === void 0 ? void 0 : options[paths[0]], paths === null || paths === void 0 ? void 0 : paths.slice(1), pathInfo.concat(paths[0]));
|
: getExtraOptions(options?.[paths[0]], paths?.slice(1), pathInfo.concat(paths[0]));
|
||||||
return all.concat(specific);
|
return all.concat(specific);
|
||||||
}
|
}
|
||||||
exports.getExtraOptions = getExtraOptions;
|
exports.getExtraOptions = getExtraOptions;
|
||||||
@@ -841,7 +693,7 @@ exports.getExtraOptions = getExtraOptions;
|
|||||||
* status reports on GitHub.com.
|
* status reports on GitHub.com.
|
||||||
*/
|
*/
|
||||||
const maxErrorSize = 20000;
|
const maxErrorSize = 20000;
|
||||||
async function runTool(cmd, args = []) {
|
async function runTool(cmd, args = [], opts = {}) {
|
||||||
let output = "";
|
let output = "";
|
||||||
let error = "";
|
let error = "";
|
||||||
const exitCode = await new toolrunner.ToolRunner(cmd, args, {
|
const exitCode = await new toolrunner.ToolRunner(cmd, args, {
|
||||||
@@ -860,6 +712,7 @@ async function runTool(cmd, args = []) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
|
...(opts.stdin ? { input: Buffer.from(opts.stdin || "") } : {}),
|
||||||
}).exec();
|
}).exec();
|
||||||
if (exitCode !== 0)
|
if (exitCode !== 0)
|
||||||
throw new CommandInvocationError(cmd, args, exitCode, error, output);
|
throw new CommandInvocationError(cmd, args, exitCode, error, output);
|
||||||
@@ -873,12 +726,11 @@ async function runTool(cmd, args = []) {
|
|||||||
* @param config The configuration to use.
|
* @param config The configuration to use.
|
||||||
* @returns the path to the generated user configuration file.
|
* @returns the path to the generated user configuration file.
|
||||||
*/
|
*/
|
||||||
async function generateCodeScanningConfig(codeql, config, featureEnablement) {
|
async function generateCodeScanningConfig(codeql, config, features, logger) {
|
||||||
var _a;
|
if (!(await util.useCodeScanningConfigInCli(codeql, features))) {
|
||||||
if (!(await util.useCodeScanningConfigInCli(codeql, featureEnablement))) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const configLocation = path.resolve(config.tempDir, "user-config.yaml");
|
const codeScanningConfigFile = (0, config_utils_1.getGeneratedCodeScanningConfigPath)(config);
|
||||||
// make a copy so we can modify it
|
// make a copy so we can modify it
|
||||||
const augmentedConfig = cloneObject(config.originalUserInput);
|
const augmentedConfig = cloneObject(config.originalUserInput);
|
||||||
// Inject the queries from the input
|
// Inject the queries from the input
|
||||||
@@ -890,7 +742,7 @@ async function generateCodeScanningConfig(codeql, config, featureEnablement) {
|
|||||||
augmentedConfig.queries = config.augmentationProperties.queriesInput;
|
augmentedConfig.queries = config.augmentationProperties.queriesInput;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (((_a = augmentedConfig.queries) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
if (augmentedConfig.queries?.length === 0) {
|
||||||
delete augmentedConfig.queries;
|
delete augmentedConfig.queries;
|
||||||
}
|
}
|
||||||
// Inject the packs from the input
|
// Inject the packs from the input
|
||||||
@@ -932,10 +784,28 @@ async function generateCodeScanningConfig(codeql, config, featureEnablement) {
|
|||||||
augmentedConfig.packs["javascript"].push(packString);
|
augmentedConfig.packs["javascript"].push(packString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fs.writeFileSync(configLocation, yaml.dump(augmentedConfig));
|
logger.info(`Writing augmented user configuration file to ${codeScanningConfigFile}`);
|
||||||
return configLocation;
|
logger.startGroup("Augmented user configuration file contents");
|
||||||
|
logger.info(yaml.dump(augmentedConfig));
|
||||||
|
logger.endGroup();
|
||||||
|
fs.writeFileSync(codeScanningConfigFile, yaml.dump(augmentedConfig));
|
||||||
|
return codeScanningConfigFile;
|
||||||
}
|
}
|
||||||
function cloneObject(obj) {
|
function cloneObject(obj) {
|
||||||
return JSON.parse(JSON.stringify(obj));
|
return JSON.parse(JSON.stringify(obj));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Gets arguments for passing the code scanning configuration file to interpretation commands like
|
||||||
|
* `codeql database interpret-results` and `codeql database export-diagnostics`.
|
||||||
|
*
|
||||||
|
* Returns an empty list if a code scanning configuration file was not generated by the CLI.
|
||||||
|
*/
|
||||||
|
async function getCodeScanningConfigExportArguments(config, codeql, features) {
|
||||||
|
const codeScanningConfigPath = (0, config_utils_1.getGeneratedCodeScanningConfigPath)(config);
|
||||||
|
if (fs.existsSync(codeScanningConfigPath) &&
|
||||||
|
(await features.getValue(feature_flags_1.Feature.ExportCodeScanningConfigEnabled, codeql))) {
|
||||||
|
return ["--sarif-codescanning-config", codeScanningConfigPath];
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
//# sourceMappingURL=codeql.js.map
|
//# sourceMappingURL=codeql.js.map
|
||||||
File diff suppressed because one or more lines are too long
544
lib/codeql.test.js
generated
544
lib/codeql.test.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -24,7 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.stubToolRunnerConstructor = void 0;
|
exports.stubToolRunnerConstructor = void 0;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const path = __importStar(require("path"));
|
const path_1 = __importDefault(require("path"));
|
||||||
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
||||||
const toolcache = __importStar(require("@actions/tool-cache"));
|
const toolcache = __importStar(require("@actions/tool-cache"));
|
||||||
const safeWhich = __importStar(require("@chrisgavin/safe-which"));
|
const safeWhich = __importStar(require("@chrisgavin/safe-which"));
|
||||||
@@ -34,9 +38,11 @@ const yaml = __importStar(require("js-yaml"));
|
|||||||
const nock_1 = __importDefault(require("nock"));
|
const nock_1 = __importDefault(require("nock"));
|
||||||
const sinon = __importStar(require("sinon"));
|
const sinon = __importStar(require("sinon"));
|
||||||
const actionsUtil = __importStar(require("./actions-util"));
|
const actionsUtil = __importStar(require("./actions-util"));
|
||||||
|
const api = __importStar(require("./api-client"));
|
||||||
const codeql = __importStar(require("./codeql"));
|
const codeql = __importStar(require("./codeql"));
|
||||||
const defaults = __importStar(require("./defaults.json"));
|
const defaults = __importStar(require("./defaults.json"));
|
||||||
const feature_flags_1 = require("./feature-flags");
|
const feature_flags_1 = require("./feature-flags");
|
||||||
|
const init_1 = require("./init");
|
||||||
const languages_1 = require("./languages");
|
const languages_1 = require("./languages");
|
||||||
const logging_1 = require("./logging");
|
const logging_1 = require("./logging");
|
||||||
const testing_utils_1 = require("./testing-utils");
|
const testing_utils_1 = require("./testing-utils");
|
||||||
@@ -46,14 +52,16 @@ const util_1 = require("./util");
|
|||||||
const sampleApiDetails = {
|
const sampleApiDetails = {
|
||||||
auth: "token",
|
auth: "token",
|
||||||
url: "https://github.com",
|
url: "https://github.com",
|
||||||
apiURL: undefined,
|
apiURL: "https://api.github.com",
|
||||||
registriesAuthTokens: undefined,
|
|
||||||
};
|
};
|
||||||
const sampleGHAEApiDetails = {
|
const sampleGHAEApiDetails = {
|
||||||
auth: "token",
|
auth: "token",
|
||||||
url: "https://example.githubenterprise.com",
|
url: "https://example.githubenterprise.com",
|
||||||
apiURL: undefined,
|
apiURL: "https://example.githubenterprise.com/api/v3",
|
||||||
registriesAuthTokens: undefined,
|
};
|
||||||
|
const SAMPLE_DEFAULT_CLI_VERSION = {
|
||||||
|
cliVersion: "2.0.0",
|
||||||
|
variant: util.GitHubVariant.DOTCOM,
|
||||||
};
|
};
|
||||||
let stubConfig;
|
let stubConfig;
|
||||||
ava_1.default.beforeEach(() => {
|
ava_1.default.beforeEach(() => {
|
||||||
@@ -83,191 +91,310 @@ ava_1.default.beforeEach(() => {
|
|||||||
trapCacheDownloadTime: 0,
|
trapCacheDownloadTime: 0,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
async function mockApiAndSetupCodeQL({ apiDetails, bypassToolcache, isPinned, tmpDir, toolsInput, version, }) {
|
/**
|
||||||
var _a;
|
* Mocks the API for downloading the bundle tagged `tagName`.
|
||||||
|
*
|
||||||
|
* @returns the download URL for the bundle. This can be passed to the tools parameter of
|
||||||
|
* `codeql.setupCodeQL`.
|
||||||
|
*/
|
||||||
|
function mockDownloadApi({ apiDetails = sampleApiDetails, isPinned, repo = "github/codeql-action", platformSpecific = true, tagName, }) {
|
||||||
const platform = process.platform === "win32"
|
const platform = process.platform === "win32"
|
||||||
? "win64"
|
? "win64"
|
||||||
: process.platform === "linux"
|
: process.platform === "linux"
|
||||||
? "linux64"
|
? "linux64"
|
||||||
: "osx64";
|
: "osx64";
|
||||||
const baseUrl = (_a = apiDetails === null || apiDetails === void 0 ? void 0 : apiDetails.url) !== null && _a !== void 0 ? _a : "https://example.com";
|
const baseUrl = apiDetails?.url ?? "https://example.com";
|
||||||
const relativeUrl = apiDetails
|
const relativeUrl = apiDetails
|
||||||
? `/github/codeql-action/releases/download/${version}/codeql-bundle-${platform}.tar.gz`
|
? `/${repo}/releases/download/${tagName}/codeql-bundle${platformSpecific ? `-${platform}` : ""}.tar.gz`
|
||||||
: `/download/codeql-bundle-${version}/codeql-bundle.tar.gz`;
|
: `/download/${tagName}/codeql-bundle.tar.gz`;
|
||||||
(0, nock_1.default)(baseUrl)
|
(0, nock_1.default)(baseUrl)
|
||||||
.get(relativeUrl)
|
.get(relativeUrl)
|
||||||
.replyWithFile(200, path.join(__dirname, `/../src/testdata/codeql-bundle${isPinned ? "-pinned" : ""}.tar.gz`));
|
.replyWithFile(200, path_1.default.join(__dirname, `/../src/testdata/codeql-bundle${isPinned ? "-pinned" : ""}.tar.gz`));
|
||||||
return await codeql.setupCodeQL(toolsInput ? toolsInput.input : `${baseUrl}${relativeUrl}`, apiDetails !== null && apiDetails !== void 0 ? apiDetails : sampleApiDetails, tmpDir, util.GitHubVariant.DOTCOM, !!bypassToolcache, (0, logging_1.getRunnerLogger)(true), false);
|
return `${baseUrl}${relativeUrl}`;
|
||||||
}
|
}
|
||||||
(0, ava_1.default)("download codeql bundle cache", async (t) => {
|
async function installIntoToolcache({ apiDetails = sampleApiDetails, cliVersion, isPinned, tagName, tmpDir, }) {
|
||||||
|
const url = mockDownloadApi({ apiDetails, isPinned, tagName });
|
||||||
|
await codeql.setupCodeQL(cliVersion !== undefined ? undefined : url, apiDetails, tmpDir, util.GitHubVariant.GHES, cliVersion !== undefined
|
||||||
|
? { cliVersion, tagName, variant: util.GitHubVariant.GHES }
|
||||||
|
: SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
||||||
|
}
|
||||||
|
function mockReleaseApi({ apiDetails = sampleApiDetails, assetNames, tagName, }) {
|
||||||
|
return (0, nock_1.default)(apiDetails.apiURL)
|
||||||
|
.get(`/repos/github/codeql-action/releases/tags/${tagName}`)
|
||||||
|
.reply(200, {
|
||||||
|
assets: assetNames.map((name) => ({
|
||||||
|
name,
|
||||||
|
})),
|
||||||
|
tag_name: tagName,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function mockApiDetails(apiDetails) {
|
||||||
|
// This is a workaround to mock `api.getApiDetails()` since it doesn't seem to be possible to
|
||||||
|
// mock this directly. The difficulty is that `getApiDetails()` is called locally in
|
||||||
|
// `api-client.ts`, but `sinon.stub(api, "getApiDetails")` only affects calls to
|
||||||
|
// `getApiDetails()` via an imported `api` module.
|
||||||
|
sinon
|
||||||
|
.stub(actionsUtil, "getRequiredInput")
|
||||||
|
.withArgs("token")
|
||||||
|
.returns(apiDetails.auth);
|
||||||
|
const requiredEnvParamStub = sinon.stub(util, "getRequiredEnvParam");
|
||||||
|
requiredEnvParamStub.withArgs("GITHUB_SERVER_URL").returns(apiDetails.url);
|
||||||
|
requiredEnvParamStub
|
||||||
|
.withArgs("GITHUB_API_URL")
|
||||||
|
.returns(apiDetails.apiURL || "");
|
||||||
|
}
|
||||||
|
(0, ava_1.default)("downloads and caches explicitly requested bundles that aren't in the toolcache", async (t) => {
|
||||||
await util.withTmpDir(async (tmpDir) => {
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
const versions = ["20200601", "20200610"];
|
const versions = ["20200601", "20200610"];
|
||||||
for (let i = 0; i < versions.length; i++) {
|
for (let i = 0; i < versions.length; i++) {
|
||||||
const version = versions[i];
|
const version = versions[i];
|
||||||
const codeQLConfig = await mockApiAndSetupCodeQL({ version, tmpDir });
|
const url = mockDownloadApi({
|
||||||
|
tagName: `codeql-bundle-${version}`,
|
||||||
|
isPinned: false,
|
||||||
|
});
|
||||||
|
const result = await codeql.setupCodeQL(url, sampleApiDetails, tmpDir, util.GitHubVariant.DOTCOM, SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
||||||
t.assert(toolcache.find("CodeQL", `0.0.0-${version}`));
|
t.assert(toolcache.find("CodeQL", `0.0.0-${version}`));
|
||||||
t.deepEqual(codeQLConfig.toolsVersion, version);
|
t.is(result.toolsVersion, `0.0.0-${version}`);
|
||||||
|
t.is(result.toolsSource, init_1.ToolsSource.Download);
|
||||||
|
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
|
||||||
}
|
}
|
||||||
t.is(toolcache.findAllVersions("CodeQL").length, 2);
|
t.is(toolcache.findAllVersions("CodeQL").length, 2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("download codeql bundle cache explicitly requested with pinned different version cached", async (t) => {
|
(0, ava_1.default)("downloads an explicitly requested bundle even if a different version is cached", async (t) => {
|
||||||
await util.withTmpDir(async (tmpDir) => {
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
const pinnedCodeQLConfig = await mockApiAndSetupCodeQL({
|
await installIntoToolcache({
|
||||||
version: "20200601",
|
tagName: "codeql-bundle-20200601",
|
||||||
isPinned: true,
|
isPinned: true,
|
||||||
tmpDir,
|
tmpDir,
|
||||||
});
|
});
|
||||||
t.assert(toolcache.find("CodeQL", "0.0.0-20200601"));
|
const url = mockDownloadApi({
|
||||||
t.deepEqual(pinnedCodeQLConfig.toolsVersion, "20200601");
|
tagName: "codeql-bundle-20200610",
|
||||||
const unpinnedCodeQLConfig = await mockApiAndSetupCodeQL({
|
|
||||||
version: "20200610",
|
|
||||||
tmpDir,
|
|
||||||
});
|
});
|
||||||
|
const result = await codeql.setupCodeQL(url, sampleApiDetails, tmpDir, util.GitHubVariant.DOTCOM, SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
||||||
t.assert(toolcache.find("CodeQL", "0.0.0-20200610"));
|
t.assert(toolcache.find("CodeQL", "0.0.0-20200610"));
|
||||||
t.deepEqual(unpinnedCodeQLConfig.toolsVersion, "20200610");
|
t.deepEqual(result.toolsVersion, "0.0.0-20200610");
|
||||||
|
t.is(result.toolsSource, init_1.ToolsSource.Download);
|
||||||
|
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("don't download codeql bundle cache with pinned different version cached", async (t) => {
|
const EXPLICITLY_REQUESTED_BUNDLE_TEST_CASES = [
|
||||||
await util.withTmpDir(async (tmpDir) => {
|
{
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
cliVersion: "2.10.0",
|
||||||
const pinnedCodeQLConfig = await mockApiAndSetupCodeQL({
|
expectedToolcacheVersion: "2.10.0-20200610",
|
||||||
version: "20200601",
|
},
|
||||||
isPinned: true,
|
{
|
||||||
tmpDir,
|
cliVersion: "2.10.0-pre",
|
||||||
});
|
expectedToolcacheVersion: "0.0.0-20200610",
|
||||||
t.assert(toolcache.find("CodeQL", "0.0.0-20200601"));
|
},
|
||||||
t.deepEqual(pinnedCodeQLConfig.toolsVersion, "20200601");
|
{
|
||||||
const codeQLConfig = await codeql.setupCodeQL(undefined, sampleApiDetails, tmpDir, util.GitHubVariant.DOTCOM, false, (0, logging_1.getRunnerLogger)(true), false);
|
cliVersion: "2.10.0+202006100101",
|
||||||
t.deepEqual(codeQLConfig.toolsVersion, "0.0.0-20200601");
|
expectedToolcacheVersion: "0.0.0-20200610",
|
||||||
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
},
|
||||||
t.is(cachedVersions.length, 1);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("download codeql bundle cache with different version cached (not pinned)", async (t) => {
|
|
||||||
await util.withTmpDir(async (tmpDir) => {
|
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
|
||||||
const cachedCodeQLConfig = await mockApiAndSetupCodeQL({
|
|
||||||
version: "20200601",
|
|
||||||
tmpDir,
|
|
||||||
});
|
|
||||||
t.assert(toolcache.find("CodeQL", "0.0.0-20200601"));
|
|
||||||
t.deepEqual(cachedCodeQLConfig.toolsVersion, "20200601");
|
|
||||||
const codeQLConfig = await mockApiAndSetupCodeQL({
|
|
||||||
version: defaults.bundleVersion,
|
|
||||||
tmpDir,
|
|
||||||
apiDetails: sampleApiDetails,
|
|
||||||
toolsInput: { input: undefined },
|
|
||||||
});
|
|
||||||
t.deepEqual(codeQLConfig.toolsVersion, defaults.bundleVersion.replace("codeql-bundle-", ""));
|
|
||||||
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
|
||||||
t.is(cachedVersions.length, 2);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(0, ava_1.default)('download codeql bundle cache with pinned different version cached if "latest" tools specified', async (t) => {
|
|
||||||
await util.withTmpDir(async (tmpDir) => {
|
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
|
||||||
const pinnedCodeQLConfig = await mockApiAndSetupCodeQL({
|
|
||||||
version: "20200601",
|
|
||||||
isPinned: true,
|
|
||||||
tmpDir,
|
|
||||||
});
|
|
||||||
t.assert(toolcache.find("CodeQL", "0.0.0-20200601"));
|
|
||||||
t.deepEqual(pinnedCodeQLConfig.toolsVersion, "20200601");
|
|
||||||
const latestCodeQLConfig = await mockApiAndSetupCodeQL({
|
|
||||||
version: defaults.bundleVersion,
|
|
||||||
apiDetails: sampleApiDetails,
|
|
||||||
toolsInput: { input: "latest" },
|
|
||||||
tmpDir,
|
|
||||||
});
|
|
||||||
t.deepEqual(latestCodeQLConfig.toolsVersion, defaults.bundleVersion.replace("codeql-bundle-", ""));
|
|
||||||
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
|
||||||
t.is(cachedVersions.length, 2);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const TOOLCACHE_BYPASS_TEST_CASES = [
|
|
||||||
[true, undefined, true],
|
|
||||||
[false, undefined, false],
|
|
||||||
[
|
|
||||||
true,
|
|
||||||
"https://github.com/github/codeql-action/releases/download/codeql-bundle-20200601/codeql-bundle.tar.gz",
|
|
||||||
false,
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
for (const [isFeatureEnabled, toolsInput, shouldToolcacheBeBypassed,] of TOOLCACHE_BYPASS_TEST_CASES) {
|
for (const { cliVersion, expectedToolcacheVersion, } of EXPLICITLY_REQUESTED_BUNDLE_TEST_CASES) {
|
||||||
(0, ava_1.default)(`download codeql bundle ${shouldToolcacheBeBypassed ? "bypasses" : "does not bypass"} toolcache when feature ${isFeatureEnabled ? "enabled" : "disabled"} and tools: ${toolsInput} passed`, async (t) => {
|
(0, ava_1.default)(`caches an explicitly requested bundle containing CLI ${cliVersion} as ${expectedToolcacheVersion}`, async (t) => {
|
||||||
await util.withTmpDir(async (tmpDir) => {
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
await mockApiAndSetupCodeQL({
|
mockApiDetails(sampleApiDetails);
|
||||||
version: "codeql-bundle-20200601",
|
sinon.stub(actionsUtil, "isRunningLocalAction").returns(true);
|
||||||
apiDetails: sampleApiDetails,
|
const releaseApiMock = mockReleaseApi({
|
||||||
isPinned: true,
|
assetNames: [`cli-version-${cliVersion}.txt`],
|
||||||
tmpDir,
|
tagName: "codeql-bundle-20200610",
|
||||||
});
|
});
|
||||||
t.assert(toolcache.find("CodeQL", "0.0.0-20200601"));
|
const url = mockDownloadApi({
|
||||||
await mockApiAndSetupCodeQL({
|
tagName: "codeql-bundle-20200610",
|
||||||
version: defaults.bundleVersion,
|
|
||||||
apiDetails: sampleApiDetails,
|
|
||||||
bypassToolcache: isFeatureEnabled,
|
|
||||||
toolsInput: { input: toolsInput },
|
|
||||||
tmpDir,
|
|
||||||
});
|
});
|
||||||
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
const result = await codeql.setupCodeQL(url, sampleApiDetails, tmpDir, util.GitHubVariant.DOTCOM, SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
||||||
t.is(cachedVersions.length, shouldToolcacheBeBypassed ? 2 : 1);
|
t.assert(releaseApiMock.isDone(), "Releases API should have been called");
|
||||||
|
t.assert(toolcache.find("CodeQL", expectedToolcacheVersion));
|
||||||
|
t.deepEqual(result.toolsVersion, cliVersion);
|
||||||
|
t.is(result.toolsSource, init_1.ToolsSource.Download);
|
||||||
|
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
(0, ava_1.default)("download codeql bundle from github ae endpoint", async (t) => {
|
for (const { githubReleases, toolcacheVersion } of [
|
||||||
|
// Test that we use the tools from the toolcache when `SAMPLE_DEFAULT_CLI_VERSION` is requested
|
||||||
|
// and `SAMPLE_DEFAULT_CLI_VERSION-` is in the toolcache.
|
||||||
|
{
|
||||||
|
toolcacheVersion: SAMPLE_DEFAULT_CLI_VERSION.cliVersion,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
githubReleases: {
|
||||||
|
"codeql-bundle-20230101": `cli-version-${SAMPLE_DEFAULT_CLI_VERSION.cliVersion}.txt`,
|
||||||
|
},
|
||||||
|
toolcacheVersion: "0.0.0-20230101",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
toolcacheVersion: `${SAMPLE_DEFAULT_CLI_VERSION.cliVersion}-20230101`,
|
||||||
|
},
|
||||||
|
]) {
|
||||||
|
(0, ava_1.default)(`uses tools from toolcache when ${SAMPLE_DEFAULT_CLI_VERSION.cliVersion} is requested and ` +
|
||||||
|
`${toolcacheVersion} is installed`, async (t) => {
|
||||||
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
sinon
|
||||||
|
.stub(toolcache, "find")
|
||||||
|
.withArgs("CodeQL", toolcacheVersion)
|
||||||
|
.returns("path/to/cached/codeql");
|
||||||
|
sinon.stub(toolcache, "findAllVersions").returns([toolcacheVersion]);
|
||||||
|
if (githubReleases) {
|
||||||
|
sinon.stub(api, "getApiClient").value(() => ({
|
||||||
|
repos: {
|
||||||
|
listReleases: sinon.stub().resolves(undefined),
|
||||||
|
},
|
||||||
|
paginate: sinon.stub().resolves(Object.entries(githubReleases).map(([releaseTagName, cliVersionMarkerFile]) => ({
|
||||||
|
assets: [
|
||||||
|
{
|
||||||
|
name: cliVersionMarkerFile,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
tag_name: releaseTagName,
|
||||||
|
}))),
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
const result = await codeql.setupCodeQL(undefined, sampleApiDetails, tmpDir, util.GitHubVariant.DOTCOM, SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
||||||
|
t.is(result.toolsVersion, SAMPLE_DEFAULT_CLI_VERSION.cliVersion);
|
||||||
|
t.is(result.toolsSource, init_1.ToolsSource.Toolcache);
|
||||||
|
t.is(result.toolsDownloadDurationMs, undefined);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
for (const variant of [util.GitHubVariant.GHAE, util.GitHubVariant.GHES]) {
|
||||||
|
(0, ava_1.default)(`uses a cached bundle when no tools input is given on ${util.GitHubVariant[variant]}`, async (t) => {
|
||||||
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
await installIntoToolcache({
|
||||||
|
tagName: "codeql-bundle-20200601",
|
||||||
|
isPinned: true,
|
||||||
|
tmpDir,
|
||||||
|
});
|
||||||
|
const result = await codeql.setupCodeQL(undefined, sampleApiDetails, tmpDir, variant, {
|
||||||
|
cliVersion: defaults.cliVersion,
|
||||||
|
tagName: defaults.bundleVersion,
|
||||||
|
variant,
|
||||||
|
}, (0, logging_1.getRunnerLogger)(true), false);
|
||||||
|
t.deepEqual(result.toolsVersion, "0.0.0-20200601");
|
||||||
|
t.is(result.toolsSource, init_1.ToolsSource.Toolcache);
|
||||||
|
t.is(result.toolsDownloadDurationMs, undefined);
|
||||||
|
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
||||||
|
t.is(cachedVersions.length, 1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)(`downloads bundle if only an unpinned version is cached on ${util.GitHubVariant[variant]}`, async (t) => {
|
||||||
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
await installIntoToolcache({
|
||||||
|
tagName: "codeql-bundle-20200601",
|
||||||
|
isPinned: false,
|
||||||
|
tmpDir,
|
||||||
|
});
|
||||||
|
mockDownloadApi({
|
||||||
|
tagName: defaults.bundleVersion,
|
||||||
|
});
|
||||||
|
const result = await codeql.setupCodeQL(undefined, sampleApiDetails, tmpDir, variant, {
|
||||||
|
cliVersion: defaults.cliVersion,
|
||||||
|
tagName: defaults.bundleVersion,
|
||||||
|
variant,
|
||||||
|
}, (0, logging_1.getRunnerLogger)(true), false);
|
||||||
|
t.deepEqual(result.toolsVersion, defaults.cliVersion);
|
||||||
|
t.is(result.toolsSource, init_1.ToolsSource.Download);
|
||||||
|
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
|
||||||
|
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
||||||
|
t.is(cachedVersions.length, 2);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
(0, ava_1.default)('downloads bundle if "latest" tools specified but not cached', async (t) => {
|
||||||
await util.withTmpDir(async (tmpDir) => {
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
const bundleAssetID = 10;
|
await installIntoToolcache({
|
||||||
const platform = process.platform === "win32"
|
tagName: "codeql-bundle-20200601",
|
||||||
? "win64"
|
isPinned: true,
|
||||||
: process.platform === "linux"
|
tmpDir,
|
||||||
? "linux64"
|
|
||||||
: "osx64";
|
|
||||||
const codeQLBundleName = `codeql-bundle-${platform}.tar.gz`;
|
|
||||||
(0, nock_1.default)("https://example.githubenterprise.com")
|
|
||||||
.get(`/api/v3/enterprise/code-scanning/codeql-bundle/find/${defaults.bundleVersion}`)
|
|
||||||
.reply(200, {
|
|
||||||
assets: { [codeQLBundleName]: bundleAssetID },
|
|
||||||
});
|
});
|
||||||
(0, nock_1.default)("https://example.githubenterprise.com")
|
mockDownloadApi({
|
||||||
.get(`/api/v3/enterprise/code-scanning/codeql-bundle/download/${bundleAssetID}`)
|
tagName: defaults.bundleVersion,
|
||||||
.reply(200, {
|
|
||||||
url: `https://example.githubenterprise.com/github/codeql-action/releases/download/${defaults.bundleVersion}/${codeQLBundleName}`,
|
|
||||||
});
|
});
|
||||||
(0, nock_1.default)("https://example.githubenterprise.com")
|
const result = await codeql.setupCodeQL("latest", sampleApiDetails, tmpDir, util.GitHubVariant.DOTCOM, SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
||||||
.get(`/github/codeql-action/releases/download/${defaults.bundleVersion}/${codeQLBundleName}`)
|
t.deepEqual(result.toolsVersion, defaults.cliVersion);
|
||||||
.replyWithFile(200, path.join(__dirname, `/../src/testdata/codeql-bundle-pinned.tar.gz`));
|
t.is(result.toolsSource, init_1.ToolsSource.Download);
|
||||||
await codeql.setupCodeQL(undefined, sampleGHAEApiDetails, tmpDir, util.GitHubVariant.GHAE, false, (0, logging_1.getRunnerLogger)(true), false);
|
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
|
||||||
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
||||||
t.is(cachedVersions.length, 1);
|
t.is(cachedVersions.length, 2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("parse codeql bundle url version", (t) => {
|
for (const isBundleVersionInUrl of [true, false]) {
|
||||||
t.deepEqual(codeql.getCodeQLURLVersion("https://github.com/.../codeql-bundle-20200601/..."), "20200601");
|
const inclusionString = isBundleVersionInUrl
|
||||||
});
|
? "includes"
|
||||||
(0, ava_1.default)("convert to semver", (t) => {
|
: "does not include";
|
||||||
const tests = {
|
(0, ava_1.default)(`download codeql bundle from github ae endpoint (URL ${inclusionString} bundle version)`, async (t) => {
|
||||||
"20200601": "0.0.0-20200601",
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
"20200601.0": "0.0.0-20200601.0",
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
"20200601.0.0": "20200601.0.0",
|
const bundleAssetID = 10;
|
||||||
"1.2.3": "1.2.3",
|
const platform = process.platform === "win32"
|
||||||
"1.2.3-alpha": "1.2.3-alpha",
|
? "win64"
|
||||||
"1.2.3-beta.1": "1.2.3-beta.1",
|
: process.platform === "linux"
|
||||||
};
|
? "linux64"
|
||||||
for (const [version, expectedVersion] of Object.entries(tests)) {
|
: "osx64";
|
||||||
try {
|
const codeQLBundleName = `codeql-bundle-${platform}.tar.gz`;
|
||||||
const parsedVersion = codeql.convertToSemVer(version, (0, logging_1.getRunnerLogger)(true));
|
const eventualDownloadUrl = isBundleVersionInUrl
|
||||||
t.deepEqual(parsedVersion, expectedVersion);
|
? `https://example.githubenterprise.com/github/codeql-action/releases/download/${defaults.bundleVersion}/${codeQLBundleName}`
|
||||||
}
|
: `https://example.githubenterprise.com/api/v3/repos/github/codeql-action/releases/assets/${bundleAssetID}`;
|
||||||
catch (e) {
|
(0, nock_1.default)("https://example.githubenterprise.com")
|
||||||
t.fail(e instanceof Error ? e.message : String(e));
|
.get(`/api/v3/enterprise/code-scanning/codeql-bundle/find/${defaults.bundleVersion}`)
|
||||||
}
|
.reply(200, {
|
||||||
}
|
assets: { [codeQLBundleName]: bundleAssetID },
|
||||||
|
});
|
||||||
|
(0, nock_1.default)("https://example.githubenterprise.com")
|
||||||
|
.get(`/api/v3/enterprise/code-scanning/codeql-bundle/download/${bundleAssetID}`)
|
||||||
|
.reply(200, {
|
||||||
|
url: eventualDownloadUrl,
|
||||||
|
});
|
||||||
|
(0, nock_1.default)("https://example.githubenterprise.com")
|
||||||
|
.get(eventualDownloadUrl.replace("https://example.githubenterprise.com", ""))
|
||||||
|
.replyWithFile(200, path_1.default.join(__dirname, `/../src/testdata/codeql-bundle-pinned.tar.gz`));
|
||||||
|
mockApiDetails(sampleGHAEApiDetails);
|
||||||
|
sinon.stub(actionsUtil, "isRunningLocalAction").returns(false);
|
||||||
|
process.env["GITHUB_ACTION_REPOSITORY"] = "github/codeql-action";
|
||||||
|
const result = await codeql.setupCodeQL(undefined, sampleGHAEApiDetails, tmpDir, util.GitHubVariant.GHAE, {
|
||||||
|
cliVersion: defaults.cliVersion,
|
||||||
|
tagName: defaults.bundleVersion,
|
||||||
|
variant: util.GitHubVariant.GHAE,
|
||||||
|
}, (0, logging_1.getRunnerLogger)(true), false);
|
||||||
|
t.is(result.toolsSource, init_1.ToolsSource.Download);
|
||||||
|
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
|
||||||
|
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
||||||
|
t.is(cachedVersions.length, 1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
(0, ava_1.default)("bundle URL from another repo is cached as 0.0.0-bundleVersion", async (t) => {
|
||||||
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
mockApiDetails(sampleApiDetails);
|
||||||
|
sinon.stub(actionsUtil, "isRunningLocalAction").returns(true);
|
||||||
|
const releasesApiMock = mockReleaseApi({
|
||||||
|
assetNames: ["cli-version-2.12.2.txt"],
|
||||||
|
tagName: "codeql-bundle-20230203",
|
||||||
|
});
|
||||||
|
mockDownloadApi({
|
||||||
|
repo: "dsp-testing/codeql-cli-nightlies",
|
||||||
|
platformSpecific: false,
|
||||||
|
tagName: "codeql-bundle-20230203",
|
||||||
|
});
|
||||||
|
const result = await codeql.setupCodeQL("https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-20230203/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, util.GitHubVariant.DOTCOM, SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
||||||
|
t.is(result.toolsVersion, "0.0.0-20230203");
|
||||||
|
t.is(result.toolsSource, init_1.ToolsSource.Download);
|
||||||
|
t.true(Number.isInteger(result.toolsDownloadDurationMs));
|
||||||
|
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
||||||
|
t.is(cachedVersions.length, 1);
|
||||||
|
t.is(cachedVersions[0], "0.0.0-20230203");
|
||||||
|
t.false(releasesApiMock.isDone());
|
||||||
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("getExtraOptions works for explicit paths", (t) => {
|
(0, ava_1.default)("getExtraOptions works for explicit paths", (t) => {
|
||||||
t.deepEqual(codeql.getExtraOptions({}, ["foo"], []), []);
|
t.deepEqual(codeql.getExtraOptions({}, ["foo"], []), []);
|
||||||
@@ -291,27 +418,13 @@ for (const [isFeatureEnabled, toolsInput, shouldToolcacheBeBypassed,] of TOOLCAC
|
|||||||
t.throws(() => codeql.getExtraOptions({ foo: 87 }, ["foo"], []));
|
t.throws(() => codeql.getExtraOptions({ foo: 87 }, ["foo"], []));
|
||||||
t.throws(() => codeql.getExtraOptions({ "*": [42], foo: { "*": 87, bar: [99] } }, ["foo", "bar"], []));
|
t.throws(() => codeql.getExtraOptions({ "*": [42], foo: { "*": 87, bar: [99] } }, ["foo", "bar"], []));
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("getCodeQLActionRepository", (t) => {
|
|
||||||
const logger = (0, logging_1.getRunnerLogger)(true);
|
|
||||||
(0, util_1.initializeEnvironment)("1.2.3");
|
|
||||||
// isRunningLocalAction() === true
|
|
||||||
delete process.env["GITHUB_ACTION_REPOSITORY"];
|
|
||||||
process.env["RUNNER_TEMP"] = path.dirname(__dirname);
|
|
||||||
const repoLocalRunner = codeql.getCodeQLActionRepository(logger);
|
|
||||||
t.deepEqual(repoLocalRunner, "github/codeql-action");
|
|
||||||
// isRunningLocalAction() === false
|
|
||||||
sinon.stub(actionsUtil, "isRunningLocalAction").returns(false);
|
|
||||||
process.env["GITHUB_ACTION_REPOSITORY"] = "xxx/yyy";
|
|
||||||
const repoEnv = codeql.getCodeQLActionRepository(logger);
|
|
||||||
t.deepEqual(repoEnv, "xxx/yyy");
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("databaseInterpretResults() does not set --sarif-add-query-help for 2.7.0", async (t) => {
|
(0, ava_1.default)("databaseInterpretResults() does not set --sarif-add-query-help for 2.7.0", async (t) => {
|
||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves("2.7.0");
|
sinon.stub(codeqlObject, "getVersion").resolves("2.7.0");
|
||||||
// safeWhich throws because of the test CodeQL object.
|
// safeWhich throws because of the test CodeQL object.
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||||
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", (0, testing_utils_1.createFeatures)([]));
|
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", stubConfig, (0, testing_utils_1.createFeatures)([]));
|
||||||
t.false(runnerConstructorStub.firstCall.args[1].includes("--sarif-add-query-help"), "--sarif-add-query-help should be absent, but it is present");
|
t.false(runnerConstructorStub.firstCall.args[1].includes("--sarif-add-query-help"), "--sarif-add-query-help should be absent, but it is present");
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("databaseInterpretResults() sets --sarif-add-query-help for 2.7.1", async (t) => {
|
(0, ava_1.default)("databaseInterpretResults() sets --sarif-add-query-help for 2.7.1", async (t) => {
|
||||||
@@ -320,7 +433,7 @@ for (const [isFeatureEnabled, toolsInput, shouldToolcacheBeBypassed,] of TOOLCAC
|
|||||||
sinon.stub(codeqlObject, "getVersion").resolves("2.7.1");
|
sinon.stub(codeqlObject, "getVersion").resolves("2.7.1");
|
||||||
// safeWhich throws because of the test CodeQL object.
|
// safeWhich throws because of the test CodeQL object.
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||||
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", (0, testing_utils_1.createFeatures)([]));
|
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", stubConfig, (0, testing_utils_1.createFeatures)([]));
|
||||||
t.true(runnerConstructorStub.firstCall.args[1].includes("--sarif-add-query-help"), "--sarif-add-query-help should be present, but it is absent");
|
t.true(runnerConstructorStub.firstCall.args[1].includes("--sarif-add-query-help"), "--sarif-add-query-help should be present, but it is absent");
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("databaseInitCluster() without injected codescanning config", async (t) => {
|
(0, ava_1.default)("databaseInitCluster() without injected codescanning config", async (t) => {
|
||||||
@@ -339,11 +452,11 @@ for (const [isFeatureEnabled, toolsInput, shouldToolcacheBeBypassed,] of TOOLCAC
|
|||||||
packsInputCombines: false,
|
packsInputCombines: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
await codeqlObject.databaseInitCluster(thisStubConfig, "", undefined, (0, testing_utils_1.createFeatures)([]), (0, logging_1.getRunnerLogger)(true));
|
await codeqlObject.databaseInitCluster(thisStubConfig, "", undefined, (0, testing_utils_1.createFeatures)([]), "/path/to/qlconfig.yml", (0, logging_1.getRunnerLogger)(true));
|
||||||
const args = runnerConstructorStub.firstCall.args[1];
|
const args = runnerConstructorStub.firstCall.args[1];
|
||||||
// should NOT have used an config file
|
// should NOT have used an config file
|
||||||
const configArg = args.find((arg) => arg.startsWith("--codescanning-config="));
|
const configArg = args.find((arg) => arg.startsWith("--codescanning-config="));
|
||||||
t.falsy(configArg, "Should have injected a codescanning config");
|
t.falsy(configArg, "Should NOT have injected a codescanning config");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// Test macro for ensuring different variants of injected augmented configurations
|
// Test macro for ensuring different variants of injected augmented configurations
|
||||||
@@ -354,14 +467,14 @@ const injectedConfigMacro = ava_1.default.macro({
|
|||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
sinon
|
sinon
|
||||||
.stub(codeqlObject, "getVersion")
|
.stub(codeqlObject, "getVersion")
|
||||||
.resolves(codeql.CODEQL_VERSION_CONFIG_FILES);
|
.resolves(feature_flags_1.featureConfig[feature_flags_1.Feature.CliConfigFileEnabled].minimumVersion);
|
||||||
const thisStubConfig = {
|
const thisStubConfig = {
|
||||||
...stubConfig,
|
...stubConfig,
|
||||||
...configOverride,
|
...configOverride,
|
||||||
tempDir,
|
tempDir,
|
||||||
augmentationProperties,
|
augmentationProperties,
|
||||||
};
|
};
|
||||||
await codeqlObject.databaseInitCluster(thisStubConfig, "", undefined, (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CliConfigFileEnabled]), (0, logging_1.getRunnerLogger)(true));
|
await codeqlObject.databaseInitCluster(thisStubConfig, "", undefined, (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CliConfigFileEnabled]), undefined, (0, logging_1.getRunnerLogger)(true));
|
||||||
const args = runnerConstructorStub.firstCall.args[1];
|
const args = runnerConstructorStub.firstCall.args[1];
|
||||||
// should have used an config file
|
// should have used an config file
|
||||||
const configArg = args.find((arg) => arg.startsWith("--codescanning-config="));
|
const configArg = args.find((arg) => arg.startsWith("--codescanning-config="));
|
||||||
@@ -384,7 +497,7 @@ const injectedConfigMacro = ava_1.default.macro({
|
|||||||
queriesInputCombines: false,
|
queriesInputCombines: false,
|
||||||
packsInputCombines: false,
|
packsInputCombines: false,
|
||||||
}, {}, {
|
}, {}, {
|
||||||
packs: ["codeql/javascript-experimental-atm-queries@~0.3.0"],
|
packs: ["codeql/javascript-experimental-atm-queries@~0.4.0"],
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("injected ML queries with existing packs", injectedConfigMacro, {
|
(0, ava_1.default)("injected ML queries with existing packs", injectedConfigMacro, {
|
||||||
injectedMlQueries: true,
|
injectedMlQueries: true,
|
||||||
@@ -398,7 +511,7 @@ const injectedConfigMacro = ava_1.default.macro({
|
|||||||
packs: {
|
packs: {
|
||||||
javascript: [
|
javascript: [
|
||||||
"codeql/something-else",
|
"codeql/something-else",
|
||||||
"codeql/javascript-experimental-atm-queries@~0.3.0",
|
"codeql/javascript-experimental-atm-queries@~0.4.0",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -413,7 +526,7 @@ const injectedConfigMacro = ava_1.default.macro({
|
|||||||
}, {
|
}, {
|
||||||
packs: {
|
packs: {
|
||||||
cpp: ["codeql/something-else"],
|
cpp: ["codeql/something-else"],
|
||||||
javascript: ["codeql/javascript-experimental-atm-queries@~0.3.0"],
|
javascript: ["codeql/javascript-experimental-atm-queries@~0.4.0"],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("injected packs from input", injectedConfigMacro, {
|
(0, ava_1.default)("injected packs from input", injectedConfigMacro, {
|
||||||
@@ -466,7 +579,7 @@ const injectedConfigMacro = ava_1.default.macro({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
packs: ["xxx", "yyy", "codeql/javascript-experimental-atm-queries@~0.3.0"],
|
packs: ["xxx", "yyy", "codeql/javascript-experimental-atm-queries@~0.4.0"],
|
||||||
});
|
});
|
||||||
// similar, but with queries
|
// similar, but with queries
|
||||||
(0, ava_1.default)("injected queries from input", injectedConfigMacro, {
|
(0, ava_1.default)("injected queries from input", injectedConfigMacro, {
|
||||||
@@ -552,47 +665,84 @@ const injectedConfigMacro = ava_1.default.macro({
|
|||||||
queries: [],
|
queries: [],
|
||||||
},
|
},
|
||||||
}, {});
|
}, {});
|
||||||
(0, ava_1.default)("does not use injected config", async (t) => {
|
(0, ava_1.default)("does not pass a code scanning config or qlconfig file to the CLI when CLI config passing is disabled", async (t) => {
|
||||||
const origCODEQL_PASS_CONFIG_TO_CLI = process.env.CODEQL_PASS_CONFIG_TO_CLI;
|
await util.withTmpDir(async (tempDir) => {
|
||||||
process.env["CODEQL_PASS_CONFIG_TO_CLI"] = "false";
|
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||||
try {
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
|
// stubbed version doesn't matter. It just needs to be valid semver.
|
||||||
|
sinon.stub(codeqlObject, "getVersion").resolves("0.0.0");
|
||||||
|
await codeqlObject.databaseInitCluster({ ...stubConfig, tempDir }, "", undefined, (0, testing_utils_1.createFeatures)([]), "/path/to/qlconfig.yml", (0, logging_1.getRunnerLogger)(true));
|
||||||
|
const args = runnerConstructorStub.firstCall.args[1];
|
||||||
|
// should not have used a config file
|
||||||
|
const hasConfigArg = args.some((arg) => arg.startsWith("--codescanning-config="));
|
||||||
|
t.false(hasConfigArg, "Should NOT have injected a codescanning config");
|
||||||
|
// should not have passed a qlconfig file
|
||||||
|
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig-file="));
|
||||||
|
t.false(hasQlconfigArg, "Should NOT have passed a qlconfig file");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("passes a code scanning config AND qlconfig to the CLI when CLI config passing is enabled", async (t) => {
|
||||||
|
await util.withTmpDir(async (tempDir) => {
|
||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
sinon
|
sinon
|
||||||
.stub(codeqlObject, "getVersion")
|
.stub(codeqlObject, "getVersion")
|
||||||
.resolves(codeql.CODEQL_VERSION_CONFIG_FILES);
|
.resolves(codeql.CODEQL_VERSION_INIT_WITH_QLCONFIG);
|
||||||
await codeqlObject.databaseInitCluster(stubConfig, "", undefined, (0, testing_utils_1.createFeatures)([]), (0, logging_1.getRunnerLogger)(true));
|
await codeqlObject.databaseInitCluster({ ...stubConfig, tempDir }, "", undefined, (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CliConfigFileEnabled]), "/path/to/qlconfig.yml", (0, logging_1.getRunnerLogger)(true));
|
||||||
const args = runnerConstructorStub.firstCall.args[1];
|
const args = runnerConstructorStub.firstCall.args[1];
|
||||||
// should have used an config file
|
// should have used a config file
|
||||||
const configArg = args.find((arg) => arg.startsWith("--codescanning-config="));
|
const hasCodeScanningConfigArg = args.some((arg) => arg.startsWith("--codescanning-config="));
|
||||||
t.falsy(configArg, "Should NOT have injected a codescanning config");
|
t.true(hasCodeScanningConfigArg, "Should have injected a qlconfig");
|
||||||
}
|
// should have passed a qlconfig file
|
||||||
finally {
|
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig-file="));
|
||||||
process.env["CODEQL_PASS_CONFIG_TO_CLI"] = origCODEQL_PASS_CONFIG_TO_CLI;
|
t.truthy(hasQlconfigArg, "Should have injected a codescanning config");
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("databaseInterpretResults() sets --sarif-add-baseline-file-info when feature enabled", async (t) => {
|
(0, ava_1.default)("passes a code scanning config BUT NOT a qlconfig to the CLI when CLI config passing is enabled", async (t) => {
|
||||||
|
await util.withTmpDir(async (tempDir) => {
|
||||||
|
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||||
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
|
sinon.stub(codeqlObject, "getVersion").resolves("2.12.2");
|
||||||
|
await codeqlObject.databaseInitCluster({ ...stubConfig, tempDir }, "", undefined, (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CliConfigFileEnabled]), "/path/to/qlconfig.yml", (0, logging_1.getRunnerLogger)(true));
|
||||||
|
const args = runnerConstructorStub.firstCall.args[1];
|
||||||
|
// should have used a config file
|
||||||
|
const hasCodeScanningConfigArg = args.some((arg) => arg.startsWith("--codescanning-config="));
|
||||||
|
t.true(hasCodeScanningConfigArg, "Should have injected a codescanning config");
|
||||||
|
// should not have passed a qlconfig file
|
||||||
|
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig-file="));
|
||||||
|
t.false(hasQlconfigArg, "should NOT have injected a qlconfig");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("does not pass a qlconfig to the CLI when it is undefined", async (t) => {
|
||||||
|
await util.withTmpDir(async (tempDir) => {
|
||||||
|
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||||
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
|
sinon
|
||||||
|
.stub(codeqlObject, "getVersion")
|
||||||
|
.resolves(codeql.CODEQL_VERSION_INIT_WITH_QLCONFIG);
|
||||||
|
await codeqlObject.databaseInitCluster({ ...stubConfig, tempDir }, "", undefined, (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CliConfigFileEnabled]), undefined, // undefined qlconfigFile
|
||||||
|
(0, logging_1.getRunnerLogger)(true));
|
||||||
|
const args = runnerConstructorStub.firstCall.args[1];
|
||||||
|
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig-file="));
|
||||||
|
t.false(hasQlconfigArg, "should NOT have injected a qlconfig");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("databaseInterpretResults() sets --sarif-add-baseline-file-info for 2.11.3", async (t) => {
|
||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
// We need to set a CodeQL version such that running `databaseInterpretResults` does not crash.
|
sinon.stub(codeqlObject, "getVersion").resolves("2.11.3");
|
||||||
// The version of CodeQL is checked separately to determine feature enablement, and does not
|
|
||||||
// otherwise impact this test, so set it to 0.0.0.
|
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves("0.0.0");
|
|
||||||
// safeWhich throws because of the test CodeQL object.
|
// safeWhich throws because of the test CodeQL object.
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||||
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.FileBaselineInformationEnabled]));
|
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", stubConfig, (0, testing_utils_1.createFeatures)([]));
|
||||||
t.true(runnerConstructorStub.firstCall.args[1].includes("--sarif-add-baseline-file-info"), "--sarif-add-baseline-file-info should be present, but it is absent");
|
t.true(runnerConstructorStub.firstCall.args[1].includes("--sarif-add-baseline-file-info"), "--sarif-add-baseline-file-info should be present, but it is absent");
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("databaseInterpretResults() does not set --sarif-add-baseline-file-info if feature disabled", async (t) => {
|
(0, ava_1.default)("databaseInterpretResults() does not set --sarif-add-baseline-file-info for 2.11.2", async (t) => {
|
||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
// We need to set a CodeQL version such that running `databaseInterpretResults` does not crash.
|
sinon.stub(codeqlObject, "getVersion").resolves("2.11.2");
|
||||||
// The version of CodeQL is checked upstream to determine feature enablement, so it does not
|
|
||||||
// affect this test.
|
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves("0.0.0");
|
|
||||||
// safeWhich throws because of the test CodeQL object.
|
// safeWhich throws because of the test CodeQL object.
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||||
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", (0, testing_utils_1.createFeatures)([]));
|
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", stubConfig, (0, testing_utils_1.createFeatures)([]));
|
||||||
t.false(runnerConstructorStub.firstCall.args[1].includes("--sarif-add-baseline-file-info"), "--sarif-add-baseline-file-info must be absent, but it is present");
|
t.false(runnerConstructorStub.firstCall.args[1].includes("--sarif-add-baseline-file-info"), "--sarif-add-baseline-file-info must be absent, but it is present");
|
||||||
});
|
});
|
||||||
function stubToolRunnerConstructor() {
|
function stubToolRunnerConstructor() {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
185
lib/config-utils.js
generated
185
lib/config-utils.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -19,10 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.downloadPacks = exports.getConfig = exports.getPathToParsedConfigFile = exports.initConfig = exports.parsePacks = exports.validatePackSpecification = exports.prettyPrintPack = exports.parsePacksSpecification = exports.parsePacksFromConfig = exports.calculateAugmentation = exports.getDefaultConfig = exports.getRawLanguages = exports.getLanguages = exports.getLanguagesInRepo = exports.getUnknownLanguagesError = exports.getNoLanguagesError = exports.getConfigFileDirectoryGivenMessage = exports.getConfigFileFormatInvalidMessage = exports.getConfigFileRepoFormatInvalidMessage = exports.getConfigFileDoesNotExistErrorMessage = exports.getConfigFileOutsideWorkspaceErrorMessage = exports.getLocalPathDoesNotExist = exports.getLocalPathOutsideOfRepository = exports.getPacksStrInvalid = exports.getPacksInvalid = exports.getPacksInvalidSplit = exports.getPathsInvalid = exports.getPathsIgnoreInvalid = exports.getQueryUsesInvalid = exports.getQueriesMissingUses = exports.getQueriesInvalid = exports.getDisableDefaultQueriesInvalid = exports.getNameInvalid = exports.validateAndSanitisePath = exports.defaultAugmentationProperties = void 0;
|
exports.getGeneratedCodeScanningConfigPath = exports.wrapEnvironment = exports.generateRegistries = exports.downloadPacks = exports.getConfig = exports.getPathToParsedConfigFile = exports.initConfig = exports.parsePacks = exports.validatePackSpecification = exports.prettyPrintPack = exports.parsePacksSpecification = exports.parsePacksFromConfig = exports.calculateAugmentation = exports.getDefaultConfig = exports.getRawLanguages = exports.getLanguages = exports.getLanguagesInRepo = exports.getUnknownLanguagesError = exports.getNoLanguagesError = exports.getConfigFileDirectoryGivenMessage = exports.getConfigFileFormatInvalidMessage = exports.getConfigFileRepoFormatInvalidMessage = exports.getConfigFileDoesNotExistErrorMessage = exports.getConfigFileOutsideWorkspaceErrorMessage = exports.getLocalPathDoesNotExist = exports.getLocalPathOutsideOfRepository = exports.getPacksStrInvalid = exports.getPacksInvalid = exports.getPacksInvalidSplit = exports.getPathsInvalid = exports.getPathsIgnoreInvalid = exports.getQueryUsesInvalid = exports.getQueriesMissingUses = exports.getQueriesInvalid = exports.getDisableDefaultQueriesInvalid = exports.getNameInvalid = exports.validateAndSanitisePath = exports.defaultAugmentationProperties = void 0;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
// We need to import `performance` on Node 12
|
|
||||||
const perf_hooks_1 = require("perf_hooks");
|
const perf_hooks_1 = require("perf_hooks");
|
||||||
const yaml = __importStar(require("js-yaml"));
|
const yaml = __importStar(require("js-yaml"));
|
||||||
const semver = __importStar(require("semver"));
|
const semver = __importStar(require("semver"));
|
||||||
@@ -128,19 +131,28 @@ async function addDefaultQueries(codeQL, languages, resultMap) {
|
|||||||
await runResolveQueries(codeQL, resultMap, suites, undefined);
|
await runResolveQueries(codeQL, resultMap, suites, undefined);
|
||||||
}
|
}
|
||||||
// The set of acceptable values for built-in suites from the codeql bundle
|
// The set of acceptable values for built-in suites from the codeql bundle
|
||||||
const builtinSuites = ["security-extended", "security-and-quality"];
|
const builtinSuites = [
|
||||||
|
"security-experimental",
|
||||||
|
"security-extended",
|
||||||
|
"security-and-quality",
|
||||||
|
];
|
||||||
/**
|
/**
|
||||||
* Determine the set of queries associated with suiteName's suites and add them to resultMap.
|
* Determine the set of queries associated with suiteName's suites and add them to resultMap.
|
||||||
* Throws an error if suiteName is not a valid builtin suite.
|
* Throws an error if suiteName is not a valid builtin suite.
|
||||||
* May inject ML queries, and the return value will declare if this was done.
|
* May inject ML queries, and the return value will declare if this was done.
|
||||||
*/
|
*/
|
||||||
async function addBuiltinSuiteQueries(languages, codeQL, resultMap, packs, suiteName, featureEnablement, configFile) {
|
async function addBuiltinSuiteQueries(languages, codeQL, resultMap, packs, suiteName, features, configFile) {
|
||||||
var _a;
|
|
||||||
let injectedMlQueries = false;
|
let injectedMlQueries = false;
|
||||||
const found = builtinSuites.find((suite) => suite === suiteName);
|
const found = builtinSuites.find((suite) => suite === suiteName);
|
||||||
if (!found) {
|
if (!found) {
|
||||||
throw new Error(getQueryUsesInvalid(configFile, suiteName));
|
throw new Error(getQueryUsesInvalid(configFile, suiteName));
|
||||||
}
|
}
|
||||||
|
if (suiteName === "security-experimental" &&
|
||||||
|
!(await (0, util_1.codeQlVersionAbove)(codeQL, codeql_1.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE))) {
|
||||||
|
throw new Error(`The 'security-experimental' suite is not supported on CodeQL CLI versions earlier than
|
||||||
|
${codeql_1.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE}. Please upgrade to CodeQL CLI version
|
||||||
|
${codeql_1.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE} or later.`);
|
||||||
|
}
|
||||||
// If we're running the JavaScript security-extended analysis (or a superset of it), the repo is
|
// If we're running the JavaScript security-extended analysis (or a superset of it), the repo is
|
||||||
// opted into the ML-powered queries beta, and a user hasn't already added the ML-powered query
|
// opted into the ML-powered queries beta, and a user hasn't already added the ML-powered query
|
||||||
// pack, then add the ML-powered query pack so that we run ML-powered queries.
|
// pack, then add the ML-powered query pack so that we run ML-powered queries.
|
||||||
@@ -149,9 +161,11 @@ async function addBuiltinSuiteQueries(languages, codeQL, resultMap, packs, suite
|
|||||||
(process.platform !== "win32" ||
|
(process.platform !== "win32" ||
|
||||||
(await (0, util_1.codeQlVersionAbove)(codeQL, codeql_1.CODEQL_VERSION_ML_POWERED_QUERIES_WINDOWS))) &&
|
(await (0, util_1.codeQlVersionAbove)(codeQL, codeql_1.CODEQL_VERSION_ML_POWERED_QUERIES_WINDOWS))) &&
|
||||||
languages.includes("javascript") &&
|
languages.includes("javascript") &&
|
||||||
(found === "security-extended" || found === "security-and-quality") &&
|
(found === "security-experimental" ||
|
||||||
!((_a = packs.javascript) === null || _a === void 0 ? void 0 : _a.some(isMlPoweredJsQueriesPack)) &&
|
found === "security-extended" ||
|
||||||
(await featureEnablement.getValue(feature_flags_1.Feature.MlPoweredQueriesEnabled, codeQL))) {
|
found === "security-and-quality") &&
|
||||||
|
!packs.javascript?.some(isMlPoweredJsQueriesPack) &&
|
||||||
|
(await features.getValue(feature_flags_1.Feature.MlPoweredQueriesEnabled, codeQL))) {
|
||||||
if (!packs.javascript) {
|
if (!packs.javascript) {
|
||||||
packs.javascript = [];
|
packs.javascript = [];
|
||||||
}
|
}
|
||||||
@@ -226,7 +240,7 @@ async function addRemoteQueries(codeQL, resultMap, queryUses, tempDir, apiDetail
|
|||||||
*
|
*
|
||||||
* @returns whether or not we injected ML queries into the packs
|
* @returns whether or not we injected ML queries into the packs
|
||||||
*/
|
*/
|
||||||
async function parseQueryUses(languages, codeQL, resultMap, packs, queryUses, tempDir, workspacePath, apiDetails, featureEnablement, logger, configFile) {
|
async function parseQueryUses(languages, codeQL, resultMap, packs, queryUses, tempDir, workspacePath, apiDetails, features, logger, configFile) {
|
||||||
queryUses = queryUses.trim();
|
queryUses = queryUses.trim();
|
||||||
if (queryUses === "") {
|
if (queryUses === "") {
|
||||||
throw new Error(getQueryUsesInvalid(configFile));
|
throw new Error(getQueryUsesInvalid(configFile));
|
||||||
@@ -238,10 +252,14 @@ async function parseQueryUses(languages, codeQL, resultMap, packs, queryUses, te
|
|||||||
}
|
}
|
||||||
// Check for one of the builtin suites
|
// Check for one of the builtin suites
|
||||||
if (queryUses.indexOf("/") === -1 && queryUses.indexOf("@") === -1) {
|
if (queryUses.indexOf("/") === -1 && queryUses.indexOf("@") === -1) {
|
||||||
return await addBuiltinSuiteQueries(languages, codeQL, resultMap, packs, queryUses, featureEnablement, configFile);
|
return await addBuiltinSuiteQueries(languages, codeQL, resultMap, packs, queryUses, features, configFile);
|
||||||
|
}
|
||||||
|
// Otherwise, must be a reference to another repo.
|
||||||
|
// If config parsing is handled in CLI, then this repo will be downloaded
|
||||||
|
// later by the CLI.
|
||||||
|
if (!(await (0, util_1.useCodeScanningConfigInCli)(codeQL, features))) {
|
||||||
|
await addRemoteQueries(codeQL, resultMap, queryUses, tempDir, apiDetails, logger, configFile);
|
||||||
}
|
}
|
||||||
// Otherwise, must be a reference to another repo
|
|
||||||
await addRemoteQueries(codeQL, resultMap, queryUses, tempDir, apiDetails, logger, configFile);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Regex validating stars in paths or paths-ignore entries.
|
// Regex validating stars in paths or paths-ignore entries.
|
||||||
@@ -485,13 +503,13 @@ async function getRawLanguages(languagesInput, repository, logger) {
|
|||||||
return { rawLanguages, autodetected };
|
return { rawLanguages, autodetected };
|
||||||
}
|
}
|
||||||
exports.getRawLanguages = getRawLanguages;
|
exports.getRawLanguages = getRawLanguages;
|
||||||
async function addQueriesAndPacksFromWorkflow(codeQL, queriesInput, languages, resultMap, packs, tempDir, workspacePath, apiDetails, featureEnablement, logger) {
|
async function addQueriesAndPacksFromWorkflow(codeQL, queriesInput, languages, resultMap, packs, tempDir, workspacePath, apiDetails, features, logger) {
|
||||||
let injectedMlQueries = false;
|
let injectedMlQueries = false;
|
||||||
queriesInput = queriesInput.trim();
|
queriesInput = queriesInput.trim();
|
||||||
// "+" means "don't override config file" - see shouldAddConfigFileQueries
|
// "+" means "don't override config file" - see shouldAddConfigFileQueries
|
||||||
queriesInput = queriesInput.replace(/^\+/, "");
|
queriesInput = queriesInput.replace(/^\+/, "");
|
||||||
for (const query of queriesInput.split(",")) {
|
for (const query of queriesInput.split(",")) {
|
||||||
const didInject = await parseQueryUses(languages, codeQL, resultMap, packs, query, tempDir, workspacePath, apiDetails, featureEnablement, logger);
|
const didInject = await parseQueryUses(languages, codeQL, resultMap, packs, query, tempDir, workspacePath, apiDetails, features, logger);
|
||||||
injectedMlQueries = injectedMlQueries || didInject;
|
injectedMlQueries = injectedMlQueries || didInject;
|
||||||
}
|
}
|
||||||
return injectedMlQueries;
|
return injectedMlQueries;
|
||||||
@@ -509,7 +527,7 @@ function shouldAddConfigFileQueries(queriesInput) {
|
|||||||
/**
|
/**
|
||||||
* Get the default config for when the user has not supplied one.
|
* Get the default config for when the user has not supplied one.
|
||||||
*/
|
*/
|
||||||
async function getDefaultConfig(languagesInput, rawQueriesInput, rawPacksInput, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, featureEnablement, logger) {
|
async function getDefaultConfig(languagesInput, rawQueriesInput, rawPacksInput, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, features, logger) {
|
||||||
const languages = await getLanguages(codeQL, languagesInput, repository, logger);
|
const languages = await getLanguages(codeQL, languagesInput, repository, logger);
|
||||||
const queries = {};
|
const queries = {};
|
||||||
for (const language of languages) {
|
for (const language of languages) {
|
||||||
@@ -527,7 +545,7 @@ async function getDefaultConfig(languagesInput, rawQueriesInput, rawPacksInput,
|
|||||||
: {};
|
: {};
|
||||||
if (rawQueriesInput) {
|
if (rawQueriesInput) {
|
||||||
augmentationProperties.injectedMlQueries =
|
augmentationProperties.injectedMlQueries =
|
||||||
await addQueriesAndPacksFromWorkflow(codeQL, rawQueriesInput, languages, queries, packs, tempDir, workspacePath, apiDetails, featureEnablement, logger);
|
await addQueriesAndPacksFromWorkflow(codeQL, rawQueriesInput, languages, queries, packs, tempDir, workspacePath, apiDetails, features, logger);
|
||||||
}
|
}
|
||||||
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(trapCachingEnabled, codeQL, languages, logger);
|
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(trapCachingEnabled, codeQL, languages, logger);
|
||||||
return {
|
return {
|
||||||
@@ -563,8 +581,7 @@ async function downloadCacheWithTime(trapCachingEnabled, codeQL, languages, logg
|
|||||||
/**
|
/**
|
||||||
* Load the config from the given file.
|
* Load the config from the given file.
|
||||||
*/
|
*/
|
||||||
async function loadConfig(languagesInput, rawQueriesInput, rawPacksInput, configFile, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, featureEnablement, logger) {
|
async function loadConfig(languagesInput, rawQueriesInput, rawPacksInput, configFile, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, features, logger) {
|
||||||
var _a;
|
|
||||||
let parsedYAML;
|
let parsedYAML;
|
||||||
if (isLocal(configFile)) {
|
if (isLocal(configFile)) {
|
||||||
// Treat the config file as relative to the workspace
|
// Treat the config file as relative to the workspace
|
||||||
@@ -605,14 +622,14 @@ async function loadConfig(languagesInput, rawQueriesInput, rawPacksInput, config
|
|||||||
await addDefaultQueries(codeQL, languages, queries);
|
await addDefaultQueries(codeQL, languages, queries);
|
||||||
}
|
}
|
||||||
const augmentationProperties = calculateAugmentation(rawPacksInput, rawQueriesInput, languages);
|
const augmentationProperties = calculateAugmentation(rawPacksInput, rawQueriesInput, languages);
|
||||||
const packs = parsePacks((_a = parsedYAML[PACKS_PROPERTY]) !== null && _a !== void 0 ? _a : {}, rawPacksInput, augmentationProperties.packsInputCombines, languages, configFile, logger);
|
const packs = parsePacks(parsedYAML[PACKS_PROPERTY] ?? {}, rawPacksInput, augmentationProperties.packsInputCombines, languages, configFile, logger);
|
||||||
// If queries were provided using `with` in the action configuration,
|
// If queries were provided using `with` in the action configuration,
|
||||||
// they should take precedence over the queries in the config file
|
// they should take precedence over the queries in the config file
|
||||||
// unless they're prefixed with "+", in which case they supplement those
|
// unless they're prefixed with "+", in which case they supplement those
|
||||||
// in the config file.
|
// in the config file.
|
||||||
if (rawQueriesInput) {
|
if (rawQueriesInput) {
|
||||||
augmentationProperties.injectedMlQueries =
|
augmentationProperties.injectedMlQueries =
|
||||||
await addQueriesAndPacksFromWorkflow(codeQL, rawQueriesInput, languages, queries, packs, tempDir, workspacePath, apiDetails, featureEnablement, logger);
|
await addQueriesAndPacksFromWorkflow(codeQL, rawQueriesInput, languages, queries, packs, tempDir, workspacePath, apiDetails, features, logger);
|
||||||
}
|
}
|
||||||
if (shouldAddConfigFileQueries(rawQueriesInput) &&
|
if (shouldAddConfigFileQueries(rawQueriesInput) &&
|
||||||
QUERIES_PROPERTY in parsedYAML) {
|
QUERIES_PROPERTY in parsedYAML) {
|
||||||
@@ -624,7 +641,7 @@ async function loadConfig(languagesInput, rawQueriesInput, rawPacksInput, config
|
|||||||
if (typeof query[QUERIES_USES_PROPERTY] !== "string") {
|
if (typeof query[QUERIES_USES_PROPERTY] !== "string") {
|
||||||
throw new Error(getQueriesMissingUses(configFile));
|
throw new Error(getQueriesMissingUses(configFile));
|
||||||
}
|
}
|
||||||
await parseQueryUses(languages, codeQL, queries, packs, query[QUERIES_USES_PROPERTY], tempDir, workspacePath, apiDetails, featureEnablement, logger, configFile);
|
await parseQueryUses(languages, codeQL, queries, packs, query[QUERIES_USES_PROPERTY], tempDir, workspacePath, apiDetails, features, logger, configFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (PATHS_IGNORE_PROPERTY in parsedYAML) {
|
if (PATHS_IGNORE_PROPERTY in parsedYAML) {
|
||||||
@@ -696,7 +713,7 @@ function calculateAugmentation(rawPacksInput, rawQueriesInput, languages) {
|
|||||||
return {
|
return {
|
||||||
injectedMlQueries: false,
|
injectedMlQueries: false,
|
||||||
packsInputCombines,
|
packsInputCombines,
|
||||||
packsInput: packsInput === null || packsInput === void 0 ? void 0 : packsInput[languages[0]],
|
packsInput: packsInput?.[languages[0]],
|
||||||
queriesInput,
|
queriesInput,
|
||||||
queriesInputCombines,
|
queriesInputCombines,
|
||||||
};
|
};
|
||||||
@@ -708,7 +725,7 @@ function parseQueriesFromInput(rawQueriesInput, queriesInputCombines) {
|
|||||||
}
|
}
|
||||||
const trimmedInput = queriesInputCombines
|
const trimmedInput = queriesInputCombines
|
||||||
? rawQueriesInput.trim().slice(1).trim()
|
? rawQueriesInput.trim().slice(1).trim()
|
||||||
: rawQueriesInput === null || rawQueriesInput === void 0 ? void 0 : rawQueriesInput.trim();
|
: rawQueriesInput?.trim() ?? "";
|
||||||
if (queriesInputCombines && trimmedInput.length === 0) {
|
if (queriesInputCombines && trimmedInput.length === 0) {
|
||||||
throw new Error(getConfigFilePropertyError(undefined, "queries", "A '+' was used in the 'queries' input to specify that you wished to add some packs to your CodeQL analysis. However, no packs were specified. Please either remove the '+' or specify some packs."));
|
throw new Error(getConfigFilePropertyError(undefined, "queries", "A '+' was used in the 'queries' input to specify that you wished to add some packs to your CodeQL analysis. However, no packs were specified. Please either remove the '+' or specify some packs."));
|
||||||
}
|
}
|
||||||
@@ -761,7 +778,7 @@ function parsePacksFromConfig(packsByLanguage, languages, configFile, logger) {
|
|||||||
}
|
}
|
||||||
exports.parsePacksFromConfig = parsePacksFromConfig;
|
exports.parsePacksFromConfig = parsePacksFromConfig;
|
||||||
function parsePacksFromInput(rawPacksInput, languages, packsInputCombines) {
|
function parsePacksFromInput(rawPacksInput, languages, packsInputCombines) {
|
||||||
if (!(rawPacksInput === null || rawPacksInput === void 0 ? void 0 : rawPacksInput.trim())) {
|
if (!rawPacksInput?.trim()) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
if (languages.length > 1) {
|
if (languages.length > 1) {
|
||||||
@@ -888,10 +905,11 @@ exports.parsePacks = parsePacks;
|
|||||||
* Without a '+', an input value will override the corresponding value in the config file.
|
* Without a '+', an input value will override the corresponding value in the config file.
|
||||||
*
|
*
|
||||||
* @param inputValue The input value to process.
|
* @param inputValue The input value to process.
|
||||||
* @returns true if the input value should replace the corresponding value in the config file, false if it should be appended.
|
* @returns true if the input value should replace the corresponding value in the config file,
|
||||||
|
* false if it should be appended.
|
||||||
*/
|
*/
|
||||||
function shouldCombine(inputValue) {
|
function shouldCombine(inputValue) {
|
||||||
return !!(inputValue === null || inputValue === void 0 ? void 0 : inputValue.trim().startsWith("+"));
|
return !!inputValue?.trim().startsWith("+");
|
||||||
}
|
}
|
||||||
function combinePacks(packs1, packs2) {
|
function combinePacks(packs1, packs2) {
|
||||||
const packs = {};
|
const packs = {};
|
||||||
@@ -914,35 +932,34 @@ function dbLocationOrDefault(dbLocation, tempDir) {
|
|||||||
* This will parse the config from the user input if present, or generate
|
* This will parse the config from the user input if present, or generate
|
||||||
* a default config. The parsed config is then stored to a known location.
|
* a default config. The parsed config is then stored to a known location.
|
||||||
*/
|
*/
|
||||||
async function initConfig(languagesInput, queriesInput, packsInput, registriesInput, configFile, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, featureEnablement, logger) {
|
async function initConfig(languagesInput, queriesInput, packsInput, registriesInput, configFile, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, features, logger) {
|
||||||
var _a, _b, _c;
|
|
||||||
let config;
|
let config;
|
||||||
// If no config file was provided create an empty one
|
// If no config file was provided create an empty one
|
||||||
if (!configFile) {
|
if (!configFile) {
|
||||||
logger.debug("No configuration file was provided");
|
logger.debug("No configuration file was provided");
|
||||||
config = await getDefaultConfig(languagesInput, queriesInput, packsInput, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, featureEnablement, logger);
|
config = await getDefaultConfig(languagesInput, queriesInput, packsInput, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, features, logger);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
config = await loadConfig(languagesInput, queriesInput, packsInput, configFile, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, featureEnablement, logger);
|
config = await loadConfig(languagesInput, queriesInput, packsInput, configFile, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, features, logger);
|
||||||
}
|
|
||||||
// The list of queries should not be empty for any language. If it is then
|
|
||||||
// it is a user configuration error.
|
|
||||||
for (const language of config.languages) {
|
|
||||||
const hasBuiltinQueries = ((_a = config.queries[language]) === null || _a === void 0 ? void 0 : _a.builtin.length) > 0;
|
|
||||||
const hasCustomQueries = ((_b = config.queries[language]) === null || _b === void 0 ? void 0 : _b.custom.length) > 0;
|
|
||||||
const hasPacks = (((_c = config.packs[language]) === null || _c === void 0 ? void 0 : _c.length) || 0) > 0;
|
|
||||||
if (!hasPacks && !hasBuiltinQueries && !hasCustomQueries) {
|
|
||||||
throw new Error(`Did not detect any queries to run for ${language}. ` +
|
|
||||||
"Please make sure that the default queries are enabled, or you are specifying queries to run.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// When using the codescanning config in the CLI, pack downloads
|
// When using the codescanning config in the CLI, pack downloads
|
||||||
// happen in the CLI during the `database init` command, so no need
|
// happen in the CLI during the `database init` command, so no need
|
||||||
// to download them here.
|
// to download them here.
|
||||||
await (0, util_1.logCodeScanningConfigInCli)(codeQL, featureEnablement, logger);
|
await (0, util_1.logCodeScanningConfigInCli)(codeQL, features, logger);
|
||||||
if (!(await (0, util_1.useCodeScanningConfigInCli)(codeQL, featureEnablement))) {
|
if (!(await (0, util_1.useCodeScanningConfigInCli)(codeQL, features))) {
|
||||||
const registries = parseRegistries(registriesInput);
|
// The list of queries should not be empty for any language. If it is then
|
||||||
await downloadPacks(codeQL, config.languages, config.packs, registries, apiDetails, config.tempDir, logger);
|
// it is a user configuration error.
|
||||||
|
// This check occurs in the CLI when it parses the config file.
|
||||||
|
for (const language of config.languages) {
|
||||||
|
const hasBuiltinQueries = config.queries[language]?.builtin.length > 0;
|
||||||
|
const hasCustomQueries = config.queries[language]?.custom.length > 0;
|
||||||
|
const hasPacks = (config.packs[language]?.length || 0) > 0;
|
||||||
|
if (!hasPacks && !hasBuiltinQueries && !hasCustomQueries) {
|
||||||
|
throw new Error(`Did not detect any queries to run for ${language}. ` +
|
||||||
|
"Please make sure that the default queries are enabled, or you are specifying queries to run.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await downloadPacks(codeQL, config.languages, config.packs, apiDetails, registriesInput, config.tempDir, logger);
|
||||||
}
|
}
|
||||||
// Save the config so we can easily access it again in the future
|
// Save the config so we can easily access it again in the future
|
||||||
await saveConfig(config, logger);
|
await saveConfig(config, logger);
|
||||||
@@ -1038,21 +1055,9 @@ async function getConfig(tempDir, logger) {
|
|||||||
return JSON.parse(configString);
|
return JSON.parse(configString);
|
||||||
}
|
}
|
||||||
exports.getConfig = getConfig;
|
exports.getConfig = getConfig;
|
||||||
async function downloadPacks(codeQL, languages, packs, registries, apiDetails, tmpDir, logger) {
|
async function downloadPacks(codeQL, languages, packs, apiDetails, registriesInput, tempDir, logger) {
|
||||||
let qlconfigFile;
|
// This code path is only used when config parsing occurs in the Action.
|
||||||
let registriesAuthTokens;
|
const { registriesAuthTokens, qlconfigFile } = await generateRegistries(registriesInput, codeQL, tempDir, logger);
|
||||||
if (registries) {
|
|
||||||
if (!(await (0, util_1.codeQlVersionAbove)(codeQL, codeql_1.CODEQL_VERSION_GHES_PACK_DOWNLOAD))) {
|
|
||||||
throw new Error(`'registries' input is not supported on CodeQL versions less than ${codeql_1.CODEQL_VERSION_GHES_PACK_DOWNLOAD}.`);
|
|
||||||
}
|
|
||||||
// generate a qlconfig.yml file to hold the registry configs.
|
|
||||||
const qlconfig = createRegistriesBlock(registries);
|
|
||||||
qlconfigFile = path.join(tmpDir, "qlconfig.yml");
|
|
||||||
fs.writeFileSync(qlconfigFile, yaml.dump(qlconfig), "utf8");
|
|
||||||
registriesAuthTokens = registries
|
|
||||||
.map((registry) => `${registry.url}=${registry.token}`)
|
|
||||||
.join(",");
|
|
||||||
}
|
|
||||||
await wrapEnvironment({
|
await wrapEnvironment({
|
||||||
GITHUB_TOKEN: apiDetails.auth,
|
GITHUB_TOKEN: apiDetails.auth,
|
||||||
CODEQL_REGISTRIES_AUTH: registriesAuthTokens,
|
CODEQL_REGISTRIES_AUTH: registriesAuthTokens,
|
||||||
@@ -1061,7 +1066,7 @@ async function downloadPacks(codeQL, languages, packs, registries, apiDetails, t
|
|||||||
logger.startGroup("Downloading packs");
|
logger.startGroup("Downloading packs");
|
||||||
for (const language of languages) {
|
for (const language of languages) {
|
||||||
const packsWithVersion = packs[language];
|
const packsWithVersion = packs[language];
|
||||||
if (packsWithVersion === null || packsWithVersion === void 0 ? void 0 : packsWithVersion.length) {
|
if (packsWithVersion?.length) {
|
||||||
logger.info(`Downloading custom packs for ${language}`);
|
logger.info(`Downloading custom packs for ${language}`);
|
||||||
const results = await codeQL.packDownload(packsWithVersion, qlconfigFile);
|
const results = await codeQL.packDownload(packsWithVersion, qlconfigFile);
|
||||||
numPacksDownloaded += results.packs.length;
|
numPacksDownloaded += results.packs.length;
|
||||||
@@ -1071,7 +1076,7 @@ async function downloadPacks(codeQL, languages, packs, registries, apiDetails, t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (numPacksDownloaded > 0) {
|
if (numPacksDownloaded > 0) {
|
||||||
logger.info(`Downloaded ${numPacksDownloaded} ${packs === 1 ? "pack" : "packs"}`);
|
logger.info(`Downloaded ${numPacksDownloaded} ${numPacksDownloaded === 1 ? "pack" : "packs"}`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.info("No packs to download");
|
logger.info("No packs to download");
|
||||||
@@ -1080,6 +1085,48 @@ async function downloadPacks(codeQL, languages, packs, registries, apiDetails, t
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.downloadPacks = downloadPacks;
|
exports.downloadPacks = downloadPacks;
|
||||||
|
/**
|
||||||
|
* Generate a `qlconfig.yml` file from the `registries` input.
|
||||||
|
* This file is used by the CodeQL CLI to list the registries to use for each
|
||||||
|
* pack.
|
||||||
|
*
|
||||||
|
* @param registriesInput The value of the `registries` input.
|
||||||
|
* @param codeQL a codeQL object, used only for checking the version of CodeQL.
|
||||||
|
* @param tempDir a temporary directory to store the generated qlconfig.yml file.
|
||||||
|
* @param logger a logger object.
|
||||||
|
* @returns The path to the generated `qlconfig.yml` file and the auth tokens to
|
||||||
|
* use for each registry.
|
||||||
|
*/
|
||||||
|
async function generateRegistries(registriesInput, codeQL, tempDir, logger) {
|
||||||
|
const registries = parseRegistries(registriesInput);
|
||||||
|
let registriesAuthTokens;
|
||||||
|
let qlconfigFile;
|
||||||
|
if (registries) {
|
||||||
|
if (!(await (0, util_1.codeQlVersionAbove)(codeQL, codeql_1.CODEQL_VERSION_GHES_PACK_DOWNLOAD))) {
|
||||||
|
throw new Error(`The 'registries' input is not supported on CodeQL CLI versions earlier than ${codeql_1.CODEQL_VERSION_GHES_PACK_DOWNLOAD}. Please upgrade to CodeQL CLI version ${codeql_1.CODEQL_VERSION_GHES_PACK_DOWNLOAD} or later.`);
|
||||||
|
}
|
||||||
|
// generate a qlconfig.yml file to hold the registry configs.
|
||||||
|
const qlconfig = createRegistriesBlock(registries);
|
||||||
|
qlconfigFile = path.join(tempDir, "qlconfig.yml");
|
||||||
|
const qlconfigContents = yaml.dump(qlconfig);
|
||||||
|
fs.writeFileSync(qlconfigFile, qlconfigContents, "utf8");
|
||||||
|
logger.debug("Generated qlconfig.yml:");
|
||||||
|
logger.debug(qlconfigContents);
|
||||||
|
registriesAuthTokens = registries
|
||||||
|
.map((registry) => `${registry.url}=${registry.token}`)
|
||||||
|
.join(",");
|
||||||
|
}
|
||||||
|
if (typeof process.env.CODEQL_REGISTRIES_AUTH === "string") {
|
||||||
|
logger.debug("Using CODEQL_REGISTRIES_AUTH environment variable to authenticate with registries.");
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
registriesAuthTokens:
|
||||||
|
// if the user has explicitly set the CODEQL_REGISTRIES_AUTH env var then use that
|
||||||
|
process.env.CODEQL_REGISTRIES_AUTH ?? registriesAuthTokens,
|
||||||
|
qlconfigFile,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
exports.generateRegistries = generateRegistries;
|
||||||
function createRegistriesBlock(registries) {
|
function createRegistriesBlock(registries) {
|
||||||
if (!Array.isArray(registries) ||
|
if (!Array.isArray(registries) ||
|
||||||
registries.some((r) => !r.url || !r.packages)) {
|
registries.some((r) => !r.url || !r.packages)) {
|
||||||
@@ -1088,7 +1135,7 @@ function createRegistriesBlock(registries) {
|
|||||||
// be sure to remove the `token` field from the registry before writing it to disk.
|
// be sure to remove the `token` field from the registry before writing it to disk.
|
||||||
const safeRegistries = registries.map((registry) => ({
|
const safeRegistries = registries.map((registry) => ({
|
||||||
// ensure the url ends with a slash to avoid a bug in the CLI 2.10.4
|
// ensure the url ends with a slash to avoid a bug in the CLI 2.10.4
|
||||||
url: !(registry === null || registry === void 0 ? void 0 : registry.url.endsWith("/")) ? `${registry.url}/` : registry.url,
|
url: !registry?.url.endsWith("/") ? `${registry.url}/` : registry.url,
|
||||||
packages: registry.packages,
|
packages: registry.packages,
|
||||||
}));
|
}));
|
||||||
const qlconfig = {
|
const qlconfig = {
|
||||||
@@ -1129,4 +1176,14 @@ async function wrapEnvironment(env, operation) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
exports.wrapEnvironment = wrapEnvironment;
|
||||||
|
/**
|
||||||
|
* Get the path to the code scanning configuration generated by the CLI.
|
||||||
|
*
|
||||||
|
* This will not exist if the configuration is being parsed in the Action.
|
||||||
|
*/
|
||||||
|
function getGeneratedCodeScanningConfigPath(config) {
|
||||||
|
return path.resolve(config.tempDir, "user-config.yaml");
|
||||||
|
}
|
||||||
|
exports.getGeneratedCodeScanningConfigPath = getGeneratedCodeScanningConfigPath;
|
||||||
//# sourceMappingURL=config-utils.js.map
|
//# sourceMappingURL=config-utils.js.map
|
||||||
File diff suppressed because one or more lines are too long
95
lib/config-utils.test.js
generated
95
lib/config-utils.test.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -60,6 +64,7 @@ function mockGetContents(content) {
|
|||||||
};
|
};
|
||||||
const spyGetContents = sinon
|
const spyGetContents = sinon
|
||||||
.stub(client.repos, "getContent")
|
.stub(client.repos, "getContent")
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||||
.resolves(response);
|
.resolves(response);
|
||||||
sinon.stub(api, "getApiClient").value(() => client);
|
sinon.stub(api, "getApiClient").value(() => client);
|
||||||
sinon.stub(api, "getApiClientWithExternalAuth").value(() => client);
|
sinon.stub(api, "getApiClientWithExternalAuth").value(() => client);
|
||||||
@@ -74,6 +79,7 @@ function mockListLanguages(languages) {
|
|||||||
for (const language of languages) {
|
for (const language of languages) {
|
||||||
response.data[language] = 123;
|
response.data[language] = 123;
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||||
sinon.stub(client.repos, "listLanguages").resolves(response);
|
sinon.stub(client.repos, "listLanguages").resolves(response);
|
||||||
sinon.stub(api, "getApiClient").value(() => client);
|
sinon.stub(api, "getApiClient").value(() => client);
|
||||||
}
|
}
|
||||||
@@ -930,7 +936,7 @@ const packSpecPrettyPrintingMacro = ava_1.default.macro({
|
|||||||
* Test macro for testing the packs block and the packs input
|
* Test macro for testing the packs block and the packs input
|
||||||
*/
|
*/
|
||||||
function parseInputAndConfigMacro(t, packsFromConfig, packsFromInput, languages, expected) {
|
function parseInputAndConfigMacro(t, packsFromConfig, packsFromInput, languages, expected) {
|
||||||
t.deepEqual(configUtils.parsePacks(packsFromConfig, packsFromInput, !!(packsFromInput === null || packsFromInput === void 0 ? void 0 : packsFromInput.trim().startsWith("+")), // coerce to boolean
|
t.deepEqual(configUtils.parsePacks(packsFromConfig, packsFromInput, !!packsFromInput?.trim().startsWith("+"), // coerce to boolean
|
||||||
languages, "/a/b", mockLogger), expected);
|
languages, "/a/b", mockLogger), expected);
|
||||||
}
|
}
|
||||||
parseInputAndConfigMacro.title = (providedTitle) => `Parse Packs input and config: ${providedTitle}`;
|
parseInputAndConfigMacro.title = (providedTitle) => `Parse Packs input and config: ${providedTitle}`;
|
||||||
@@ -1008,7 +1014,7 @@ const mlPoweredQueriesMacro = ava_1.default.macro({
|
|||||||
// Test that the ~0.1.0 version of ML-powered queries is run on v2.8.3 of the CLI.
|
// Test that the ~0.1.0 version of ML-powered queries is run on v2.8.3 of the CLI.
|
||||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.8.3", true, undefined, "security-extended", process.platform === "win32" ? undefined : "~0.1.0");
|
(0, ava_1.default)(mlPoweredQueriesMacro, "2.8.3", true, undefined, "security-extended", process.platform === "win32" ? undefined : "~0.1.0");
|
||||||
// Test that ML-powered queries aren't run when the user hasn't specified that we should run the
|
// Test that ML-powered queries aren't run when the user hasn't specified that we should run the
|
||||||
// `security-extended` or `security-and-quality` query suite.
|
// `security-extended`, `security-and-quality`, or `security-experimental` query suite.
|
||||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", true, undefined, undefined, undefined);
|
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", true, undefined, undefined, undefined);
|
||||||
// Test that ML-powered queries are run on non-Windows platforms running `security-extended` on
|
// Test that ML-powered queries are run on non-Windows platforms running `security-extended` on
|
||||||
// versions of the CodeQL CLI prior to 2.9.0.
|
// versions of the CodeQL CLI prior to 2.9.0.
|
||||||
@@ -1036,6 +1042,9 @@ const mlPoweredQueriesMacro = ava_1.default.macro({
|
|||||||
// Test that ML-powered queries are run on all platforms running `security-and-quality` on CodeQL
|
// Test that ML-powered queries are run on all platforms running `security-and-quality` on CodeQL
|
||||||
// CLI 2.11.3+.
|
// CLI 2.11.3+.
|
||||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.11.3", true, undefined, "security-and-quality", "~0.4.0");
|
(0, ava_1.default)(mlPoweredQueriesMacro, "2.11.3", true, undefined, "security-and-quality", "~0.4.0");
|
||||||
|
// Test that ML-powered queries are run on all platforms running `security-experimental` on CodeQL
|
||||||
|
// CLI 2.12.1+.
|
||||||
|
(0, ava_1.default)(mlPoweredQueriesMacro, "2.12.1", true, undefined, "security-experimental", "~0.4.0");
|
||||||
const calculateAugmentationMacro = ava_1.default.macro({
|
const calculateAugmentationMacro = ava_1.default.macro({
|
||||||
exec: async (t, _title, rawPacksInput, rawQueriesInput, languages, expectedAugmentationProperties) => {
|
exec: async (t, _title, rawPacksInput, rawQueriesInput, languages, expectedAugmentationProperties) => {
|
||||||
const actualAugmentationProperties = configUtils.calculateAugmentation(rawPacksInput, rawQueriesInput, languages);
|
const actualAugmentationProperties = configUtils.calculateAugmentation(rawPacksInput, rawQueriesInput, languages);
|
||||||
@@ -1105,8 +1114,8 @@ const calculateAugmentationErrorMacro = ava_1.default.macro({
|
|||||||
java: ["a", "b"],
|
java: ["a", "b"],
|
||||||
go: ["c", "d"],
|
go: ["c", "d"],
|
||||||
python: ["e", "f"],
|
python: ["e", "f"],
|
||||||
}, undefined, // registries
|
}, sampleApiDetails, undefined, // registriesAuthTokens
|
||||||
sampleApiDetails, tmpDir, logger);
|
tmpDir, logger);
|
||||||
// Expecting packs to be downloaded once for java and once for python
|
// Expecting packs to be downloaded once for java and once for python
|
||||||
t.deepEqual(packDownloadStub.callCount, 2);
|
t.deepEqual(packDownloadStub.callCount, 2);
|
||||||
// no config file was created, so pass `undefined` as the config file path
|
// no config file was created, so pass `undefined` as the config file path
|
||||||
@@ -1119,9 +1128,9 @@ const calculateAugmentationErrorMacro = ava_1.default.macro({
|
|||||||
// associated env vars
|
// associated env vars
|
||||||
return await util.withTmpDir(async (tmpDir) => {
|
return await util.withTmpDir(async (tmpDir) => {
|
||||||
process.env.GITHUB_TOKEN = "not-a-token";
|
process.env.GITHUB_TOKEN = "not-a-token";
|
||||||
process.env.CODEQL_REGISTRIES_AUTH = "not-a-registries-auth";
|
process.env.CODEQL_REGISTRIES_AUTH = undefined;
|
||||||
const logger = (0, logging_1.getRunnerLogger)(true);
|
const logger = (0, logging_1.getRunnerLogger)(true);
|
||||||
const registries = [
|
const registriesInput = yaml.dump([
|
||||||
{
|
{
|
||||||
// no slash
|
// no slash
|
||||||
url: "http://ghcr.io",
|
url: "http://ghcr.io",
|
||||||
@@ -1134,8 +1143,9 @@ const calculateAugmentationErrorMacro = ava_1.default.macro({
|
|||||||
packages: "semmle/*",
|
packages: "semmle/*",
|
||||||
token: "still-not-a-token",
|
token: "still-not-a-token",
|
||||||
},
|
},
|
||||||
];
|
]);
|
||||||
// append a slash to the first url
|
// append a slash to the first url
|
||||||
|
const registries = yaml.load(registriesInput);
|
||||||
const expectedRegistries = registries.map((r, i) => ({
|
const expectedRegistries = registries.map((r, i) => ({
|
||||||
packages: r.packages,
|
packages: r.packages,
|
||||||
url: i === 0 ? `${r.url}/` : r.url,
|
url: i === 0 ? `${r.url}/` : r.url,
|
||||||
@@ -1164,7 +1174,7 @@ const calculateAugmentationErrorMacro = ava_1.default.macro({
|
|||||||
java: ["a", "b"],
|
java: ["a", "b"],
|
||||||
go: ["c", "d"],
|
go: ["c", "d"],
|
||||||
python: ["e", "f"],
|
python: ["e", "f"],
|
||||||
}, registries, sampleApiDetails, tmpDir, logger);
|
}, sampleApiDetails, registriesInput, tmpDir, logger);
|
||||||
// Same packs are downloaded as in previous test
|
// Same packs are downloaded as in previous test
|
||||||
t.deepEqual(packDownloadStub.callCount, 2);
|
t.deepEqual(packDownloadStub.callCount, 2);
|
||||||
t.deepEqual(packDownloadStub.firstCall.args, [
|
t.deepEqual(packDownloadStub.firstCall.args, [
|
||||||
@@ -1177,7 +1187,7 @@ const calculateAugmentationErrorMacro = ava_1.default.macro({
|
|||||||
]);
|
]);
|
||||||
// Verify that the env vars were unset.
|
// Verify that the env vars were unset.
|
||||||
t.deepEqual(process.env.GITHUB_TOKEN, "not-a-token");
|
t.deepEqual(process.env.GITHUB_TOKEN, "not-a-token");
|
||||||
t.deepEqual(process.env.CODEQL_REGISTRIES_AUTH, "not-a-registries-auth");
|
t.deepEqual(process.env.CODEQL_REGISTRIES_AUTH, undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("downloadPacks-with-registries fails on 2.10.3", async (t) => {
|
(0, ava_1.default)("downloadPacks-with-registries fails on 2.10.3", async (t) => {
|
||||||
@@ -1187,7 +1197,7 @@ const calculateAugmentationErrorMacro = ava_1.default.macro({
|
|||||||
process.env.GITHUB_TOKEN = "not-a-token";
|
process.env.GITHUB_TOKEN = "not-a-token";
|
||||||
process.env.CODEQL_REGISTRIES_AUTH = "not-a-registries-auth";
|
process.env.CODEQL_REGISTRIES_AUTH = "not-a-registries-auth";
|
||||||
const logger = (0, logging_1.getRunnerLogger)(true);
|
const logger = (0, logging_1.getRunnerLogger)(true);
|
||||||
const registries = [
|
const registriesInput = yaml.dump([
|
||||||
{
|
{
|
||||||
url: "http://ghcr.io",
|
url: "http://ghcr.io",
|
||||||
packages: ["codeql/*", "dsp-testing/*"],
|
packages: ["codeql/*", "dsp-testing/*"],
|
||||||
@@ -1198,12 +1208,12 @@ const calculateAugmentationErrorMacro = ava_1.default.macro({
|
|||||||
packages: "semmle/*",
|
packages: "semmle/*",
|
||||||
token: "still-not-a-token",
|
token: "still-not-a-token",
|
||||||
},
|
},
|
||||||
];
|
]);
|
||||||
const codeQL = (0, codeql_1.setCodeQL)({
|
const codeQL = (0, codeql_1.setCodeQL)({
|
||||||
getVersion: () => Promise.resolve("2.10.3"),
|
getVersion: () => Promise.resolve("2.10.3"),
|
||||||
});
|
});
|
||||||
await t.throwsAsync(async () => {
|
await t.throwsAsync(async () => {
|
||||||
return await configUtils.downloadPacks(codeQL, [languages_1.Language.javascript, languages_1.Language.java, languages_1.Language.python], {}, registries, sampleApiDetails, tmpDir, logger);
|
return await configUtils.downloadPacks(codeQL, [languages_1.Language.javascript, languages_1.Language.java, languages_1.Language.python], {}, sampleApiDetails, registriesInput, tmpDir, logger);
|
||||||
}, { instanceOf: Error }, "'registries' input is not supported on CodeQL versions less than 2.10.4.");
|
}, { instanceOf: Error }, "'registries' input is not supported on CodeQL versions less than 2.10.4.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1214,7 +1224,7 @@ const calculateAugmentationErrorMacro = ava_1.default.macro({
|
|||||||
process.env.GITHUB_TOKEN = "not-a-token";
|
process.env.GITHUB_TOKEN = "not-a-token";
|
||||||
process.env.CODEQL_REGISTRIES_AUTH = "not-a-registries-auth";
|
process.env.CODEQL_REGISTRIES_AUTH = "not-a-registries-auth";
|
||||||
const logger = (0, logging_1.getRunnerLogger)(true);
|
const logger = (0, logging_1.getRunnerLogger)(true);
|
||||||
const registries = [
|
const registriesInput = yaml.dump([
|
||||||
{
|
{
|
||||||
// missing url property
|
// missing url property
|
||||||
packages: ["codeql/*", "dsp-testing/*"],
|
packages: ["codeql/*", "dsp-testing/*"],
|
||||||
@@ -1225,15 +1235,68 @@ const calculateAugmentationErrorMacro = ava_1.default.macro({
|
|||||||
packages: "semmle/*",
|
packages: "semmle/*",
|
||||||
token: "still-not-a-token",
|
token: "still-not-a-token",
|
||||||
},
|
},
|
||||||
];
|
]);
|
||||||
const codeQL = (0, codeql_1.setCodeQL)({
|
const codeQL = (0, codeql_1.setCodeQL)({
|
||||||
getVersion: () => Promise.resolve("2.10.4"),
|
getVersion: () => Promise.resolve("2.10.4"),
|
||||||
});
|
});
|
||||||
await t.throwsAsync(async () => {
|
await t.throwsAsync(async () => {
|
||||||
return await configUtils.downloadPacks(codeQL, [languages_1.Language.javascript, languages_1.Language.java, languages_1.Language.python], {}, registries, sampleApiDetails, tmpDir, logger);
|
return await configUtils.downloadPacks(codeQL, [languages_1.Language.javascript, languages_1.Language.java, languages_1.Language.python], {}, sampleApiDetails, registriesInput, tmpDir, logger);
|
||||||
}, { instanceOf: Error }, "Invalid 'registries' input. Must be an array of objects with 'url' and 'packages' properties.");
|
}, { instanceOf: Error }, "Invalid 'registries' input. Must be an array of objects with 'url' and 'packages' properties.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// the happy path for generateRegistries is already tested in downloadPacks.
|
||||||
|
// these following tests are for the error cases and when nothing is generated.
|
||||||
|
(0, ava_1.default)("no generateRegistries when CLI is too old", async (t) => {
|
||||||
|
return await util.withTmpDir(async (tmpDir) => {
|
||||||
|
const registriesInput = yaml.dump([
|
||||||
|
{
|
||||||
|
// no slash
|
||||||
|
url: "http://ghcr.io",
|
||||||
|
packages: ["codeql/*", "dsp-testing/*"],
|
||||||
|
token: "not-a-token",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const codeQL = (0, codeql_1.setCodeQL)({
|
||||||
|
// Accepted CLI versions are 2.10.4 or higher
|
||||||
|
getVersion: () => Promise.resolve("2.10.3"),
|
||||||
|
});
|
||||||
|
const logger = (0, logging_1.getRunnerLogger)(true);
|
||||||
|
await t.throwsAsync(async () => await configUtils.generateRegistries(registriesInput, codeQL, tmpDir, logger), undefined, "'registries' input is not supported on CodeQL versions less than 2.10.4.");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("no generateRegistries when registries is undefined", async (t) => {
|
||||||
|
return await util.withTmpDir(async (tmpDir) => {
|
||||||
|
const registriesInput = undefined;
|
||||||
|
const codeQL = (0, codeql_1.setCodeQL)({
|
||||||
|
// Accepted CLI versions are 2.10.4 or higher
|
||||||
|
getVersion: () => Promise.resolve(codeql_1.CODEQL_VERSION_GHES_PACK_DOWNLOAD),
|
||||||
|
});
|
||||||
|
const logger = (0, logging_1.getRunnerLogger)(true);
|
||||||
|
const { registriesAuthTokens, qlconfigFile } = await configUtils.generateRegistries(registriesInput, codeQL, tmpDir, logger);
|
||||||
|
t.is(registriesAuthTokens, undefined);
|
||||||
|
t.is(qlconfigFile, undefined);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("generateRegistries prefers original CODEQL_REGISTRIES_AUTH", async (t) => {
|
||||||
|
return await util.withTmpDir(async (tmpDir) => {
|
||||||
|
process.env.CODEQL_REGISTRIES_AUTH = "original";
|
||||||
|
const registriesInput = yaml.dump([
|
||||||
|
{
|
||||||
|
url: "http://ghcr.io",
|
||||||
|
packages: ["codeql/*", "dsp-testing/*"],
|
||||||
|
token: "not-a-token",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const codeQL = (0, codeql_1.setCodeQL)({
|
||||||
|
// Accepted CLI versions are 2.10.4 or higher
|
||||||
|
getVersion: () => Promise.resolve(codeql_1.CODEQL_VERSION_GHES_PACK_DOWNLOAD),
|
||||||
|
});
|
||||||
|
const logger = (0, logging_1.getRunnerLogger)(true);
|
||||||
|
const { registriesAuthTokens, qlconfigFile } = await configUtils.generateRegistries(registriesInput, codeQL, tmpDir, logger);
|
||||||
|
t.is(registriesAuthTokens, "original");
|
||||||
|
t.is(qlconfigFile, path.join(tmpDir, "qlconfig.yml"));
|
||||||
|
});
|
||||||
|
});
|
||||||
// getLanguages
|
// getLanguages
|
||||||
const mockRepositoryNwo = (0, repository_1.parseRepositoryNwo)("owner/repo");
|
const mockRepositoryNwo = (0, repository_1.parseRepositoryNwo)("owner/repo");
|
||||||
// eslint-disable-next-line github/array-foreach
|
// eslint-disable-next-line github/array-foreach
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
48
lib/database-upload.js
generated
48
lib/database-upload.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -44,24 +48,32 @@ async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
|||||||
const client = (0, api_client_1.getApiClient)();
|
const client = (0, api_client_1.getApiClient)();
|
||||||
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
|
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
|
||||||
for (const language of config.languages) {
|
for (const language of config.languages) {
|
||||||
// Upload the database bundle.
|
|
||||||
// Although we are uploading arbitrary file contents to the API, it's worth
|
|
||||||
// noting that it's the API's job to validate that the contents is acceptable.
|
|
||||||
// This API method is available to anyone with write access to the repo.
|
|
||||||
const payload = fs.readFileSync(await (0, util_1.bundleDb)(config, language, codeql, language));
|
|
||||||
try {
|
try {
|
||||||
await client.request(`POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name`, {
|
// Upload the database bundle.
|
||||||
owner: repositoryNwo.owner,
|
// Although we are uploading arbitrary file contents to the API, it's worth
|
||||||
repo: repositoryNwo.repo,
|
// noting that it's the API's job to validate that the contents is acceptable.
|
||||||
language,
|
// This API method is available to anyone with write access to the repo.
|
||||||
name: `${language}-database`,
|
const bundledDb = await (0, util_1.bundleDb)(config, language, codeql, language);
|
||||||
data: payload,
|
const bundledDbSize = fs.statSync(bundledDb).size;
|
||||||
headers: {
|
const bundledDbReadStream = fs.createReadStream(bundledDb);
|
||||||
authorization: `token ${apiDetails.auth}`,
|
try {
|
||||||
"Content-Type": "application/zip",
|
await client.request(`POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name`, {
|
||||||
},
|
owner: repositoryNwo.owner,
|
||||||
});
|
repo: repositoryNwo.repo,
|
||||||
logger.debug(`Successfully uploaded database for ${language}`);
|
language,
|
||||||
|
name: `${language}-database`,
|
||||||
|
data: bundledDbReadStream,
|
||||||
|
headers: {
|
||||||
|
authorization: `token ${apiDetails.auth}`,
|
||||||
|
"Content-Type": "application/zip",
|
||||||
|
"Content-Length": bundledDbSize,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
logger.debug(`Successfully uploaded database for ${language}`);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
bundledDbReadStream.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"database-upload.js","sourceRoot":"","sources":["../src/database-upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEzB,4DAA8C;AAC9C,6CAA8D;AAC9D,qCAAqC;AAIrC,6CAA+B;AAC/B,iCAAkC;AAE3B,KAAK,UAAU,eAAe,CACnC,aAA4B,EAC5B,MAAc,EACd,UAA4B,EAC5B,MAAc;IAEd,IAAI,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,MAAM,EAAE;QAC9D,MAAM,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACvE,OAAO;KACR;IAED,iDAAiD;IACjD,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;QAC3D,MAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACjE,OAAO;KACR;IAED,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,wBAAwB,EAAE,CAAC,EAAE;QACnD,4EAA4E;QAC5E,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAC/D,OAAO;KACR;IAED,MAAM,MAAM,GAAG,IAAA,yBAAY,GAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,M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AChC;iBACF,CACF,CAAC;gBACF,MAAM,CAAC,KAAK,CAAC,sCAAsC,QAAQ,EAAE,CAAC,CAAC;aAChE;oBAAS;gBACR,mBAAmB,CAAC,KAAK,EAAE,CAAC;aAC7B;SACF;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACf,4CAA4C;YAC5C,MAAM,CAAC,OAAO,CAAC,iCAAiC,QAAQ,KAAK,CAAC,EAAE,CAAC,CAAC;SACnE;KACF;AACH,CAAC;AA7DD,0CA6DC"}
|
||||||
6
lib/database-upload.test.js
generated
6
lib/database-upload.test.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
6
lib/debug-artifacts.js
generated
6
lib/debug-artifacts.js
generated
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"debug-artifacts.js","sourceRoot":"","sources":["../src/debug-artifacts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,4DAA8C;AAC9C,oDAAsC;AACtC,sDAA6B;AAC7B,8CAAsB;AAEtB,iDAAkD;AAClD,uCAA0C;AAC1C,qCAAiE;AAIjE,iCAMgB;AAEhB,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;AAChD,CAAC;AAFD,kDAEC;AAEM,KAAK,UAAU,oBAAoB,CACxC,QAAkB,EAClB,OAAe,EACf,YAAoB;IAEpB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACzB,OAAO;KACR;IACD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,MAAM,MAAM,GAAG,IAAA,+BAAgB,EAAC,QAAQ,CAAC,CAAC;IAC1C,IAAI,MAAM,EAAE;QACV,IAAI;YACF,KAAK,MAAM,CAAC,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE;gBACnE,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;SA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d,IAAI,CAAC,IAAI,CACP,8CAA8C,MAAM,CAAC,iBAAiB,IAAI,QAAQ,KAAK,KAAK,EAAE,CAC/F,CAAC;SACH;KACF;AACH,CAAC;AA1BD,8EA0BC"}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user