mirror of
https://github.com/github/codeql-action.git
synced 2025-12-11 18:24:43 +08:00
Compare commits
132 Commits
nickfyson/
...
v2.24.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b6a45a6ec | ||
|
|
2ccdcd5135 | ||
|
|
4f50fb3be5 | ||
|
|
02022337ac | ||
|
|
3dafabe4d9 | ||
|
|
40cd785140 | ||
|
|
10746dd61e | ||
|
|
ece8414c72 | ||
|
|
32f8d538f3 | ||
|
|
663c1506d4 | ||
|
|
1a41e5519a | ||
|
|
f00392ec30 | ||
|
|
95d258ab1c | ||
|
|
d57cf8e232 | ||
|
|
729def5a41 | ||
|
|
eb60ca25f8 | ||
|
|
c6cf6fda4d | ||
|
|
7b30fefa68 | ||
|
|
427cfbe9a2 | ||
|
|
bc64d12bb9 | ||
|
|
ecdd69dbae | ||
|
|
191f59f435 | ||
|
|
057a9cbd10 | ||
|
|
1a077f8f6c | ||
|
|
3935424551 | ||
|
|
05d809f630 | ||
|
|
d8c4c3a4eb | ||
|
|
b301568384 | ||
|
|
f5c8be0ac1 | ||
|
|
4504810aa1 | ||
|
|
cf10f87301 | ||
|
|
db663b280b | ||
|
|
e675ced7a7 | ||
|
|
41154da3e4 | ||
|
|
c79c360e02 | ||
|
|
65853b9b29 | ||
|
|
4e5f9c0873 | ||
|
|
77be28fbdb | ||
|
|
4075abfb06 | ||
|
|
5a6da1d85d | ||
|
|
43a8916cbe | ||
|
|
b0346e4adb | ||
|
|
3ab1d29793 | ||
|
|
9a734dafa1 | ||
|
|
8fae32eb18 | ||
|
|
1515e2bb20 | ||
|
|
fc9f9e5ef9 | ||
|
|
f3ced614cb | ||
|
|
932a7d5a59 | ||
|
|
9e39a05578 | ||
|
|
0ab8e2a32a | ||
|
|
8fb654e590 | ||
|
|
0fe34bd39a | ||
|
|
db6e5fff06 | ||
|
|
cf7e9f2349 | ||
|
|
39cc02b1d9 | ||
|
|
15b447d64b | ||
|
|
dc021d495c | ||
|
|
e1fa6ddb4a | ||
|
|
1d4866b058 | ||
|
|
da89f3f4cf | ||
|
|
f822fa3067 | ||
|
|
3ed798ed18 | ||
|
|
5b498ba405 | ||
|
|
7dde705407 | ||
|
|
c004a3e831 | ||
|
|
921adb69c6 | ||
|
|
e8893c57a1 | ||
|
|
78d6c8e84d | ||
|
|
2db0327171 | ||
|
|
f9dea84e29 | ||
|
|
81eb6b2bf4 | ||
|
|
483bef1dab | ||
|
|
b58c2f67a6 | ||
|
|
f7d53249e3 | ||
|
|
254b53d999 | ||
|
|
e34513334c | ||
|
|
463930c71f | ||
|
|
d982a14465 | ||
|
|
55c1fd5777 | ||
|
|
0166a8a567 | ||
|
|
401f9d6286 | ||
|
|
d2e867f3be | ||
|
|
ec42edcaab | ||
|
|
8c22ec9e5d | ||
|
|
68d348377f | ||
|
|
e33271d071 | ||
|
|
eab49d76a3 | ||
|
|
202c383f78 | ||
|
|
cfefe3a7e8 | ||
|
|
25f779c0f2 | ||
|
|
738d232550 | ||
|
|
2f93e4319b | ||
|
|
5c9716f453 | ||
|
|
c98f2c953c | ||
|
|
554c990fe8 | ||
|
|
abe5934e80 | ||
|
|
8879ae88d9 | ||
|
|
01e8d7f881 | ||
|
|
a2c5130ffd | ||
|
|
b7bf0a3ed3 | ||
|
|
9a9b0e4a8f | ||
|
|
33e354b34b | ||
|
|
f4cfe8904c | ||
|
|
61bf02577c | ||
|
|
16150320c5 | ||
|
|
bd67d8d6b2 | ||
|
|
a2619f68c8 | ||
|
|
666e2f9edf | ||
|
|
d43ae36a63 | ||
|
|
75af1f5948 | ||
|
|
65c74964a9 | ||
|
|
2eaf0149ef | ||
|
|
f03430628f | ||
|
|
baaf7d5247 | ||
|
|
c6fd1aa12c | ||
|
|
d0c5ea08fd | ||
|
|
a246aaa40c | ||
|
|
f1915cce98 | ||
|
|
2949ab83fb | ||
|
|
b96e5e1158 | ||
|
|
545bf65803 | ||
|
|
42edda9026 | ||
|
|
bd00f23331 | ||
|
|
d0c848438b | ||
|
|
e86ee7f7b4 | ||
|
|
4f9fb97304 | ||
|
|
a854253aca | ||
|
|
f72cffc780 | ||
|
|
d13ca047ae | ||
|
|
475e2aff08 | ||
|
|
4d7889a2f1 |
4
.github/update-release-branch.py
vendored
4
.github/update-release-branch.py
vendored
@@ -60,7 +60,7 @@ def open_pr(
|
|||||||
|
|
||||||
# Start constructing the body text
|
# Start constructing the body text
|
||||||
body = []
|
body = []
|
||||||
body.append(f'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}.')
|
||||||
@@ -92,7 +92,7 @@ def open_pr(
|
|||||||
'branch to resolve the merge conflicts.')
|
'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(f' - [ ] 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_primary_release:
|
if not is_primary_release:
|
||||||
|
|||||||
88
.github/workflows/__build-mode-autobuild.yml
generated
vendored
Normal file
88
.github/workflows/__build-mode-autobuild.yml
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
|
# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
|
||||||
|
# to regenerate this file.
|
||||||
|
|
||||||
|
name: PR Check - Build mode autobuild
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- releases/v*
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
build-mode-autobuild:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: nightly-latest
|
||||||
|
name: Build mode autobuild
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
timeout-minutes: 45
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Setup Python on MacOS
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
if: >-
|
||||||
|
matrix.os == 'macos-latest' && (
|
||||||
|
|
||||||
|
matrix.version == 'stable-20221211' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-20230418' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-v2.13.5' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-v2.14.6')
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Prepare test
|
||||||
|
id: prepare-test
|
||||||
|
uses: ./.github/actions/prepare-test
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
use-all-platform-bundle: 'false'
|
||||||
|
- name: Set environment variable for Swift enablement
|
||||||
|
if: runner.os != 'Windows' && matrix.version == '20221211'
|
||||||
|
shell: bash
|
||||||
|
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
|
||||||
|
- name: Set up Java test repo configuration
|
||||||
|
run: |
|
||||||
|
mv * .github ../action/tests/multi-language-repo/
|
||||||
|
mv ../action/tests/multi-language-repo/.github/workflows .github
|
||||||
|
mv ../action/tests/java-repo/* .
|
||||||
|
|
||||||
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
|
with:
|
||||||
|
build-mode: autobuild
|
||||||
|
db-location: ${{ runner.temp }}/customDbLocation
|
||||||
|
languages: java
|
||||||
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
|
||||||
|
- name: Validate database build mode
|
||||||
|
run: |
|
||||||
|
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
||||||
|
build_mode=$(yq eval '.buildMode' "$metadata_path")
|
||||||
|
if [[ "$build_mode" != "autobuild" ]]; then
|
||||||
|
echo "Expected build mode to be 'autobuild' but was $build_mode"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- uses: ./../action/analyze
|
||||||
|
env:
|
||||||
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
90
.github/workflows/__build-mode-manual.yml
generated
vendored
Normal file
90
.github/workflows/__build-mode-manual.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:
|
||||||
|
# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
|
||||||
|
# to regenerate this file.
|
||||||
|
|
||||||
|
name: PR Check - Build mode manual
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- releases/v*
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
build-mode-manual:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: nightly-latest
|
||||||
|
name: Build mode manual
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
timeout-minutes: 45
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Setup Python on MacOS
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
if: >-
|
||||||
|
matrix.os == 'macos-latest' && (
|
||||||
|
|
||||||
|
matrix.version == 'stable-20221211' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-20230418' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-v2.13.5' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-v2.14.6')
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Prepare test
|
||||||
|
id: prepare-test
|
||||||
|
uses: ./.github/actions/prepare-test
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
use-all-platform-bundle: 'false'
|
||||||
|
- name: Set environment variable for Swift enablement
|
||||||
|
if: runner.os != 'Windows' && matrix.version == '20221211'
|
||||||
|
shell: bash
|
||||||
|
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
|
||||||
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
|
with:
|
||||||
|
build-mode: manual
|
||||||
|
db-location: ${{ runner.temp }}/customDbLocation
|
||||||
|
languages: java
|
||||||
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
|
||||||
|
- name: Validate database build mode
|
||||||
|
run: |
|
||||||
|
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
||||||
|
build_mode=$(yq eval '.buildMode' "$metadata_path")
|
||||||
|
if [[ "$build_mode" != "manual" ]]; then
|
||||||
|
echo "Expected build mode to be 'manual' but was $build_mode"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- uses: ./../action/.github/actions/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||||
|
|
||||||
|
- name: Build code
|
||||||
|
shell: bash
|
||||||
|
run: ./build.sh
|
||||||
|
|
||||||
|
- uses: ./../action/analyze
|
||||||
|
env:
|
||||||
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
88
.github/workflows/__build-mode-none.yml
generated
vendored
Normal file
88
.github/workflows/__build-mode-none.yml
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
|
# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
|
||||||
|
# to regenerate this file.
|
||||||
|
|
||||||
|
name: PR Check - Build mode none
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- releases/v*
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
build-mode-none:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: latest
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: nightly-latest
|
||||||
|
name: Build mode none
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
timeout-minutes: 45
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Setup Python on MacOS
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
if: >-
|
||||||
|
matrix.os == 'macos-latest' && (
|
||||||
|
|
||||||
|
matrix.version == 'stable-20221211' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-20230418' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-v2.13.5' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-v2.14.6')
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Prepare test
|
||||||
|
id: prepare-test
|
||||||
|
uses: ./.github/actions/prepare-test
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
use-all-platform-bundle: 'false'
|
||||||
|
- name: Set environment variable for Swift enablement
|
||||||
|
if: runner.os != 'Windows' && matrix.version == '20221211'
|
||||||
|
shell: bash
|
||||||
|
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
|
||||||
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
|
with:
|
||||||
|
build-mode: none
|
||||||
|
db-location: ${{ runner.temp }}/customDbLocation
|
||||||
|
languages: java
|
||||||
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
|
||||||
|
- name: Validate database build mode
|
||||||
|
run: |
|
||||||
|
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
||||||
|
build_mode=$(yq eval '.buildMode' "$metadata_path")
|
||||||
|
if [[ "$build_mode" != "none" ]]; then
|
||||||
|
echo "Expected build mode to be 'none' but was $build_mode"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# The latest nightly supports omitting the autobuild Action when the build mode is specified.
|
||||||
|
- uses: ./../action/autobuild
|
||||||
|
if: matrix.version != 'nightly-latest'
|
||||||
|
|
||||||
|
- uses: ./../action/analyze
|
||||||
|
env:
|
||||||
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
89
.github/workflows/__build-mode-rollback.yml
generated
vendored
Normal file
89
.github/workflows/__build-mode-rollback.yml
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
|
# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
|
||||||
|
# to regenerate this file.
|
||||||
|
|
||||||
|
name: PR Check - Build mode rollback
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- releases/v*
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
build-mode-rollback:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: nightly-latest
|
||||||
|
name: Build mode rollback
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
timeout-minutes: 45
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Setup Python on MacOS
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
if: >-
|
||||||
|
matrix.os == 'macos-latest' && (
|
||||||
|
|
||||||
|
matrix.version == 'stable-20221211' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-20230418' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-v2.13.5' ||
|
||||||
|
|
||||||
|
matrix.version == 'stable-v2.14.6')
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Prepare test
|
||||||
|
id: prepare-test
|
||||||
|
uses: ./.github/actions/prepare-test
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
use-all-platform-bundle: 'false'
|
||||||
|
- name: Set environment variable for Swift enablement
|
||||||
|
if: runner.os != 'Windows' && matrix.version == '20221211'
|
||||||
|
shell: bash
|
||||||
|
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
|
||||||
|
- name: Set up Java test repo configuration
|
||||||
|
run: |
|
||||||
|
mv * .github ../action/tests/multi-language-repo/
|
||||||
|
mv ../action/tests/multi-language-repo/.github/workflows .github
|
||||||
|
mv ../action/tests/java-repo/* .
|
||||||
|
|
||||||
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
|
with:
|
||||||
|
build-mode: none
|
||||||
|
db-location: ${{ runner.temp }}/customDbLocation
|
||||||
|
languages: java
|
||||||
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
|
||||||
|
- name: Validate database build mode
|
||||||
|
run: |
|
||||||
|
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
||||||
|
build_mode=$(yq eval '.buildMode' "$metadata_path")
|
||||||
|
if [[ "$build_mode" != "autobuild" ]]; then
|
||||||
|
echo "Expected build mode to be 'autobuild' but was $build_mode"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- uses: ./../action/analyze
|
||||||
|
env:
|
||||||
|
CODEQL_ACTION_DISABLE_JAVA_BUILDLESS: true
|
||||||
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
4
.github/workflows/__config-export.yml
generated
vendored
4
.github/workflows/__config-export.yml
generated
vendored
@@ -101,13 +101,13 @@ jobs:
|
|||||||
core.setFailed('`codeqlConfigSummary` property not found in the SARIF run property bag.');
|
core.setFailed('`codeqlConfigSummary` property not found in the SARIF run property bag.');
|
||||||
}
|
}
|
||||||
if (configSummary.disableDefaultQueries !== false) {
|
if (configSummary.disableDefaultQueries !== false) {
|
||||||
core.setFailed('`disableDefaultQueries` property incorrect: expected false, got ' +
|
core.setFailed('`disableDefaultQueries` property incorrect: expected false, got ' +
|
||||||
`${JSON.stringify(configSummary.disableDefaultQueries)}.`);
|
`${JSON.stringify(configSummary.disableDefaultQueries)}.`);
|
||||||
}
|
}
|
||||||
const expectedQueries = [{ type: 'builtinSuite', uses: 'security-extended' }];
|
const expectedQueries = [{ type: 'builtinSuite', uses: 'security-extended' }];
|
||||||
// Use JSON.stringify to deep-equal the arrays.
|
// Use JSON.stringify to deep-equal the arrays.
|
||||||
if (JSON.stringify(configSummary.queries) !== JSON.stringify(expectedQueries)) {
|
if (JSON.stringify(configSummary.queries) !== JSON.stringify(expectedQueries)) {
|
||||||
core.setFailed(`\`queries\` property incorrect: expected ${JSON.stringify(expectedQueries)}, got ` +
|
core.setFailed(`\`queries\` property incorrect: expected ${JSON.stringify(expectedQueries)}, got ` +
|
||||||
`${JSON.stringify(configSummary.queries)}.`);
|
`${JSON.stringify(configSummary.queries)}.`);
|
||||||
}
|
}
|
||||||
core.info('Finished config export tests.');
|
core.info('Finished config export tests.');
|
||||||
|
|||||||
2
.github/workflows/__diagnostics-export.yml
generated
vendored
2
.github/workflows/__diagnostics-export.yml
generated
vendored
@@ -136,7 +136,7 @@ jobs:
|
|||||||
core.setFailed(
|
core.setFailed(
|
||||||
'Expected exactly one status page reporting descriptor for this diagnostic in the ' +
|
'Expected exactly one status page reporting descriptor for this diagnostic in the ' +
|
||||||
`'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
|
`'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
|
||||||
`${statusPageNotifications.length}. All notification reporting descriptors: ` +
|
`${statusPageNotifications.length}. All notification reporting descriptors: ` +
|
||||||
`${JSON.stringify(toolExecutionNotifications)}.`
|
`${JSON.stringify(toolExecutionNotifications)}.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
2
.github/workflows/__multi-language-autodetect.yml
generated
vendored
2
.github/workflows/__multi-language-autodetect.yml
generated
vendored
@@ -146,7 +146,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Check language autodetect for Swift
|
- name: Check language autodetect for Swift
|
||||||
if: >-
|
if: >-
|
||||||
env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true' ||
|
env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true' ||
|
||||||
(runner.os != 'Windows' && matrix.version == 'nightly-latest')
|
(runner.os != 'Windows' && matrix.version == 'nightly-latest')
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
37
.github/workflows/__with-checkout-path.yml
generated
vendored
37
.github/workflows/__with-checkout-path.yml
generated
vendored
@@ -25,48 +25,12 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-20221211
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-20221211
|
|
||||||
- os: windows-latest
|
|
||||||
version: stable-20221211
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-20230418
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-20230418
|
|
||||||
- os: windows-latest
|
|
||||||
version: stable-20230418
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.13.5
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.13.5
|
|
||||||
- os: windows-latest
|
|
||||||
version: stable-v2.13.5
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.14.6
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.14.6
|
|
||||||
- os: windows-latest
|
|
||||||
version: stable-v2.14.6
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: windows-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: latest
|
version: latest
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
version: latest
|
version: latest
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
version: latest
|
version: latest
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Use a custom `checkout_path`
|
name: Use a custom `checkout_path`
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -120,7 +84,6 @@ jobs:
|
|||||||
# it's enough to test one compiled language and one interpreted language
|
# it's enough to test one compiled language and one interpreted language
|
||||||
languages: csharp,javascript
|
languages: csharp,javascript
|
||||||
source-root: x/y/z/some-path/tests/multi-language-repo
|
source-root: x/y/z/some-path/tests/multi-language-repo
|
||||||
debug: true
|
|
||||||
|
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
134
.github/workflows/codeql.yml
vendored
134
.github/workflows/codeql.yml
vendored
@@ -1,68 +1,98 @@
|
|||||||
# For most projects, this workflow file will not need changing; you simply need
|
name: "CodeQL action"
|
||||||
# to commit it to your repository.
|
|
||||||
#
|
|
||||||
# You may wish to alter this file to override the set of languages analyzed,
|
|
||||||
# or to provide custom queries or build logic.
|
|
||||||
#
|
|
||||||
# ******** NOTE ********
|
|
||||||
# We have attempted to detect the languages in your repository. Please check
|
|
||||||
# the `language` matrix defined below to confirm you have the correct set of
|
|
||||||
# supported CodeQL languages.
|
|
||||||
#
|
|
||||||
name: "CodeQL"
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, releases/v*]
|
||||||
|
pull_request:
|
||||||
|
branches: [main, releases/v*]
|
||||||
|
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
||||||
|
# by other workflows.
|
||||||
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
|
schedule:
|
||||||
|
# Weekly on Sunday.
|
||||||
|
- cron: '30 1 * * 0'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
# Identify the CodeQL tool versions to use in the analysis job.
|
||||||
name: Analyze
|
check-codeql-versions:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
versions: ${{ steps.compare.outputs.versions }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
security-events: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Init with default CodeQL bundle from the VM image
|
||||||
|
id: init-default
|
||||||
|
uses: ./init
|
||||||
|
with:
|
||||||
|
languages: javascript
|
||||||
|
- name: Remove empty database
|
||||||
|
# allows us to run init a second time
|
||||||
|
run: |
|
||||||
|
rm -rf "$RUNNER_TEMP/codeql_databases"
|
||||||
|
- name: Init with latest CodeQL bundle
|
||||||
|
id: init-latest
|
||||||
|
uses: ./init
|
||||||
|
with:
|
||||||
|
tools: latest
|
||||||
|
languages: javascript
|
||||||
|
- name: Compare default and latest CodeQL bundle versions
|
||||||
|
id: compare
|
||||||
|
env:
|
||||||
|
CODEQL_DEFAULT: ${{ steps.init-default.outputs.codeql-path }}
|
||||||
|
CODEQL_LATEST: ${{ steps.init-latest.outputs.codeql-path }}
|
||||||
|
run: |
|
||||||
|
CODEQL_VERSION_DEFAULT="$("$CODEQL_DEFAULT" version --format terse)"
|
||||||
|
CODEQL_VERSION_LATEST="$("$CODEQL_LATEST" version --format terse)"
|
||||||
|
echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT"
|
||||||
|
echo "Latest CodeQL bundle version is $CODEQL_VERSION_LATEST"
|
||||||
|
|
||||||
|
# If we're running on a pull request, run with both bundles, even if `tools: latest` would
|
||||||
|
# be the same as `tools: null`. This allows us to make the job for each of the bundles a
|
||||||
|
# required status check.
|
||||||
|
#
|
||||||
|
# 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`.
|
||||||
|
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
|
||||||
|
VERSIONS_JSON='[null]'
|
||||||
|
else
|
||||||
|
VERSIONS_JSON='[null, "latest"]'
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Output a JSON-encoded list with the distinct versions to test against.
|
||||||
|
echo "Suggested matrix config for analysis job: $VERSIONS_JSON"
|
||||||
|
echo "versions=${VERSIONS_JSON}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: [check-codeql-versions]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
language: [ 'javascript' ]
|
os: [ubuntu-20.04,ubuntu-22.04,windows-2019,windows-2022,macos-11,macos-12,macos-13]
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }}
|
||||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@nickfyson/testing
|
uses: ./init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: javascript
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
config-file: ./.github/codeql/codeql-config.yml
|
||||||
# By default, queries listed here will override any specified in a config file.
|
tools: ${{ matrix.tools }}
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
# confirm steps.init.outputs.codeql-path points to the codeql binary
|
||||||
|
- name: Print CodeQL Version
|
||||||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
run: ${{steps.init.outputs.codeql-path}} version --format=json
|
||||||
# queries: security-extended,security-and-quality
|
|
||||||
|
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
|
||||||
- name: Autobuild
|
|
||||||
uses: github/codeql-action/autobuild@nickfyson/testing
|
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
|
||||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
||||||
|
|
||||||
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
|
||||||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
|
||||||
|
|
||||||
# - run: |
|
|
||||||
# echo "Run, Build Application using script"
|
|
||||||
# ./location_of_script_within_repo/buildscript.sh
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@nickfyson/testing
|
uses: ./analyze
|
||||||
with:
|
|
||||||
category: "/language:${{matrix.language}}"
|
|
||||||
|
|||||||
41
.github/workflows/debug-artifacts-failure.yml
vendored
41
.github/workflows/debug-artifacts-failure.yml
vendored
@@ -20,15 +20,12 @@ on:
|
|||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
jobs:
|
jobs:
|
||||||
upload-artifacts:
|
upload-artifacts:
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macos-latest]
|
|
||||||
name: Upload debug artifacts after failure in analyze
|
name: Upload debug artifacts after failure in analyze
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Dump GitHub event
|
- name: Dump GitHub event
|
||||||
run: cat "${GITHUB_EVENT_PATH}"
|
run: cat "${GITHUB_EVENT_PATH}"
|
||||||
@@ -67,27 +64,23 @@ jobs:
|
|||||||
- name: Check expected artifacts exist
|
- name: Check expected artifacts exist
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
OPERATING_SYSTEMS="ubuntu-latest macos-latest"
|
|
||||||
LANGUAGES="cpp csharp go java javascript python"
|
LANGUAGES="cpp csharp go java javascript python"
|
||||||
for os in $OPERATING_SYSTEMS; do
|
cd "./my-debug-artifacts"
|
||||||
pushd "./my-debug-artifacts-$os"
|
echo "Artifacts from run:"
|
||||||
echo "Artifacts from run on $os:"
|
for language in $LANGUAGES; do
|
||||||
for language in $LANGUAGES; do
|
echo "- Checking $language"
|
||||||
echo "- Checking $language"
|
if [[ ! -f "my-db-$language-partial.zip" ]] ; then
|
||||||
if [[ ! -f "my-db-$language-partial.zip" ]] ; then
|
echo "Missing a partial database bundle for $language"
|
||||||
echo "Missing a partial database bundle for $language"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
if [[ ! -d "log" ]] ; then
|
||||||
if [[ ! -d "log" ]] ; then
|
echo "Missing database initialization logs"
|
||||||
echo "Missing database initialization logs"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
if [[ ! "$language" == "go" ]] && [[ ! -d "$language/log" ]] ; then
|
||||||
if [[ ! "$language" == "go" ]] && [[ ! -d "$language/log" ]] ; then
|
echo "Missing logs for $language"
|
||||||
echo "Missing logs for $language"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
done
|
done
|
||||||
env:
|
env:
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
|||||||
51
.github/workflows/debug-artifacts.yml
vendored
51
.github/workflows/debug-artifacts.yml
vendored
@@ -21,9 +21,6 @@ jobs:
|
|||||||
upload-artifacts:
|
upload-artifacts:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
|
||||||
- ubuntu-latest
|
|
||||||
- macos-latest
|
|
||||||
version:
|
version:
|
||||||
- stable-20221211
|
- stable-20221211
|
||||||
- stable-20230418
|
- stable-20230418
|
||||||
@@ -36,7 +33,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -48,16 +45,6 @@ jobs:
|
|||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ^1.13.1
|
go-version: ^1.13.1
|
||||||
- name: Setup Python on MacOS
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
if: |
|
|
||||||
matrix.os == 'macos-latest' && (
|
|
||||||
matrix.version == 'stable-20221211' ||
|
|
||||||
matrix.version == 'stable-20230418' ||
|
|
||||||
matrix.version == 'stable-v2.13.5' ||
|
|
||||||
matrix.version == 'stable-v2.14.6')
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
id: init
|
id: init
|
||||||
with:
|
with:
|
||||||
@@ -87,26 +74,24 @@ jobs:
|
|||||||
VERSIONS="stable-20221211 stable-20230418 stable-v2.13.5 stable-v2.14.6 default latest nightly-latest"
|
VERSIONS="stable-20221211 stable-20230418 stable-v2.13.5 stable-v2.14.6 default latest nightly-latest"
|
||||||
LANGUAGES="cpp csharp go java javascript python"
|
LANGUAGES="cpp csharp go java javascript python"
|
||||||
for version in $VERSIONS; do
|
for version in $VERSIONS; do
|
||||||
for os in ubuntu-latest macos-latest; do
|
pushd "./my-debug-artifacts-${version//./}"
|
||||||
pushd "./my-debug-artifacts-$os-${version//./}"
|
echo "Artifacts from version $version:"
|
||||||
echo "Artifacts from version $version on $os:"
|
for language in $LANGUAGES; do
|
||||||
for language in $LANGUAGES; do
|
echo "- Checking $language"
|
||||||
echo "- Checking $language"
|
if [[ ! -f "$language.sarif" ]] ; then
|
||||||
if [[ ! -f "$language.sarif" ]] ; then
|
echo "Missing a SARIF file for $language"
|
||||||
echo "Missing a SARIF file for $language"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
if [[ ! -f "my-db-$language.zip" ]] ; then
|
||||||
if [[ ! -f "my-db-$language.zip" ]] ; then
|
echo "Missing a database bundle for $language"
|
||||||
echo "Missing a database bundle for $language"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
if [[ ! -d "$language/log" ]] ; then
|
||||||
if [[ ! -d "$language/log" ]] ; then
|
echo "Missing logs for $language"
|
||||||
echo "Missing logs for $language"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
done
|
done
|
||||||
|
popd
|
||||||
done
|
done
|
||||||
env:
|
env:
|
||||||
GO111MODULE: auto
|
GO111MODULE: auto
|
||||||
|
|||||||
17
.github/workflows/rebuild.yml
vendored
17
.github/workflows/rebuild.yml
vendored
@@ -24,6 +24,23 @@ jobs:
|
|||||||
gh pr edit --repo github/codeql-action "$PR_NUMBER" \
|
gh pr edit --repo github/codeql-action "$PR_NUMBER" \
|
||||||
--remove-label "Rebuild"
|
--remove-label "Rebuild"
|
||||||
|
|
||||||
|
- name: Merge in changes from base branch
|
||||||
|
env:
|
||||||
|
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
|
||||||
|
run: |
|
||||||
|
git fetch origin "$BASE_BRANCH"
|
||||||
|
|
||||||
|
# Allow merge conflicts in `lib`, since rebuilding should resolve them.
|
||||||
|
git merge "origin/$BASE_BRANCH" || echo "Merge conflicts detected"
|
||||||
|
|
||||||
|
# Check for merge conflicts outside of `lib`. Disable git diff's trailing whitespace check
|
||||||
|
# since `node_modules/@types/semver/README.md` fails it.
|
||||||
|
if git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/'; then
|
||||||
|
echo "Merge conflicts detected outside of lib/ directory. Please resolve them manually."
|
||||||
|
git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/' || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Compile TypeScript
|
- name: Compile TypeScript
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npm install
|
||||||
|
|||||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,2 +1,7 @@
|
|||||||
# Ignore for example failing-tests.json from AVA
|
# Ignore for example failing-tests.json from AVA
|
||||||
node_modules/.cache
|
node_modules/.cache/
|
||||||
|
# Java build files
|
||||||
|
.gradle/
|
||||||
|
*.class
|
||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
|||||||
18
CHANGELOG.md
18
CHANGELOG.md
@@ -4,9 +4,23 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
|
|||||||
|
|
||||||
Note that the only difference between `v2` and `v3` of the CodeQL Action is the node version they support, with `v3` running on node 20 while we continue to release `v2` to support running on node 16. For example `3.22.11` was the first `v3` release and is functionally identical to `2.22.11`. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.
|
Note that the only difference between `v2` and `v3` of the CodeQL Action is the node version they support, with `v3` running on node 20 while we continue to release `v2` to support running on node 16. For example `3.22.11` was the first `v3` release and is functionally identical to `2.22.11`. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.
|
||||||
|
|
||||||
## 2.22.12 - 22 Dec 2023
|
## 2.24.2 - 15 Feb 2024
|
||||||
|
|
||||||
No user facing changes.
|
- Enable improved multi-threaded performance on larger runners for GitHub Enterprise Server users. This feature is already available to GitHub.com users. [#2141](https://github.com/github/codeql-action/pull/2141)
|
||||||
|
|
||||||
|
## 2.24.1 - 13 Feb 2024
|
||||||
|
|
||||||
|
- Update default CodeQL bundle version to 2.16.2. [#2124](https://github.com/github/codeql-action/pull/2124)
|
||||||
|
- The CodeQL action no longer fails if it can't write to the telemetry api endpoint. [#2121](https://github.com/github/codeql-action/pull/2121)
|
||||||
|
|
||||||
|
## 2.24.0 - 02 Feb 2024
|
||||||
|
|
||||||
|
- CodeQL Python analysis will no longer install dependencies on GitHub Enterprise Server, as is already the case for GitHub.com. See [release notes for 3.23.0](#3230---08-jan-2024) for more details. [#2106](https://github.com/github/codeql-action/pull/2106)
|
||||||
|
|
||||||
|
## 2.23.2 - 26 Jan 2024
|
||||||
|
|
||||||
|
- On Linux, the maximum possible value for the `--threads` option now respects the CPU count as specified in `cgroup` files to more accurately reflect the number of available cores when running in containers. [#2083](https://github.com/github/codeql-action/pull/2083)
|
||||||
|
- Update default CodeQL bundle version to 2.16.1. [#2096](https://github.com/github/codeql-action/pull/2096)
|
||||||
|
|
||||||
## 2.23.1 - 17 Jan 2024
|
## 2.23.1 - 17 Jan 2024
|
||||||
|
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -16,6 +16,19 @@ We recommend using default setup to configure CodeQL analysis for your repositor
|
|||||||
|
|
||||||
You can also configure advanced setup for a repository to find security vulnerabilities in your code using a highly customizable code scanning configuration. For more information, see "[Configuring advanced setup for code scanning](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning)" and "[Customizing your advanced setup for code scanning](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning)."
|
You can also configure advanced setup for a repository to find security vulnerabilities in your code using a highly customizable code scanning configuration. For more information, see "[Configuring advanced setup for code scanning](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning)" and "[Customizing your advanced setup for code scanning](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning)."
|
||||||
|
|
||||||
|
## Supported versions of the CodeQL Action
|
||||||
|
|
||||||
|
The following versions of the CodeQL Action are currently supported:
|
||||||
|
|
||||||
|
- v3 (latest)
|
||||||
|
- v2 (deprecated, support will end on December 5th, 2024)
|
||||||
|
|
||||||
|
The only difference between CodeQL Action v2 and v3 is the version of Node.js on which they run. CodeQL Action v3 runs on Node 20, while CodeQL Action v2 runs on Node 16.
|
||||||
|
|
||||||
|
To provide the best experience to customers using older versions of GitHub Enterprise Server, we will continue to release CodeQL Action v2 so that these customers can continue to run the latest version of CodeQL as long as their version of GitHub Enterprise Server is supported. For example CodeQL Action v3.22.11 was the first release of CodeQL Action v3 and is functionally identical to v2.22.11. This approach provides an easy way to track exactly which features are included in different versions by looking at the minor and patch version numbers.
|
||||||
|
|
||||||
|
For more information, see ["Code scanning: deprecation of CodeQL Action v2."](https://github.blog/changelog/2024-01-12-code-scanning-deprecation-of-codeql-action-v2/).
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
Read about [troubleshooting code scanning](https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning).
|
Read about [troubleshooting code scanning](https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning).
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ inputs:
|
|||||||
# If changing this, make sure to update workflow.ts accordingly.
|
# 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 ignored for pull requests from forks."
|
||||||
required: false
|
required: false
|
||||||
sha:
|
sha:
|
||||||
description: "The sha of the HEAD of the ref where results will be uploaded. If not provided, the Action will use the GITHUB_SHA environment variable. If provided, the ref input must be provided as well. This input is not available in pull requests from forks."
|
description: "The sha of the HEAD of the ref where results will be uploaded. If not provided, the Action will use the GITHUB_SHA environment variable. If provided, the ref input must be provided as well. This input is ignored for pull requests from forks."
|
||||||
required: false
|
required: false
|
||||||
category:
|
category:
|
||||||
description: String used by Code Scanning for matching the analyses
|
description: String used by Code Scanning for matching the analyses
|
||||||
@@ -69,6 +69,8 @@ inputs:
|
|||||||
required: true
|
required: true
|
||||||
default: "true"
|
default: "true"
|
||||||
token:
|
token:
|
||||||
|
description: "GitHub token to use for authenticating with this instance of GitHub. The token needs the `security-events: write` permission."
|
||||||
|
required: false
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
matrix:
|
matrix:
|
||||||
default: ${{ toJson(matrix) }}
|
default: ${{ toJson(matrix) }}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ description: 'Attempt to automatically build code'
|
|||||||
author: 'GitHub'
|
author: 'GitHub'
|
||||||
inputs:
|
inputs:
|
||||||
token:
|
token:
|
||||||
|
description: "GitHub token to use for authenticating with this instance of GitHub. The token needs the `security-events: write` permission."
|
||||||
|
required: false
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
matrix:
|
matrix:
|
||||||
default: ${{ toJson(matrix) }}
|
default: ${{ toJson(matrix) }}
|
||||||
|
|||||||
@@ -10,6 +10,23 @@ inputs:
|
|||||||
description: |
|
description: |
|
||||||
A comma-separated value of the languages to be analysed e.g. python,javascript
|
A comma-separated value of the languages to be analysed e.g. python,javascript
|
||||||
required: false
|
required: false
|
||||||
|
build-mode:
|
||||||
|
description: >-
|
||||||
|
[Experimental, for internal testing only] The build mode that will be used to analyze the language.
|
||||||
|
This input is only available in single-language analyses.
|
||||||
|
|
||||||
|
Available build modes will differ based on the language being analyzed. One of:
|
||||||
|
|
||||||
|
- none: The database will be created without building the source code.
|
||||||
|
Available for all interpreted languages and some compiled languages.
|
||||||
|
- autobuild: The database will be created by attempting to automatically build the source code.
|
||||||
|
To use this build mode, ensure that your workflow calls the `autobuild` action
|
||||||
|
between the `init` and `analyze` steps.
|
||||||
|
Available for all compiled languages.
|
||||||
|
- manual: The database will be created by building the source code using a manually specified
|
||||||
|
build command. To use this build mode, specify manual build steps in your workflow
|
||||||
|
between the `init` and `analyze` steps. Available for all compiled languages.
|
||||||
|
required: false
|
||||||
token:
|
token:
|
||||||
description: GitHub token to use for authenticating with this instance of GitHub. To download custom packs from multiple registries, use the registries input.
|
description: GitHub token to use for authenticating with this instance of GitHub. To download custom packs from multiple registries, use the registries input.
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
|
|||||||
4
lib/actions-util.js
generated
4
lib/actions-util.js
generated
@@ -41,7 +41,7 @@ const pkg = require("../package.json");
|
|||||||
const getRequiredInput = function (name) {
|
const getRequiredInput = function (name) {
|
||||||
const value = core.getInput(name);
|
const value = core.getInput(name);
|
||||||
if (!value) {
|
if (!value) {
|
||||||
throw new util_1.UserError(`Input required and not supplied: ${name}`);
|
throw new util_1.ConfigurationError(`Input required and not supplied: ${name}`);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
@@ -177,7 +177,7 @@ async function getRef() {
|
|||||||
const hasShaInput = !!shaInput;
|
const hasShaInput = !!shaInput;
|
||||||
// If one of 'ref' or 'sha' are provided, both are required
|
// If one of 'ref' or 'sha' are provided, both are required
|
||||||
if ((hasRefInput || hasShaInput) && !(hasRefInput && hasShaInput)) {
|
if ((hasRefInput || hasShaInput) && !(hasRefInput && hasShaInput)) {
|
||||||
throw new util_1.UserError("Both 'ref' and 'sha' are required if one of them is provided.");
|
throw new util_1.ConfigurationError("Both 'ref' and 'sha' are required if one of them is provided.");
|
||||||
}
|
}
|
||||||
const ref = refInput || getRefFromEnv();
|
const ref = refInput || getRefFromEnv();
|
||||||
const sha = shaInput || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
const sha = shaInput || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2
lib/analyze-action-env.test.js
generated
2
lib/analyze-action-env.test.js
generated
@@ -50,7 +50,7 @@ const util = __importStar(require("./util"));
|
|||||||
sinon
|
sinon
|
||||||
.stub(statusReport, "createStatusReportBase")
|
.stub(statusReport, "createStatusReportBase")
|
||||||
.resolves({});
|
.resolves({});
|
||||||
sinon.stub(statusReport, "sendStatusReport").resolves(true);
|
sinon.stub(statusReport, "sendStatusReport").resolves();
|
||||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
||||||
const gitHubVersion = {
|
const gitHubVersion = {
|
||||||
type: util.GitHubVariant.DOTCOM,
|
type: util.GitHubVariant.DOTCOM,
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analyze-action-env.test.js","sourceRoot":"","sources":["../src/analyze-action-env.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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AAC,GAAG,MAAM,CAAC;QAEnC,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"}
|
||||||
2
lib/analyze-action-input.test.js
generated
2
lib/analyze-action-input.test.js
generated
@@ -50,7 +50,7 @@ const util = __importStar(require("./util"));
|
|||||||
sinon
|
sinon
|
||||||
.stub(statusReport, "createStatusReportBase")
|
.stub(statusReport, "createStatusReportBase")
|
||||||
.resolves({});
|
.resolves({});
|
||||||
sinon.stub(statusReport, "sendStatusReport").resolves(true);
|
sinon.stub(statusReport, "sendStatusReport").resolves();
|
||||||
const gitHubVersion = {
|
const gitHubVersion = {
|
||||||
type: util.GitHubVariant.DOTCOM,
|
type: util.GitHubVariant.DOTCOM,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analyze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));
|
|||||||
const path_1 = __importDefault(require("path"));
|
const path_1 = __importDefault(require("path"));
|
||||||
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 safe_which_1 = require("@chrisgavin/safe-which");
|
|
||||||
const actionsUtil = __importStar(require("./actions-util"));
|
const actionsUtil = __importStar(require("./actions-util"));
|
||||||
const analyze_1 = require("./analyze");
|
const analyze_1 = require("./analyze");
|
||||||
const api_client_1 = require("./api-client");
|
const api_client_1 = require("./api-client");
|
||||||
@@ -39,7 +38,6 @@ const autobuild_1 = require("./autobuild");
|
|||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
const config_utils_1 = require("./config-utils");
|
const config_utils_1 = require("./config-utils");
|
||||||
const database_upload_1 = require("./database-upload");
|
const database_upload_1 = require("./database-upload");
|
||||||
const diagnostics_1 = require("./diagnostics");
|
|
||||||
const environment_1 = require("./environment");
|
const environment_1 = require("./environment");
|
||||||
const feature_flags_1 = require("./feature-flags");
|
const feature_flags_1 = require("./feature-flags");
|
||||||
const languages_1 = require("./languages");
|
const languages_1 = require("./languages");
|
||||||
@@ -111,6 +109,10 @@ async function runAutobuildIfLegacyGoWorkflow(config, logger) {
|
|||||||
if (!config.languages.includes(languages_1.Language.go)) {
|
if (!config.languages.includes(languages_1.Language.go)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (config.buildMode) {
|
||||||
|
logger.debug("Skipping legacy Go autobuild since a build mode has been specified.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (process.env[environment_1.EnvVar.DID_AUTOBUILD_GOLANG] === "true") {
|
if (process.env[environment_1.EnvVar.DID_AUTOBUILD_GOLANG] === "true") {
|
||||||
logger.debug("Won't run Go autobuild since it has already been run.");
|
logger.debug("Won't run Go autobuild since it has already been run.");
|
||||||
return;
|
return;
|
||||||
@@ -143,15 +145,13 @@ async function run() {
|
|||||||
util.initializeEnvironment(actionsUtil.getActionVersion());
|
util.initializeEnvironment(actionsUtil.getActionVersion());
|
||||||
const logger = (0, logging_1.getActionsLogger)();
|
const logger = (0, logging_1.getActionsLogger)();
|
||||||
try {
|
try {
|
||||||
if (!(await statusReport.sendStatusReport(await (0, status_report_1.createStatusReportBase)("finish", "starting", startedAt, await util.checkDiskUsage(logger))))) {
|
await statusReport.sendStatusReport(await (0, status_report_1.createStatusReportBase)("finish", "starting", startedAt, await util.checkDiskUsage(logger)));
|
||||||
return;
|
|
||||||
}
|
|
||||||
config = await (0, config_utils_1.getConfig)(actionsUtil.getTemporaryDirectory(), logger);
|
config = await (0, config_utils_1.getConfig)(actionsUtil.getTemporaryDirectory(), logger);
|
||||||
if (config === undefined) {
|
if (config === undefined) {
|
||||||
throw new Error("Config file could not be found at expected location. Has the 'init' action been called?");
|
throw new Error("Config file could not be found at expected location. Has the 'init' action been called?");
|
||||||
}
|
}
|
||||||
if (hasBadExpectErrorInput()) {
|
if (hasBadExpectErrorInput()) {
|
||||||
throw new util.UserError("`expect-error` input parameter is for internal use only. It should only be set by codeql-action or a fork.");
|
throw new util.ConfigurationError("`expect-error` input parameter is for internal use only. It should only be set by codeql-action or a fork.");
|
||||||
}
|
}
|
||||||
const apiDetails = (0, api_client_1.getApiDetails)();
|
const apiDetails = (0, api_client_1.getApiDetails)();
|
||||||
const outputDir = actionsUtil.getRequiredInput("output");
|
const outputDir = actionsUtil.getRequiredInput("output");
|
||||||
@@ -161,29 +161,7 @@ async function run() {
|
|||||||
util.checkActionVersion(actionsUtil.getActionVersion(), gitHubVersion);
|
util.checkActionVersion(actionsUtil.getActionVersion(), gitHubVersion);
|
||||||
const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, actionsUtil.getTemporaryDirectory(), logger);
|
const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, actionsUtil.getTemporaryDirectory(), logger);
|
||||||
const memory = util.getMemoryFlag(actionsUtil.getOptionalInput("ram") || process.env["CODEQL_RAM"], logger);
|
const memory = util.getMemoryFlag(actionsUtil.getOptionalInput("ram") || process.env["CODEQL_RAM"], logger);
|
||||||
// Check that `which go` still points at the same path it did when the `init` Action ran to ensure that no steps
|
await (0, analyze_1.warnIfGoInstalledAfterInit)(config, logger);
|
||||||
// in-between performed any setup. We encourage users to perform all setup tasks before initializing CodeQL so that
|
|
||||||
// the setup tasks do not interfere with our analysis.
|
|
||||||
// Furthermore, if we installed a wrapper script in the `init` Action, we need to ensure that there isn't a step
|
|
||||||
// in the workflow after the `init` step which installs a different version of Go and takes precedence in the PATH,
|
|
||||||
// thus potentially circumventing our workaround that allows tracing to work.
|
|
||||||
const goInitPath = process.env[environment_1.EnvVar.GO_BINARY_LOCATION];
|
|
||||||
if (process.env[environment_1.EnvVar.DID_AUTOBUILD_GOLANG] !== "true" &&
|
|
||||||
goInitPath !== undefined) {
|
|
||||||
const goBinaryPath = await (0, safe_which_1.safeWhich)("go");
|
|
||||||
if (goInitPath !== goBinaryPath) {
|
|
||||||
core.warning(`Expected \`which go\` to return ${goInitPath}, but got ${goBinaryPath}: please ensure that the correct version of Go is installed before the \`codeql-action/init\` Action is used.`);
|
|
||||||
(0, diagnostics_1.addDiagnostic)(config, languages_1.Language.go, (0, diagnostics_1.makeDiagnostic)("go/workflow/go-installed-after-codeql-init", "Go was installed after the `codeql-action/init` Action was run", {
|
|
||||||
markdownMessage: "To avoid interfering with the CodeQL analysis, perform all installation steps before calling the `github/codeql-action/init` Action.",
|
|
||||||
visibility: {
|
|
||||||
statusPage: true,
|
|
||||||
telemetry: true,
|
|
||||||
cliSummaryTable: true,
|
|
||||||
},
|
|
||||||
severity: "warning",
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await runAutobuildIfLegacyGoWorkflow(config, logger);
|
await runAutobuildIfLegacyGoWorkflow(config, logger);
|
||||||
dbCreationTimings = await (0, analyze_1.runFinalize)(outputDir, threads, memory, config, logger, features);
|
dbCreationTimings = await (0, analyze_1.runFinalize)(outputDir, threads, memory, config, logger, features);
|
||||||
if (actionsUtil.getRequiredInput("skip-queries") !== "true") {
|
if (actionsUtil.getRequiredInput("skip-queries") !== "true") {
|
||||||
@@ -200,7 +178,7 @@ async function run() {
|
|||||||
core.setOutput("sarif-output", path_1.default.resolve(outputDir));
|
core.setOutput("sarif-output", path_1.default.resolve(outputDir));
|
||||||
const uploadInput = actionsUtil.getOptionalInput("upload");
|
const uploadInput = actionsUtil.getOptionalInput("upload");
|
||||||
if (runStats && actionsUtil.getUploadValue(uploadInput) === "always") {
|
if (runStats && actionsUtil.getUploadValue(uploadInput) === "always") {
|
||||||
uploadResult = await uploadLib.uploadFromActions(outputDir, actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, { considerInvalidRequestUserError: false });
|
uploadResult = await uploadLib.uploadFromActions(outputDir, actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, { considerInvalidRequestConfigError: false });
|
||||||
core.setOutput("sarif-id", uploadResult.sarifID);
|
core.setOutput("sarif-id", uploadResult.sarifID);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -215,7 +193,7 @@ async function run() {
|
|||||||
trapCacheUploadTime = perf_hooks_1.performance.now() - trapCacheUploadStartTime;
|
trapCacheUploadTime = perf_hooks_1.performance.now() - trapCacheUploadStartTime;
|
||||||
// We don't upload results in test mode, so don't wait for processing
|
// We don't upload results in test mode, so don't wait for processing
|
||||||
if (util.isInTestMode()) {
|
if (util.isInTestMode()) {
|
||||||
core.debug("In test mode. Waiting for processing is disabled.");
|
logger.debug("In test mode. Waiting for processing is disabled.");
|
||||||
}
|
}
|
||||||
else if (uploadResult !== undefined &&
|
else if (uploadResult !== undefined &&
|
||||||
actionsUtil.getRequiredInput("wait-for-processing") === "true") {
|
actionsUtil.getRequiredInput("wait-for-processing") === "true") {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
62
lib/analyze.js
generated
62
lib/analyze.js
generated
@@ -26,16 +26,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.runCleanup = exports.runFinalize = exports.runQueries = exports.dbIsFinalized = exports.createdDBForScannedLanguages = exports.CodeQLAnalysisError = void 0;
|
exports.runCleanup = exports.warnIfGoInstalledAfterInit = exports.runFinalize = exports.runQueries = exports.dbIsFinalized = exports.runExtraction = 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");
|
const perf_hooks_1 = require("perf_hooks");
|
||||||
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
||||||
|
const safe_which_1 = require("@chrisgavin/safe-which");
|
||||||
const del_1 = __importDefault(require("del"));
|
const del_1 = __importDefault(require("del"));
|
||||||
const yaml = __importStar(require("js-yaml"));
|
const yaml = __importStar(require("js-yaml"));
|
||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
|
const config_utils_1 = require("./config-utils");
|
||||||
|
const diagnostics_1 = require("./diagnostics");
|
||||||
|
const environment_1 = require("./environment");
|
||||||
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 tools_features_1 = require("./tools-features");
|
||||||
const tracer_config_1 = require("./tracer-config");
|
const tracer_config_1 = require("./tracer-config");
|
||||||
const upload_lib_1 = require("./upload-lib");
|
const upload_lib_1 = require("./upload-lib");
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
@@ -75,20 +80,35 @@ async function setupPythonExtractor(logger, features, codeql) {
|
|||||||
logger.info(`Setting LGTM_PYTHON_SETUP_VERSION=${output}`);
|
logger.info(`Setting LGTM_PYTHON_SETUP_VERSION=${output}`);
|
||||||
process.env["LGTM_PYTHON_SETUP_VERSION"] = output;
|
process.env["LGTM_PYTHON_SETUP_VERSION"] = output;
|
||||||
}
|
}
|
||||||
async function createdDBForScannedLanguages(codeql, config, logger, features) {
|
async function runExtraction(codeql, config, logger, features) {
|
||||||
for (const language of config.languages) {
|
for (const language of config.languages) {
|
||||||
if ((0, languages_1.isScannedLanguage)(language) &&
|
if (dbIsFinalized(config, language, logger)) {
|
||||||
!dbIsFinalized(config, language, logger)) {
|
logger.debug(`Database for ${language} has already been finalized, skipping extraction.`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (shouldExtractLanguage(config, language)) {
|
||||||
logger.startGroup(`Extracting ${language}`);
|
logger.startGroup(`Extracting ${language}`);
|
||||||
if (language === languages_1.Language.python) {
|
if (language === languages_1.Language.python) {
|
||||||
await setupPythonExtractor(logger, features, codeql);
|
await setupPythonExtractor(logger, features, codeql);
|
||||||
}
|
}
|
||||||
await codeql.extractScannedLanguage(config, language);
|
if (config.buildMode &&
|
||||||
|
(await codeql.supportsFeature(tools_features_1.ToolsFeature.TraceCommandUseBuildMode))) {
|
||||||
|
await codeql.extractUsingBuildMode(config, language);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
await codeql.extractScannedLanguage(config, language);
|
||||||
|
}
|
||||||
logger.endGroup();
|
logger.endGroup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.createdDBForScannedLanguages = createdDBForScannedLanguages;
|
exports.runExtraction = runExtraction;
|
||||||
|
function shouldExtractLanguage(config, language) {
|
||||||
|
return (config.buildMode === config_utils_1.BuildMode.None ||
|
||||||
|
(config.buildMode === config_utils_1.BuildMode.Autobuild &&
|
||||||
|
process.env[environment_1.EnvVar.AUTOBUILD_DID_COMPLETE_SUCCESSFULLY] !== "true") ||
|
||||||
|
(!config.buildMode && (0, languages_1.isScannedLanguage)(language)));
|
||||||
|
}
|
||||||
function dbIsFinalized(config, language, logger) {
|
function dbIsFinalized(config, language, logger) {
|
||||||
const dbPath = util.getCodeQLDatabasePath(config, language);
|
const dbPath = util.getCodeQLDatabasePath(config, language);
|
||||||
try {
|
try {
|
||||||
@@ -104,7 +124,7 @@ exports.dbIsFinalized = dbIsFinalized;
|
|||||||
async function finalizeDatabaseCreation(config, threadsFlag, memoryFlag, logger, features) {
|
async function finalizeDatabaseCreation(config, threadsFlag, memoryFlag, logger, features) {
|
||||||
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
|
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
|
||||||
const extractionStart = perf_hooks_1.performance.now();
|
const extractionStart = perf_hooks_1.performance.now();
|
||||||
await createdDBForScannedLanguages(codeql, config, logger, features);
|
await runExtraction(codeql, config, logger, features);
|
||||||
const extractionTime = perf_hooks_1.performance.now() - extractionStart;
|
const extractionTime = perf_hooks_1.performance.now() - extractionStart;
|
||||||
const trapImportStart = perf_hooks_1.performance.now();
|
const trapImportStart = perf_hooks_1.performance.now();
|
||||||
for (const language of config.languages) {
|
for (const language of config.languages) {
|
||||||
@@ -138,7 +158,7 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
|
|||||||
logger.startGroup(`Running queries for ${language}`);
|
logger.startGroup(`Running queries for ${language}`);
|
||||||
const startTimeRunQueries = new Date().getTime();
|
const startTimeRunQueries = new Date().getTime();
|
||||||
const databasePath = util.getCodeQLDatabasePath(config, language);
|
const databasePath = util.getCodeQLDatabasePath(config, language);
|
||||||
await codeql.databaseRunQueries(databasePath, queryFlags, features);
|
await codeql.databaseRunQueries(databasePath, queryFlags);
|
||||||
logger.debug(`Finished running queries for ${language}.`);
|
logger.debug(`Finished running queries for ${language}.`);
|
||||||
// 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.
|
||||||
@@ -230,6 +250,32 @@ async function runFinalize(outputDir, threadsFlag, memoryFlag, config, logger, f
|
|||||||
return timings;
|
return timings;
|
||||||
}
|
}
|
||||||
exports.runFinalize = runFinalize;
|
exports.runFinalize = runFinalize;
|
||||||
|
async function warnIfGoInstalledAfterInit(config, logger) {
|
||||||
|
// Check that `which go` still points at the same path it did when the `init` Action ran to ensure that no steps
|
||||||
|
// in-between performed any setup. We encourage users to perform all setup tasks before initializing CodeQL so that
|
||||||
|
// the setup tasks do not interfere with our analysis.
|
||||||
|
// Furthermore, if we installed a wrapper script in the `init` Action, we need to ensure that there isn't a step
|
||||||
|
// in the workflow after the `init` step which installs a different version of Go and takes precedence in the PATH,
|
||||||
|
// thus potentially circumventing our workaround that allows tracing to work.
|
||||||
|
const goInitPath = process.env[environment_1.EnvVar.GO_BINARY_LOCATION];
|
||||||
|
if (process.env[environment_1.EnvVar.DID_AUTOBUILD_GOLANG] !== "true" &&
|
||||||
|
goInitPath !== undefined) {
|
||||||
|
const goBinaryPath = await (0, safe_which_1.safeWhich)("go");
|
||||||
|
if (goInitPath !== goBinaryPath) {
|
||||||
|
logger.warning(`Expected \`which go\` to return ${goInitPath}, but got ${goBinaryPath}: please ensure that the correct version of Go is installed before the \`codeql-action/init\` Action is used.`);
|
||||||
|
(0, diagnostics_1.addDiagnostic)(config, languages_1.Language.go, (0, diagnostics_1.makeDiagnostic)("go/workflow/go-installed-after-codeql-init", "Go was installed after the `codeql-action/init` Action was run", {
|
||||||
|
markdownMessage: "To avoid interfering with the CodeQL analysis, perform all installation steps before calling the `github/codeql-action/init` Action.",
|
||||||
|
visibility: {
|
||||||
|
statusPage: true,
|
||||||
|
telemetry: true,
|
||||||
|
cliSummaryTable: true,
|
||||||
|
},
|
||||||
|
severity: "warning",
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.warnIfGoInstalledAfterInit = warnIfGoInstalledAfterInit;
|
||||||
async function runCleanup(config, cleanupLevel, logger) {
|
async function runCleanup(config, cleanupLevel, logger) {
|
||||||
logger.startGroup("Cleaning up databases");
|
logger.startGroup("Cleaning up databases");
|
||||||
for (const language of config.languages) {
|
for (const language of config.languages) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
18
lib/analyze.test.js
generated
18
lib/analyze.test.js
generated
@@ -95,25 +95,11 @@ const util = __importStar(require("./util"));
|
|||||||
},
|
},
|
||||||
databasePrintBaseline: async () => "",
|
databasePrintBaseline: async () => "",
|
||||||
});
|
});
|
||||||
const config = {
|
const config = (0, testing_utils_1.createTestConfig)({
|
||||||
languages: [language],
|
languages: [language],
|
||||||
originalUserInput: {},
|
|
||||||
tempDir: tmpDir,
|
tempDir: tmpDir,
|
||||||
codeQLCmd: "",
|
|
||||||
gitHubVersion: {
|
|
||||||
type: util.GitHubVariant.DOTCOM,
|
|
||||||
},
|
|
||||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
||||||
debugMode: false,
|
});
|
||||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
|
||||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
|
||||||
augmentationProperties: {
|
|
||||||
packsInputCombines: false,
|
|
||||||
queriesInputCombines: false,
|
|
||||||
},
|
|
||||||
trapCaches: {},
|
|
||||||
trapCacheDownloadTime: 0,
|
|
||||||
};
|
|
||||||
fs.mkdirSync(util.getCodeQLDatabasePath(config, language), {
|
fs.mkdirSync(util.getCodeQLDatabasePath(config, language), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analyze.test.js","sourceRoot":"","sources":["../src/analyze.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;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M,YAAY,GAAG,MAAM,IAAA,oBAAU,EACnC,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,EACX,SAAS,EACT,MAAM,EACN,IAAA,yBAAe,EAAC,IAAI,CAAC,EACrB,IAAA,8BAAc,EAAC,CAAC,uBAAO,CAAC,kBAAkB,CAAC,CAAC,CAC7C,CAAC;YACF,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;gBAC5C,2BAA2B,QAAQ,cAAc;gBACjD,eAAe;gBACf,qBAAqB,QAAQ,cAAc;aAC5C,CAAC,CAAC;YACH,KAAK,MAAM,WAAW,IAAI,YAAY,CAAC,aAAc,EAAE,CAAC;gBACtD,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,mCAAmC,CAAC,CAAC;gBACpE,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,WAAW,CAAC,CAAC;gBACpC,CAAC,CAAC,IAAI,CAAC,aAAa,IAAI,WAAW,CAAC,UAAW,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
||||||
10
lib/autobuild-action.js
generated
10
lib/autobuild-action.js
generated
@@ -27,7 +27,9 @@ const core = __importStar(require("@actions/core"));
|
|||||||
const actions_util_1 = require("./actions-util");
|
const actions_util_1 = require("./actions-util");
|
||||||
const api_client_1 = require("./api-client");
|
const api_client_1 = require("./api-client");
|
||||||
const autobuild_1 = require("./autobuild");
|
const autobuild_1 = require("./autobuild");
|
||||||
|
const codeql_1 = require("./codeql");
|
||||||
const configUtils = __importStar(require("./config-utils"));
|
const configUtils = __importStar(require("./config-utils"));
|
||||||
|
const environment_1 = require("./environment");
|
||||||
const logging_1 = require("./logging");
|
const logging_1 = require("./logging");
|
||||||
const status_report_1 = require("./status-report");
|
const status_report_1 = require("./status-report");
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
@@ -48,9 +50,7 @@ async function run() {
|
|||||||
let currentLanguage = undefined;
|
let currentLanguage = undefined;
|
||||||
let languages = undefined;
|
let languages = undefined;
|
||||||
try {
|
try {
|
||||||
if (!(await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)("autobuild", "starting", startedAt, await (0, util_1.checkDiskUsage)(logger))))) {
|
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)("autobuild", "starting", startedAt, await (0, util_1.checkDiskUsage)(logger)));
|
||||||
return;
|
|
||||||
}
|
|
||||||
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
||||||
(0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger);
|
(0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger);
|
||||||
(0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion);
|
(0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion);
|
||||||
@@ -58,7 +58,8 @@ async function run() {
|
|||||||
if (config === undefined) {
|
if (config === undefined) {
|
||||||
throw new Error("Config file could not be found at expected location. Has the 'init' action been called?");
|
throw new Error("Config file could not be found at expected location. Has the 'init' action been called?");
|
||||||
}
|
}
|
||||||
languages = await (0, autobuild_1.determineAutobuildLanguages)(config, logger);
|
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
|
||||||
|
languages = await (0, autobuild_1.determineAutobuildLanguages)(codeql, config, logger);
|
||||||
if (languages !== undefined) {
|
if (languages !== undefined) {
|
||||||
const workingDirectory = (0, actions_util_1.getOptionalInput)("working-directory");
|
const workingDirectory = (0, actions_util_1.getOptionalInput)("working-directory");
|
||||||
if (workingDirectory) {
|
if (workingDirectory) {
|
||||||
@@ -77,6 +78,7 @@ async function run() {
|
|||||||
await sendCompletedStatusReport(logger, startedAt, languages ?? [], currentLanguage, error);
|
await sendCompletedStatusReport(logger, startedAt, languages ?? [], currentLanguage, error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
core.exportVariable(environment_1.EnvVar.AUTOBUILD_DID_COMPLETE_SUCCESSFULLY, "true");
|
||||||
await sendCompletedStatusReport(logger, startedAt, languages ?? []);
|
await sendCompletedStatusReport(logger, startedAt, languages ?? []);
|
||||||
}
|
}
|
||||||
async function runWrapper() {
|
async function runWrapper() {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"autobuild-action.js","sourceRoot":"","sources":["../src/autobuild-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAIwB;AACxB,6CAAgD;AAChD,2CAAwE;AACxE,4DAA8C;AAE9C,uCAAqD;AACrD,mDAKyB;AACzB,iCAMgB;AAShB,KAAK,UAAU,yBAAyB,CACtC,MAAc,EACd,SAAe,EACf,YAAsB,EACtB,eAAwB,EACxB,KAAa;IAEb,IAAA,4BAAqB,EAAC,IAAA,+BAAgB,GAAE,CAAC,CAAC;IAE1C,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,WAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,KAAK,CACb,CAAC;IACF,MAAM,YAAY,GAA0B;QAC1C,GAAG,gBAAgB;QACnB,mBAAmB,EAAE,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,iBAAiB,EAAE,eAAe;KACnC,CAAC;IACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAClC,IAAI,e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C;QACxB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CACZ,kIAAkI,KAAK,CAAC,OAAO,EAAE,CAClJ,CAAC;QACF,MAAM,yBAAyB,CAC7B,MAAM,EACN,SAAS,EACT,SAAS,IAAI,EAAE,EACf,eAAe,EACf,KAAK,CACN,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;AACtE,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CAAC,4BAA4B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
{"version":3,"file":"autobuild-action.js","sourceRoot":"","sources":["../src/autobuild-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAIwB;AACxB,6CAAgD;AAChD,2CAAwE;AACxE,qCAAqC;AACrC,4DAA8C;AAC9C,+CAAuC;AAEvC,uCAAqD;AACrD,mDAKyB;AACzB,iCAMgB;AAShB,KAAK,UAAU,yBAAyB,CACtC,MAAc,EACd,SAAe,EACf,YAAsB,EACtB,eAAwB,EACxB,KAAa;IAEb,IAAA,4BAAqB,EAAC,IAAA,+BAAgB,GAAE,CAAC,CAAC;IAE1C,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,WAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,KAAK,EAAE,OAAO,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+BAAgB,EAAC,mBAAmB,CAAC,CAAC;YAC/D,IAAI,gBAAgB,EAAE,CAAC;gBACrB,MAAM,CAAC,IAAI,CACT,6CAA6C,gBAAgB,EAAE,CAChE,CAAC;gBACF,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAClC,CAAC;YACD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;gBACjC,eAAe,GAAG,QAAQ,CAAC;gBAC3B,MAAM,IAAA,wBAAY,EAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,cAAc,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CACZ,kIAAkI,KAAK,CAAC,OAAO,EAAE,CAClJ,CAAC;QACF,MAAM,yBAAyB,CAC7B,MAAM,EACN,SAAS,EACT,SAAS,IAAI,EAAE,EACf,eAAe,EACf,KAAK,CACN,CAAC;QACF,OAAO;IACT,CAAC;IAED,IAAI,CAAC,cAAc,CAAC,oBAAM,CAAC,mCAAmC,EAAE,MAAM,CAAC,CAAC;IAExE,MAAM,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;AACtE,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CAAC,4BAA4B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||||
10
lib/autobuild.js
generated
10
lib/autobuild.js
generated
@@ -28,12 +28,20 @@ const core = __importStar(require("@actions/core"));
|
|||||||
const actions_util_1 = require("./actions-util");
|
const actions_util_1 = require("./actions-util");
|
||||||
const api_client_1 = require("./api-client");
|
const api_client_1 = require("./api-client");
|
||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
|
const config_utils_1 = require("./config-utils");
|
||||||
const environment_1 = require("./environment");
|
const environment_1 = require("./environment");
|
||||||
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 repository_1 = require("./repository");
|
const repository_1 = require("./repository");
|
||||||
|
const tools_features_1 = require("./tools-features");
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
async function determineAutobuildLanguages(config, logger) {
|
async function determineAutobuildLanguages(codeql, config, logger) {
|
||||||
|
if ((config.buildMode === config_utils_1.BuildMode.None &&
|
||||||
|
(await codeql.supportsFeature(tools_features_1.ToolsFeature.TraceCommandUseBuildMode))) ||
|
||||||
|
config.buildMode === config_utils_1.BuildMode.Manual) {
|
||||||
|
logger.info(`Using ${config.buildMode} build mode, nothing to autobuild.`);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
// Attempt to find a language to autobuild
|
// Attempt to find a language to autobuild
|
||||||
// We want pick the dominant language in the repo from the ones we're able to build
|
// We want pick the dominant language in the repo from the ones we're able to build
|
||||||
// The languages are sorted in order specified by user or by lines of code if we got
|
// The languages are sorted in order specified by user or by lines of code if we got
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"autobuild.js","sourceRoot":"","sources":["../src/autobuild.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAA6E;AAC7E,6CAAgD;AAChD,qCAA6C;AAE7C,+CAAuC;AACvC,mDAAmE;AACnE,2CAAyD;AAEzD,6CAAkD;AAClD,iCAA6C;AAEtC,KAAK,UAAU,2BAA2B,CAC/C,MAA0B,EAC1B,MAAc;IAEd,0CAA0C;IAC1C,mFAAmF;IACnF,oFA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AC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CACT,YAAY,WAAW,yCAAyC,MAAM,yCAAyC,MAAM,IAAI,CAC1H,CAAC;YACF,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,IAAI,CAAC,aAAa,WAAW,GAAG,CAAC,CAAC;QACzC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,YAAY,CAChC,QAAkB,EAClB,MAA0B,EAC1B,MAAc;IAEd,MAAM,CAAC,UAAU,CAAC,qCAAqC,QAAQ,OAAO,CAAC,CAAC;IACxE,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjD,IAAI,QAAQ,KAAK,oBAAQ,CAAC,GAAG,EAAE,CAAC;QAC9B,MAAM,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IACD,MAAM,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACpC,IAAI,QAAQ,KAAK,oBAAQ,CAAC,EAAE,EAAE,CAAC;QAC7B,IAAI,CAAC,cAAc,CAAC,oBAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,CAAC,QAAQ,EAAE,CAAC;AACpB,CAAC;AAfD,oCAeC"}
|
||||||
225
lib/cli-errors.js
generated
Normal file
225
lib/cli-errors.js
generated
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.wrapCliConfigurationError = exports.getCliConfigCategoryIfExists = exports.cliErrorsConfig = exports.CliConfigErrorCategory = exports.CommandInvocationError = void 0;
|
||||||
|
const util_1 = require("./util");
|
||||||
|
const NO_SOURCE_CODE_SEEN_DOCS_LINK = "https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build";
|
||||||
|
/**
|
||||||
|
* A class of Error that we can classify as an error stemming from a CLI
|
||||||
|
* invocation, with associated exit code, stderr,etc.
|
||||||
|
*/
|
||||||
|
class CommandInvocationError extends Error {
|
||||||
|
constructor(cmd, args, exitCode, stderr, stdout) {
|
||||||
|
const prettyCommand = [cmd, ...args]
|
||||||
|
.map((x) => (x.includes(" ") ? `'${x}'` : x))
|
||||||
|
.join(" ");
|
||||||
|
const fatalErrors = extractFatalErrors(stderr);
|
||||||
|
const lastLine = stderr.trim().split("\n").pop()?.trim();
|
||||||
|
let error = fatalErrors
|
||||||
|
? ` and error was: ${fatalErrors.trim()}`
|
||||||
|
: lastLine
|
||||||
|
? ` and last log line was: ${lastLine}`
|
||||||
|
: "";
|
||||||
|
if (error[error.length - 1] !== ".") {
|
||||||
|
error += ".";
|
||||||
|
}
|
||||||
|
super(`Encountered a fatal error while running "${prettyCommand}". ` +
|
||||||
|
`Exit code was ${exitCode}${error} See the logs for more details.`);
|
||||||
|
this.exitCode = exitCode;
|
||||||
|
this.stderr = stderr;
|
||||||
|
this.stdout = stdout;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.CommandInvocationError = CommandInvocationError;
|
||||||
|
/**
|
||||||
|
* Provide a better error message from the stderr of a CLI invocation that failed with a fatal
|
||||||
|
* error.
|
||||||
|
*
|
||||||
|
* - If the CLI invocation failed with a fatal error, this returns that fatal error, followed by
|
||||||
|
* any fatal errors that occurred in plumbing commands.
|
||||||
|
* - If the CLI invocation did not fail with a fatal error, this returns `undefined`.
|
||||||
|
*
|
||||||
|
* ### Example
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
* Running TRAP import for CodeQL database at /home/runner/work/_temp/codeql_databases/javascript...
|
||||||
|
* A fatal error occurred: Evaluator heap must be at least 384.00 MiB
|
||||||
|
* A fatal error occurred: Dataset import for
|
||||||
|
* /home/runner/work/_temp/codeql_databases/javascript/db-javascript failed with code 2
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* becomes
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
* Encountered a fatal error while running "codeql-for-testing database finalize --finalize-dataset
|
||||||
|
* --threads=2 --ram=2048 db". Exit code was 32 and error was: A fatal error occurred: Dataset
|
||||||
|
* import for /home/runner/work/_temp/codeql_databases/javascript/db-javascript failed with code 2.
|
||||||
|
* Context: A fatal error occurred: Evaluator heap must be at least 384.00 MiB.
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* Where possible, this tries to summarize the error into a single line, as this displays better in
|
||||||
|
* the Actions UI.
|
||||||
|
*/
|
||||||
|
function extractFatalErrors(error) {
|
||||||
|
const fatalErrorRegex = /.*fatal error occurred:/gi;
|
||||||
|
let fatalErrors = [];
|
||||||
|
let lastFatalErrorIndex;
|
||||||
|
let match;
|
||||||
|
while ((match = fatalErrorRegex.exec(error)) !== null) {
|
||||||
|
if (lastFatalErrorIndex !== undefined) {
|
||||||
|
fatalErrors.push(error.slice(lastFatalErrorIndex, match.index).trim());
|
||||||
|
}
|
||||||
|
lastFatalErrorIndex = match.index;
|
||||||
|
}
|
||||||
|
if (lastFatalErrorIndex !== undefined) {
|
||||||
|
const lastError = error.slice(lastFatalErrorIndex).trim();
|
||||||
|
if (fatalErrors.length === 0) {
|
||||||
|
// No other errors
|
||||||
|
return lastError;
|
||||||
|
}
|
||||||
|
const isOneLiner = !fatalErrors.some((e) => e.includes("\n"));
|
||||||
|
if (isOneLiner) {
|
||||||
|
fatalErrors = fatalErrors.map(ensureEndsInPeriod);
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
ensureEndsInPeriod(lastError),
|
||||||
|
"Context:",
|
||||||
|
...fatalErrors.reverse(),
|
||||||
|
].join(isOneLiner ? " " : "\n");
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
function ensureEndsInPeriod(text) {
|
||||||
|
return text[text.length - 1] === "." ? text : `${text}.`;
|
||||||
|
}
|
||||||
|
/** Error messages from the CLI that we consider configuration errors and handle specially. */
|
||||||
|
var CliConfigErrorCategory;
|
||||||
|
(function (CliConfigErrorCategory) {
|
||||||
|
CliConfigErrorCategory["IncompatibleWithActionVersion"] = "IncompatibleWithActionVersion";
|
||||||
|
CliConfigErrorCategory["InitCalledTwice"] = "InitCalledTwice";
|
||||||
|
CliConfigErrorCategory["InvalidSourceRoot"] = "InvalidSourceRoot";
|
||||||
|
CliConfigErrorCategory["NoBuildCommandAutodetected"] = "NoBuildCommandAutodetected";
|
||||||
|
CliConfigErrorCategory["NoBuildMethodAutodetected"] = "NoBuildMethodAutodetected";
|
||||||
|
CliConfigErrorCategory["NoSourceCodeSeen"] = "NoSourceCodeSeen";
|
||||||
|
CliConfigErrorCategory["NoSupportedBuildCommandSucceeded"] = "NoSupportedBuildCommandSucceeded";
|
||||||
|
CliConfigErrorCategory["NoSupportedBuildSystemDetected"] = "NoSupportedBuildSystemDetected";
|
||||||
|
})(CliConfigErrorCategory || (exports.CliConfigErrorCategory = CliConfigErrorCategory = {}));
|
||||||
|
/**
|
||||||
|
* All of our caught CLI error messages that we handle specially: ie. if we
|
||||||
|
* would like to categorize an error as a configuration error or not.
|
||||||
|
*/
|
||||||
|
exports.cliErrorsConfig = {
|
||||||
|
// Version of CodeQL CLI is incompatible with this version of the CodeQL Action
|
||||||
|
[CliConfigErrorCategory.IncompatibleWithActionVersion]: {
|
||||||
|
cliErrorMessageCandidates: [
|
||||||
|
new RegExp("is not compatible with this CodeQL CLI"),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
[CliConfigErrorCategory.InitCalledTwice]: {
|
||||||
|
cliErrorMessageCandidates: [
|
||||||
|
new RegExp("Refusing to create databases .* but could not process any of it"),
|
||||||
|
],
|
||||||
|
additionalErrorMessageToAppend: `Is the "init" action called twice in the same job?`,
|
||||||
|
},
|
||||||
|
// Expected source location for database creation does not exist
|
||||||
|
[CliConfigErrorCategory.InvalidSourceRoot]: {
|
||||||
|
cliErrorMessageCandidates: [new RegExp("Invalid source root")],
|
||||||
|
},
|
||||||
|
[CliConfigErrorCategory.NoBuildCommandAutodetected]: {
|
||||||
|
cliErrorMessageCandidates: [
|
||||||
|
new RegExp("Could not auto-detect a suitable build method"),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
[CliConfigErrorCategory.NoBuildMethodAutodetected]: {
|
||||||
|
cliErrorMessageCandidates: [
|
||||||
|
new RegExp("Could not detect a suitable build command for the source checkout"),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
// Usually when a manual build script has failed, or if an autodetected language
|
||||||
|
// was unintended to have CodeQL analysis run on it.
|
||||||
|
[CliConfigErrorCategory.NoSourceCodeSeen]: {
|
||||||
|
exitCode: 32,
|
||||||
|
cliErrorMessageCandidates: [
|
||||||
|
new RegExp("CodeQL detected code written in .* but could not process any of it"),
|
||||||
|
new RegExp("CodeQL did not detect any code written in languages supported by CodeQL"),
|
||||||
|
/**
|
||||||
|
* Earlier versions of the JavaScript extractor (pre-CodeQL 2.12.0) extract externs even if no
|
||||||
|
* source code was found. This means that we don't get the no code found error from
|
||||||
|
* `codeql database finalize`. To ensure users get a good error message, we detect this manually
|
||||||
|
* here, and upon detection override the error message.
|
||||||
|
*
|
||||||
|
* This can be removed once support for CodeQL 2.11.6 is removed.
|
||||||
|
*/
|
||||||
|
new RegExp("No JavaScript or TypeScript code found"),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
[CliConfigErrorCategory.NoSupportedBuildCommandSucceeded]: {
|
||||||
|
cliErrorMessageCandidates: [
|
||||||
|
new RegExp("No supported build command succeeded"),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
[CliConfigErrorCategory.NoSupportedBuildSystemDetected]: {
|
||||||
|
cliErrorMessageCandidates: [
|
||||||
|
new RegExp("No supported build system detected"),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Check if the given CLI error or exit code, if applicable, apply to any known
|
||||||
|
* CLI errors in the configuration record. If either the CLI error message matches one of
|
||||||
|
* the error messages in the config record, or the exit codes match, return the error category;
|
||||||
|
* if not, return undefined.
|
||||||
|
*/
|
||||||
|
function getCliConfigCategoryIfExists(cliError) {
|
||||||
|
for (const [category, configuration] of Object.entries(exports.cliErrorsConfig)) {
|
||||||
|
if (cliError.exitCode !== undefined &&
|
||||||
|
configuration.exitCode !== undefined &&
|
||||||
|
cliError.exitCode === configuration.exitCode) {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
for (const e of configuration.cliErrorMessageCandidates) {
|
||||||
|
if (cliError.message.match(e) || cliError.stderr.match(e)) {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
exports.getCliConfigCategoryIfExists = getCliConfigCategoryIfExists;
|
||||||
|
/**
|
||||||
|
* Prepend a clearer error message with the docs link if the error message does not already
|
||||||
|
* include it. Can be removed once support for CodeQL 2.11.6 is removed; at that point, all runs
|
||||||
|
* should already include the doc link.
|
||||||
|
*/
|
||||||
|
function prependDocsLinkIfApplicable(cliErrorMessage) {
|
||||||
|
if (!cliErrorMessage.includes(NO_SOURCE_CODE_SEEN_DOCS_LINK)) {
|
||||||
|
return `No code found during the build. Please see: ${NO_SOURCE_CODE_SEEN_DOCS_LINK}. Detailed error: ${cliErrorMessage}`;
|
||||||
|
}
|
||||||
|
return cliErrorMessage;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Changes an error received from the CLI to a ConfigurationError with optionally an extra
|
||||||
|
* error message appended, if it exists in a known set of configuration errors. Otherwise,
|
||||||
|
* simply returns the original error.
|
||||||
|
*/
|
||||||
|
function wrapCliConfigurationError(cliError) {
|
||||||
|
if (!(cliError instanceof CommandInvocationError)) {
|
||||||
|
return cliError;
|
||||||
|
}
|
||||||
|
const cliConfigErrorCategory = getCliConfigCategoryIfExists(cliError);
|
||||||
|
if (cliConfigErrorCategory === undefined) {
|
||||||
|
return cliError;
|
||||||
|
}
|
||||||
|
let errorMessageBuilder = cliError.message;
|
||||||
|
// Can be removed once support for CodeQL 2.11.6 is removed; at that point, all runs should
|
||||||
|
// already include the doc link.
|
||||||
|
if (cliConfigErrorCategory === CliConfigErrorCategory.NoSourceCodeSeen) {
|
||||||
|
errorMessageBuilder = prependDocsLinkIfApplicable(errorMessageBuilder);
|
||||||
|
}
|
||||||
|
const additionalErrorMessageToAppend = exports.cliErrorsConfig[cliConfigErrorCategory].additionalErrorMessageToAppend;
|
||||||
|
if (additionalErrorMessageToAppend !== undefined) {
|
||||||
|
errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`;
|
||||||
|
}
|
||||||
|
return new util_1.ConfigurationError(errorMessageBuilder);
|
||||||
|
}
|
||||||
|
exports.wrapCliConfigurationError = wrapCliConfigurationError;
|
||||||
|
//# sourceMappingURL=cli-errors.js.map
|
||||||
1
lib/cli-errors.js.map
Normal file
1
lib/cli-errors.js.map
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"cli-errors.js","sourceRoot":"","sources":["../src/cli-errors.ts"],"names":[],"mappings":";;;AAAA,iCAA4C;AAE5C,MAAM,6BAA6B,GACjC,8EAA8E,CAAC;AAEjF;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,KAAK;IAC/C,YACE,GAAW,EACX,IAAc,EACP,QAAgB,EAChB,MAAc,EACd,MAAc;QAErB,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;aACjC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAC5C,IAAI,CAAC,GAAG,CAAC,CAAC;QAEb,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC/C,M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BAA8B,CAAC;IACzE,IAAI,8BAA8B,KAAK,SAAS,EAAE,CAAC;QACjD,mBAAmB,GAAG,GAAG,mBAAmB,IAAI,8BAA8B,EAAE,CAAC;IACnF,CAAC;IAED,OAAO,IAAI,yBAAkB,CAAC,mBAAmB,CAAC,CAAC;AACrD,CAAC;AAzBD,8DAyBC"}
|
||||||
189
lib/codeql.js
generated
189
lib/codeql.js
generated
@@ -23,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.getGeneratedCodeScanningConfigPath = exports.getTrapCachingExtractorConfigArgsForLang = exports.getTrapCachingExtractorConfigArgs = exports.getExtraOptions = exports.getCodeQLForCmd = exports.getCodeQLForTesting = exports.getCachedCodeQL = exports.setCodeQL = exports.getCodeQL = exports.setupCodeQL = exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE = exports.CODEQL_VERSION_ANALYSIS_SUMMARY_V2 = exports.CODEQL_VERSION_LANGUAGE_ALIASING = exports.CODEQL_VERSION_LANGUAGE_BASELINE_CONFIG = exports.CODEQL_VERSION_RESOLVE_ENVIRONMENT = exports.CODEQL_VERSION_DIAGNOSTICS_EXPORT_FIXED = exports.CODEQL_VERSION_BETTER_NO_CODE_ERROR_MESSAGE = exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = exports.CODEQL_VERSION_EXPORT_CODE_SCANNING_CONFIG = exports.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = exports.CommandInvocationError = void 0;
|
exports.getGeneratedCodeScanningConfigPath = exports.getTrapCachingExtractorConfigArgsForLang = exports.getTrapCachingExtractorConfigArgs = exports.getExtraOptions = exports.getCodeQLForCmd = exports.getCodeQLForTesting = exports.getCachedCodeQL = exports.setCodeQL = exports.getCodeQL = exports.setupCodeQL = exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE = exports.CODEQL_VERSION_ANALYSIS_SUMMARY_V2 = exports.CODEQL_VERSION_LANGUAGE_ALIASING = exports.CODEQL_VERSION_LANGUAGE_BASELINE_CONFIG = exports.CODEQL_VERSION_RESOLVE_ENVIRONMENT = exports.CODEQL_VERSION_DIAGNOSTICS_EXPORT_FIXED = exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = exports.CODEQL_VERSION_EXPORT_CODE_SCANNING_CONFIG = exports.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = void 0;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
const core = __importStar(require("@actions/core"));
|
const core = __importStar(require("@actions/core"));
|
||||||
@@ -31,35 +31,14 @@ const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
|||||||
const yaml = __importStar(require("js-yaml"));
|
const yaml = __importStar(require("js-yaml"));
|
||||||
const semver = __importStar(require("semver"));
|
const semver = __importStar(require("semver"));
|
||||||
const actions_util_1 = require("./actions-util");
|
const actions_util_1 = require("./actions-util");
|
||||||
|
const cli_errors_1 = require("./cli-errors");
|
||||||
const environment_1 = require("./environment");
|
const environment_1 = require("./environment");
|
||||||
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 setupCodeql = __importStar(require("./setup-codeql"));
|
||||||
|
const tools_features_1 = require("./tools-features");
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
class CommandInvocationError extends Error {
|
|
||||||
constructor(cmd, args, exitCode, stderr, stdout) {
|
|
||||||
const prettyCommand = [cmd, ...args]
|
|
||||||
.map((x) => (x.includes(" ") ? `'${x}'` : x))
|
|
||||||
.join(" ");
|
|
||||||
const fatalErrors = extractFatalErrors(stderr);
|
|
||||||
const lastLine = stderr.trim().split("\n").pop()?.trim();
|
|
||||||
let error = fatalErrors
|
|
||||||
? ` and error was: ${fatalErrors.trim()}`
|
|
||||||
: lastLine
|
|
||||||
? ` and last log line was: ${lastLine}`
|
|
||||||
: "";
|
|
||||||
if (error[error.length - 1] !== ".") {
|
|
||||||
error += ".";
|
|
||||||
}
|
|
||||||
super(`Encountered a fatal error while running "${prettyCommand}". ` +
|
|
||||||
`Exit code was ${exitCode}${error} See the logs for more details.`);
|
|
||||||
this.exitCode = exitCode;
|
|
||||||
this.stderr = stderr;
|
|
||||||
this.stdout = stdout;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.CommandInvocationError = CommandInvocationError;
|
|
||||||
/**
|
/**
|
||||||
* Stores the CodeQL object, and is populated by `setupCodeQL` or `getCodeQL`.
|
* Stores the CodeQL object, and is populated by `setupCodeQL` or `getCodeQL`.
|
||||||
* Can be overridden in tests using `setCodeQL`.
|
* Can be overridden in tests using `setCodeQL`.
|
||||||
@@ -87,6 +66,8 @@ const GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.7";
|
|||||||
*/
|
*/
|
||||||
const GHES_MOST_RECENT_DEPRECATION_DATE = "2023-11-08";
|
const GHES_MOST_RECENT_DEPRECATION_DATE = "2023-11-08";
|
||||||
/*
|
/*
|
||||||
|
* Deprecated in favor of ToolsFeature.
|
||||||
|
*
|
||||||
* Versions of CodeQL that version-flag certain functionality in the Action.
|
* Versions of CodeQL that version-flag certain functionality in the Action.
|
||||||
* For convenience, please keep these in descending order. Once a version
|
* For convenience, please keep these in descending order. Once a version
|
||||||
* flag is older than the oldest supported version above, it may be removed.
|
* flag is older than the oldest supported version above, it may be removed.
|
||||||
@@ -105,11 +86,6 @@ exports.CODEQL_VERSION_EXPORT_CODE_SCANNING_CONFIG = "2.12.3";
|
|||||||
* Versions 2.12.4+ of the CodeQL CLI support the `--qlconfig-file` flag in calls to `database init`.
|
* Versions 2.12.4+ of the CodeQL CLI support the `--qlconfig-file` flag in calls to `database init`.
|
||||||
*/
|
*/
|
||||||
exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = "2.12.4";
|
exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = "2.12.4";
|
||||||
/**
|
|
||||||
* Versions 2.12.4+ of the CodeQL CLI provide a better error message when `database finalize`
|
|
||||||
* determines that no code has been found.
|
|
||||||
*/
|
|
||||||
exports.CODEQL_VERSION_BETTER_NO_CODE_ERROR_MESSAGE = "2.12.4";
|
|
||||||
/**
|
/**
|
||||||
* Versions 2.13.1+ of the CodeQL CLI fix a bug where diagnostics export could produce invalid SARIF.
|
* Versions 2.13.1+ of the CodeQL CLI fix a bug where diagnostics export could produce invalid SARIF.
|
||||||
*/
|
*/
|
||||||
@@ -155,7 +131,7 @@ async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliV
|
|||||||
codeqlCmd += ".exe";
|
codeqlCmd += ".exe";
|
||||||
}
|
}
|
||||||
else if (process.platform !== "linux" && process.platform !== "darwin") {
|
else if (process.platform !== "linux" && process.platform !== "darwin") {
|
||||||
throw new util.UserError(`Unsupported platform: ${process.platform}`);
|
throw new util.ConfigurationError(`Unsupported platform: ${process.platform}`);
|
||||||
}
|
}
|
||||||
cachedCodeQL = await getCodeQLForCmd(codeqlCmd, checkVersion);
|
cachedCodeQL = await getCodeQLForCmd(codeqlCmd, checkVersion);
|
||||||
return {
|
return {
|
||||||
@@ -201,13 +177,16 @@ function resolveFunction(partialCodeql, methodName, defaultImplementation) {
|
|||||||
function setCodeQL(partialCodeql) {
|
function setCodeQL(partialCodeql) {
|
||||||
cachedCodeQL = {
|
cachedCodeQL = {
|
||||||
getPath: resolveFunction(partialCodeql, "getPath", () => "/tmp/dummy-path"),
|
getPath: resolveFunction(partialCodeql, "getPath", () => "/tmp/dummy-path"),
|
||||||
getVersion: resolveFunction(partialCodeql, "getVersion", () => new Promise((resolve) => resolve({
|
getVersion: resolveFunction(partialCodeql, "getVersion", async () => ({
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
}))),
|
})),
|
||||||
printVersion: resolveFunction(partialCodeql, "printVersion"),
|
printVersion: resolveFunction(partialCodeql, "printVersion"),
|
||||||
|
supportsFeature: resolveFunction(partialCodeql, "supportsFeature", async (feature) => !!partialCodeql.getVersion &&
|
||||||
|
(0, tools_features_1.isSupportedToolsFeature)(await partialCodeql.getVersion(), feature)),
|
||||||
databaseInitCluster: resolveFunction(partialCodeql, "databaseInitCluster"),
|
databaseInitCluster: resolveFunction(partialCodeql, "databaseInitCluster"),
|
||||||
runAutobuild: resolveFunction(partialCodeql, "runAutobuild"),
|
runAutobuild: resolveFunction(partialCodeql, "runAutobuild"),
|
||||||
extractScannedLanguage: resolveFunction(partialCodeql, "extractScannedLanguage"),
|
extractScannedLanguage: resolveFunction(partialCodeql, "extractScannedLanguage"),
|
||||||
|
extractUsingBuildMode: resolveFunction(partialCodeql, "extractUsingBuildMode"),
|
||||||
finalizeDatabase: resolveFunction(partialCodeql, "finalizeDatabase"),
|
finalizeDatabase: resolveFunction(partialCodeql, "finalizeDatabase"),
|
||||||
resolveLanguages: resolveFunction(partialCodeql, "resolveLanguages"),
|
resolveLanguages: resolveFunction(partialCodeql, "resolveLanguages"),
|
||||||
betterResolveLanguages: resolveFunction(partialCodeql, "betterResolveLanguages"),
|
betterResolveLanguages: resolveFunction(partialCodeql, "betterResolveLanguages"),
|
||||||
@@ -279,6 +258,9 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
async printVersion() {
|
async printVersion() {
|
||||||
await runTool(cmd, ["version", "--format=json"]);
|
await runTool(cmd, ["version", "--format=json"]);
|
||||||
},
|
},
|
||||||
|
async supportsFeature(feature) {
|
||||||
|
return (0, tools_features_1.isSupportedToolsFeature)(await this.getVersion(), feature);
|
||||||
|
},
|
||||||
async databaseInitCluster(config, sourceRoot, processName, qlconfigFile, logger) {
|
async databaseInitCluster(config, sourceRoot, processName, 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) {
|
||||||
@@ -292,6 +274,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
if (externalRepositoryToken) {
|
if (externalRepositoryToken) {
|
||||||
extraArgs.push("--external-repository-token-stdin");
|
extraArgs.push("--external-repository-token-stdin");
|
||||||
}
|
}
|
||||||
|
if (config.buildMode !== undefined &&
|
||||||
|
(await this.supportsFeature(tools_features_1.ToolsFeature.BuildModeOption))) {
|
||||||
|
extraArgs.push(`--build-mode=${config.buildMode}`);
|
||||||
|
}
|
||||||
if (qlconfigFile !== undefined &&
|
if (qlconfigFile !== undefined &&
|
||||||
(await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_INIT_WITH_QLCONFIG))) {
|
(await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_INIT_WITH_QLCONFIG))) {
|
||||||
extraArgs.push(`--qlconfig-file=${qlconfigFile}`);
|
extraArgs.push(`--qlconfig-file=${qlconfigFile}`);
|
||||||
@@ -305,16 +291,24 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
else if (await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE)) {
|
else if (await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE)) {
|
||||||
extraArgs.push("--no-sublanguage-file-coverage");
|
extraArgs.push("--no-sublanguage-file-coverage");
|
||||||
}
|
}
|
||||||
await runTool(cmd, [
|
try {
|
||||||
"database",
|
await runTool(cmd, [
|
||||||
"init",
|
"database",
|
||||||
"--db-cluster",
|
"init",
|
||||||
config.dbLocation,
|
"--db-cluster",
|
||||||
`--source-root=${sourceRoot}`,
|
config.dbLocation,
|
||||||
...(await getLanguageAliasingArguments(this)),
|
`--source-root=${sourceRoot}`,
|
||||||
...extraArgs,
|
...(await getLanguageAliasingArguments(this)),
|
||||||
...getExtraOptionsFromEnv(["database", "init"]),
|
...extraArgs,
|
||||||
], { stdin: externalRepositoryToken });
|
...getExtraOptionsFromEnv(["database", "init"]),
|
||||||
|
], { stdin: externalRepositoryToken });
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw (0, cli_errors_1.wrapCliConfigurationError)(e);
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async runAutobuild(language) {
|
async runAutobuild(language) {
|
||||||
const autobuildCmd = path.join(await this.resolveExtractor(language), "tools", process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh");
|
const autobuildCmd = path.join(await this.resolveExtractor(language), "tools", process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh");
|
||||||
@@ -342,7 +336,15 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
// When `DYLD_INSERT_LIBRARIES` is set in the environment for a step,
|
// When `DYLD_INSERT_LIBRARIES` is set in the environment for a step,
|
||||||
// the Actions runtime introduces its own workaround for SIP
|
// the Actions runtime introduces its own workaround for SIP
|
||||||
// (https://github.com/actions/runner/pull/416).
|
// (https://github.com/actions/runner/pull/416).
|
||||||
await runTool(autobuildCmd);
|
try {
|
||||||
|
await runTool(autobuildCmd);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw (0, cli_errors_1.wrapCliConfigurationError)(e);
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async extractScannedLanguage(config, language) {
|
async extractScannedLanguage(config, language) {
|
||||||
await runTool(cmd, [
|
await runTool(cmd, [
|
||||||
@@ -354,6 +356,16 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
util.getCodeQLDatabasePath(config, language),
|
util.getCodeQLDatabasePath(config, language),
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
async extractUsingBuildMode(config, language) {
|
||||||
|
await runTool(cmd, [
|
||||||
|
"database",
|
||||||
|
"trace-command",
|
||||||
|
"--use-build-mode",
|
||||||
|
...(await getTrapCachingExtractorConfigArgsForLang(config, language)),
|
||||||
|
...getExtraOptionsFromEnv(["database", "trace-command"]),
|
||||||
|
util.getCodeQLDatabasePath(config, language),
|
||||||
|
]);
|
||||||
|
},
|
||||||
async finalizeDatabase(databasePath, threadsFlag, memoryFlag) {
|
async finalizeDatabase(databasePath, threadsFlag, memoryFlag) {
|
||||||
const args = [
|
const args = [
|
||||||
"database",
|
"database",
|
||||||
@@ -368,11 +380,8 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
await runTool(cmd, args);
|
await runTool(cmd, args);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if (e instanceof CommandInvocationError &&
|
if (e instanceof Error) {
|
||||||
!(await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_BETTER_NO_CODE_ERROR_MESSAGE)) &&
|
throw (0, cli_errors_1.wrapCliConfigurationError)(e);
|
||||||
isNoCodeFoundError(e)) {
|
|
||||||
throw new util.UserError("No code found during the build. Please see: " +
|
|
||||||
"https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build");
|
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
@@ -447,7 +456,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
throw new Error(`Unexpected output from codeql resolve build-environment: ${e} in\n${output}`);
|
throw new Error(`Unexpected output from codeql resolve build-environment: ${e} in\n${output}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async databaseRunQueries(databasePath, flags, features) {
|
async databaseRunQueries(databasePath, flags) {
|
||||||
const codeqlArgs = [
|
const codeqlArgs = [
|
||||||
"database",
|
"database",
|
||||||
"run-queries",
|
"run-queries",
|
||||||
@@ -460,12 +469,9 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
if (await util.supportExpectDiscardedCache(this)) {
|
if (await util.supportExpectDiscardedCache(this)) {
|
||||||
codeqlArgs.push("--expect-discarded-cache");
|
codeqlArgs.push("--expect-discarded-cache");
|
||||||
}
|
}
|
||||||
if (await features.getValue(feature_flags_1.Feature.EvaluatorFineGrainedParallelismEnabled, this)) {
|
if (await util.codeQlVersionAbove(this, feature_flags_1.CODEQL_VERSION_FINE_GRAINED_PARALLELISM)) {
|
||||||
codeqlArgs.push("--intra-layer-parallelism");
|
codeqlArgs.push("--intra-layer-parallelism");
|
||||||
}
|
}
|
||||||
else if (await util.codeQlVersionAbove(this, feature_flags_1.CODEQL_VERSION_FINE_GRAINED_PARALLELISM)) {
|
|
||||||
codeqlArgs.push("--no-intra-layer-parallelism");
|
|
||||||
}
|
|
||||||
await runTool(cmd, codeqlArgs);
|
await runTool(cmd, codeqlArgs);
|
||||||
},
|
},
|
||||||
async databaseInterpretResults(databasePath, querySuitePaths, sarifFile, addSnippetsFlag, threadsFlag, verbosityFlag, automationDetailsId, config, features, logger) {
|
async databaseInterpretResults(databasePath, querySuitePaths, sarifFile, addSnippetsFlag, threadsFlag, verbosityFlag, automationDetailsId, config, features, logger) {
|
||||||
@@ -679,7 +685,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
// CodeQL object is created.
|
// CodeQL object is created.
|
||||||
if (checkVersion &&
|
if (checkVersion &&
|
||||||
!(await util.codeQlVersionAbove(codeql, CODEQL_MINIMUM_VERSION))) {
|
!(await util.codeQlVersionAbove(codeql, CODEQL_MINIMUM_VERSION))) {
|
||||||
throw new util.UserError(`Expected a CodeQL CLI with version at least ${CODEQL_MINIMUM_VERSION} but got version ${(await codeql.getVersion()).version}`);
|
throw new util.ConfigurationError(`Expected a CodeQL CLI with version at least ${CODEQL_MINIMUM_VERSION} but got version ${(await codeql.getVersion()).version}`);
|
||||||
}
|
}
|
||||||
else if (checkVersion &&
|
else if (checkVersion &&
|
||||||
process.env[environment_1.EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] !== "true" &&
|
process.env[environment_1.EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] !== "true" &&
|
||||||
@@ -784,71 +790,10 @@ async function runTool(cmd, args = [], opts = {}) {
|
|||||||
...(opts.stdin ? { input: Buffer.from(opts.stdin || "") } : {}),
|
...(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 cli_errors_1.CommandInvocationError(cmd, args, exitCode, error, output);
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Provide a better error message from the stderr of a CLI invocation that failed with a fatal
|
|
||||||
* error.
|
|
||||||
*
|
|
||||||
* - If the CLI invocation failed with a fatal error, this returns that fatal error, followed by
|
|
||||||
* any fatal errors that occurred in plumbing commands.
|
|
||||||
* - If the CLI invocation did not fail with a fatal error, this returns `undefined`.
|
|
||||||
*
|
|
||||||
* ### Example
|
|
||||||
*
|
|
||||||
* ```
|
|
||||||
* Running TRAP import for CodeQL database at /home/runner/work/_temp/codeql_databases/javascript...
|
|
||||||
* A fatal error occurred: Evaluator heap must be at least 384.00 MiB
|
|
||||||
* A fatal error occurred: Dataset import for
|
|
||||||
* /home/runner/work/_temp/codeql_databases/javascript/db-javascript failed with code 2
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* becomes
|
|
||||||
*
|
|
||||||
* ```
|
|
||||||
* Encountered a fatal error while running "codeql-for-testing database finalize --finalize-dataset
|
|
||||||
* --threads=2 --ram=2048 db". Exit code was 32 and error was: A fatal error occurred: Dataset
|
|
||||||
* import for /home/runner/work/_temp/codeql_databases/javascript/db-javascript failed with code 2.
|
|
||||||
* Context: A fatal error occurred: Evaluator heap must be at least 384.00 MiB.
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* Where possible, this tries to summarize the error into a single line, as this displays better in
|
|
||||||
* the Actions UI.
|
|
||||||
*/
|
|
||||||
function extractFatalErrors(error) {
|
|
||||||
const fatalErrorRegex = /.*fatal error occurred:/gi;
|
|
||||||
let fatalErrors = [];
|
|
||||||
let lastFatalErrorIndex;
|
|
||||||
let match;
|
|
||||||
while ((match = fatalErrorRegex.exec(error)) !== null) {
|
|
||||||
if (lastFatalErrorIndex !== undefined) {
|
|
||||||
fatalErrors.push(error.slice(lastFatalErrorIndex, match.index).trim());
|
|
||||||
}
|
|
||||||
lastFatalErrorIndex = match.index;
|
|
||||||
}
|
|
||||||
if (lastFatalErrorIndex !== undefined) {
|
|
||||||
const lastError = error.slice(lastFatalErrorIndex).trim();
|
|
||||||
if (fatalErrors.length === 0) {
|
|
||||||
// No other errors
|
|
||||||
return lastError;
|
|
||||||
}
|
|
||||||
const isOneLiner = !fatalErrors.some((e) => e.includes("\n"));
|
|
||||||
if (isOneLiner) {
|
|
||||||
fatalErrors = fatalErrors.map(ensureEndsInPeriod);
|
|
||||||
}
|
|
||||||
return [
|
|
||||||
ensureEndsInPeriod(lastError),
|
|
||||||
"Context:",
|
|
||||||
...fatalErrors.reverse(),
|
|
||||||
].join(isOneLiner ? " " : "\n");
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
function ensureEndsInPeriod(text) {
|
|
||||||
return text[text.length - 1] === "." ? text : `${text}.`;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Generates a code scanning configuration that is to be used for a scan.
|
* Generates a code scanning configuration that is to be used for a scan.
|
||||||
*
|
*
|
||||||
@@ -950,18 +895,6 @@ function getGeneratedCodeScanningConfigPath(config) {
|
|||||||
return path.resolve(config.tempDir, "user-config.yaml");
|
return path.resolve(config.tempDir, "user-config.yaml");
|
||||||
}
|
}
|
||||||
exports.getGeneratedCodeScanningConfigPath = getGeneratedCodeScanningConfigPath;
|
exports.getGeneratedCodeScanningConfigPath = getGeneratedCodeScanningConfigPath;
|
||||||
function isNoCodeFoundError(e) {
|
|
||||||
/**
|
|
||||||
* Earlier versions of the JavaScript extractor (pre-CodeQL 2.12.0) extract externs even if no
|
|
||||||
* source code was found. This means that we don't get the no code found error from
|
|
||||||
* `codeql database finalize`. To ensure users get a good error message, we detect this manually
|
|
||||||
* here, and upon detection override the error message.
|
|
||||||
*
|
|
||||||
* This can be removed once support for CodeQL 2.11.6 is removed.
|
|
||||||
*/
|
|
||||||
const javascriptNoCodeFoundWarning = "No JavaScript or TypeScript code found.";
|
|
||||||
return e.exitCode === 32 || e.stderr.includes(javascriptNoCodeFoundWarning);
|
|
||||||
}
|
|
||||||
async function isDiagnosticsExportInvalidSarifFixed(codeql) {
|
async function isDiagnosticsExportInvalidSarifFixed(codeql) {
|
||||||
return await util.codeQlVersionAbove(codeql, exports.CODEQL_VERSION_DIAGNOSTICS_EXPORT_FIXED);
|
return await util.codeQlVersionAbove(codeql, exports.CODEQL_VERSION_DIAGNOSTICS_EXPORT_FIXED);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
40
lib/codeql.test.js
generated
40
lib/codeql.test.js
generated
@@ -49,25 +49,9 @@ const util_1 = require("./util");
|
|||||||
let stubConfig;
|
let stubConfig;
|
||||||
ava_1.default.beforeEach(() => {
|
ava_1.default.beforeEach(() => {
|
||||||
(0, util_1.initializeEnvironment)("1.2.3");
|
(0, util_1.initializeEnvironment)("1.2.3");
|
||||||
stubConfig = {
|
stubConfig = (0, testing_utils_1.createTestConfig)({
|
||||||
languages: [languages_1.Language.cpp],
|
languages: [languages_1.Language.cpp],
|
||||||
originalUserInput: {},
|
});
|
||||||
tempDir: "",
|
|
||||||
codeQLCmd: "",
|
|
||||||
gitHubVersion: {
|
|
||||||
type: util.GitHubVariant.DOTCOM,
|
|
||||||
},
|
|
||||||
dbLocation: "",
|
|
||||||
debugMode: false,
|
|
||||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
|
||||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
|
||||||
augmentationProperties: {
|
|
||||||
packsInputCombines: false,
|
|
||||||
queriesInputCombines: false,
|
|
||||||
},
|
|
||||||
trapCaches: {},
|
|
||||||
trapCacheDownloadTime: 0,
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
async function installIntoToolcache({ apiDetails = testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, cliVersion, isPinned, tagName, tmpDir, }) {
|
async function installIntoToolcache({ apiDetails = testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, cliVersion, isPinned, tagName, tmpDir, }) {
|
||||||
const url = (0, testing_utils_1.mockBundleDownloadApi)({ apiDetails, isPinned, tagName });
|
const url = (0, testing_utils_1.mockBundleDownloadApi)({ apiDetails, isPinned, tagName });
|
||||||
@@ -570,8 +554,9 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
|
|||||||
// 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 t.throwsAsync(async () => await codeqlObject.finalizeDatabase("", "", ""), {
|
await t.throwsAsync(async () => await codeqlObject.finalizeDatabase("", "", ""), {
|
||||||
message: "No code found during the build. Please see: " +
|
instanceOf: util.ConfigurationError,
|
||||||
"https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build",
|
message: new RegExp("No code found during the build\\. Please see: " +
|
||||||
|
"https://gh\\.io/troubleshooting-code-scanning/no-source-code-seen-during-build\\."),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("database finalize overrides no code found error on CodeQL 2.11.6", async (t) => {
|
(0, ava_1.default)("database finalize overrides no code found error on CodeQL 2.11.6", async (t) => {
|
||||||
@@ -581,8 +566,9 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
|
|||||||
// 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 t.throwsAsync(async () => await codeqlObject.finalizeDatabase("", "", ""), {
|
await t.throwsAsync(async () => await codeqlObject.finalizeDatabase("", "", ""), {
|
||||||
message: "No code found during the build. Please see: " +
|
instanceOf: util.ConfigurationError,
|
||||||
"https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build",
|
message: new RegExp("No code found during the build\\. Please see: " +
|
||||||
|
"https://gh\\.io/troubleshooting-code-scanning/no-source-code-seen-during-build\\."),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("database finalize does not override no code found error on CodeQL 2.12.4", async (t) => {
|
(0, ava_1.default)("database finalize does not override no code found error on CodeQL 2.12.4", async (t) => {
|
||||||
@@ -609,8 +595,9 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
|
|||||||
// 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 t.throwsAsync(async () => await codeqlObject.finalizeDatabase("db", "--threads=2", "--ram=2048"), {
|
await t.throwsAsync(async () => await codeqlObject.finalizeDatabase("db", "--threads=2", "--ram=2048"), {
|
||||||
message: 'Encountered a fatal error while running "codeql-for-testing database finalize --finalize-dataset --threads=2 --ram=2048 db". ' +
|
instanceOf: util.ConfigurationError,
|
||||||
`Exit code was 32 and error was: ${datasetImportError}. Context: ${heapError}. See the logs for more details.`,
|
message: new RegExp('Encountered a fatal error while running \\"codeql-for-testing database finalize --finalize-dataset --threads=2 --ram=2048 db\\"\\. ' +
|
||||||
|
`Exit code was 32 and error was: ${datasetImportError.replaceAll(".", "\\.")}\\. Context: ${heapError.replaceAll(".", "\\.")}\\. See the logs for more details\\.`),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("runTool outputs last line of stderr if fatal error could not be found", async (t) => {
|
(0, ava_1.default)("runTool outputs last line of stderr if fatal error could not be found", async (t) => {
|
||||||
@@ -621,8 +608,9 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
|
|||||||
// 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 t.throwsAsync(async () => await codeqlObject.finalizeDatabase("db", "--threads=2", "--ram=2048"), {
|
await t.throwsAsync(async () => await codeqlObject.finalizeDatabase("db", "--threads=2", "--ram=2048"), {
|
||||||
message: 'Encountered a fatal error while running "codeql-for-testing database finalize --finalize-dataset --threads=2 --ram=2048 db". ' +
|
instanceOf: util.ConfigurationError,
|
||||||
"Exit code was 32 and last log line was: line5. See the logs for more details.",
|
message: new RegExp('Encountered a fatal error while running \\"codeql-for-testing database finalize --finalize-dataset --threads=2 --ram=2048 db\\"\\. ' +
|
||||||
|
"Exit code was 32 and last log line was: line5\\. See the logs for more details\\."),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
function stubToolRunnerConstructor(exitCode = 0, stderr) {
|
function stubToolRunnerConstructor(exitCode = 0, stderr) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
109
lib/config-utils.js
generated
109
lib/config-utils.js
generated
@@ -23,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.wrapEnvironment = exports.generateRegistries = exports.getConfig = exports.getPathToParsedConfigFile = exports.initConfig = exports.validatePackSpecification = exports.parsePacksSpecification = exports.parsePacksFromInput = exports.calculateAugmentation = exports.getDefaultConfig = exports.getRawLanguages = exports.getLanguageAliases = exports.getLanguages = exports.getLanguagesInRepo = exports.getUnknownLanguagesError = exports.getNoLanguagesError = exports.getConfigFileDirectoryGivenMessage = exports.getConfigFileFormatInvalidMessage = exports.getConfigFileRepoFormatInvalidMessage = exports.getConfigFileDoesNotExistErrorMessage = exports.getConfigFileOutsideWorkspaceErrorMessage = exports.getPacksStrInvalid = exports.defaultAugmentationProperties = void 0;
|
exports.parseBuildModeInput = exports.wrapEnvironment = exports.generateRegistries = exports.getConfig = exports.getPathToParsedConfigFile = exports.initConfig = exports.validatePackSpecification = exports.parsePacksSpecification = exports.parsePacksFromInput = exports.calculateAugmentation = exports.getDefaultConfig = exports.getRawLanguages = exports.getLanguageAliases = exports.getLanguages = exports.getLanguagesInRepo = exports.getUnknownLanguagesError = exports.getNoLanguagesError = exports.getConfigFileDirectoryGivenMessage = exports.getConfigFileFormatInvalidMessage = exports.getConfigFileRepoFormatInvalidMessage = exports.getConfigFileDoesNotExistErrorMessage = exports.getConfigFileOutsideWorkspaceErrorMessage = exports.getPacksStrInvalid = exports.defaultAugmentationProperties = exports.BuildMode = 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");
|
const perf_hooks_1 = require("perf_hooks");
|
||||||
@@ -31,11 +31,18 @@ const yaml = __importStar(require("js-yaml"));
|
|||||||
const semver = __importStar(require("semver"));
|
const semver = __importStar(require("semver"));
|
||||||
const api = __importStar(require("./api-client"));
|
const api = __importStar(require("./api-client"));
|
||||||
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 trap_caching_1 = require("./trap-caching");
|
const trap_caching_1 = require("./trap-caching");
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
// Property names from the user-supplied config file.
|
// Property names from the user-supplied config file.
|
||||||
const PACKS_PROPERTY = "packs";
|
const PACKS_PROPERTY = "packs";
|
||||||
|
var BuildMode;
|
||||||
|
(function (BuildMode) {
|
||||||
|
BuildMode["None"] = "none";
|
||||||
|
BuildMode["Autobuild"] = "autobuild";
|
||||||
|
BuildMode["Manual"] = "manual";
|
||||||
|
})(BuildMode || (exports.BuildMode = BuildMode = {}));
|
||||||
/**
|
/**
|
||||||
* The default, empty augmentation properties. This is most useful
|
* The default, empty augmentation properties. This is most useful
|
||||||
* for tests.
|
* for tests.
|
||||||
@@ -148,7 +155,7 @@ async function getLanguages(codeQL, languagesInput, repository, logger) {
|
|||||||
// If the languages parameter was not given and no languages were
|
// If the languages parameter was not given and no languages were
|
||||||
// detected then fail here as this is a workflow configuration error.
|
// detected then fail here as this is a workflow configuration error.
|
||||||
if (languages.length === 0) {
|
if (languages.length === 0) {
|
||||||
throw new util_1.UserError(getNoLanguagesError());
|
throw new util_1.ConfigurationError(getNoLanguagesError());
|
||||||
}
|
}
|
||||||
// Make sure they are supported
|
// Make sure they are supported
|
||||||
const parsedLanguages = [];
|
const parsedLanguages = [];
|
||||||
@@ -165,7 +172,7 @@ async function getLanguages(codeQL, languagesInput, repository, logger) {
|
|||||||
// Any unknown languages here would have come directly from the input
|
// Any unknown languages here would have come directly from the input
|
||||||
// since we filter unknown languages coming from the GitHub API.
|
// since we filter unknown languages coming from the GitHub API.
|
||||||
if (unknownLanguages.length > 0) {
|
if (unknownLanguages.length > 0) {
|
||||||
throw new util_1.UserError(getUnknownLanguagesError(unknownLanguages));
|
throw new util_1.ConfigurationError(getUnknownLanguagesError(unknownLanguages));
|
||||||
}
|
}
|
||||||
return parsedLanguages;
|
return parsedLanguages;
|
||||||
}
|
}
|
||||||
@@ -212,16 +219,18 @@ exports.getRawLanguages = getRawLanguages;
|
|||||||
/**
|
/**
|
||||||
* 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, gitHubVersion, logger) {
|
async function getDefaultConfig({ languagesInput, queriesInput, packsInput, buildModeInput, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeql, githubVersion, features, logger, }) {
|
||||||
const languages = await getLanguages(codeQL, languagesInput, repository, logger);
|
const languages = await getLanguages(codeql, languagesInput, repository, logger);
|
||||||
const augmentationProperties = calculateAugmentation(rawPacksInput, rawQueriesInput, languages);
|
const buildMode = await parseBuildModeInput(buildModeInput, languages, features, logger);
|
||||||
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(trapCachingEnabled, codeQL, languages, logger);
|
const augmentationProperties = calculateAugmentation(packsInput, queriesInput, languages);
|
||||||
|
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(trapCachingEnabled, codeql, languages, logger);
|
||||||
return {
|
return {
|
||||||
languages,
|
languages,
|
||||||
|
buildMode,
|
||||||
originalUserInput: {},
|
originalUserInput: {},
|
||||||
tempDir,
|
tempDir,
|
||||||
codeQLCmd: codeQL.getPath(),
|
codeQLCmd: codeql.getPath(),
|
||||||
gitHubVersion,
|
gitHubVersion: githubVersion,
|
||||||
dbLocation: dbLocationOrDefault(dbLocation, tempDir),
|
dbLocation: dbLocationOrDefault(dbLocation, tempDir),
|
||||||
debugMode,
|
debugMode,
|
||||||
debugArtifactName,
|
debugArtifactName,
|
||||||
@@ -245,7 +254,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, logger) {
|
async function loadConfig({ languagesInput, queriesInput, packsInput, buildModeInput, configFile, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeql, workspacePath, githubVersion, apiDetails, features, logger, }) {
|
||||||
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
|
||||||
@@ -255,15 +264,17 @@ async function loadConfig(languagesInput, rawQueriesInput, rawPacksInput, config
|
|||||||
else {
|
else {
|
||||||
parsedYAML = await getRemoteConfig(configFile, apiDetails);
|
parsedYAML = await getRemoteConfig(configFile, apiDetails);
|
||||||
}
|
}
|
||||||
const languages = await getLanguages(codeQL, languagesInput, repository, logger);
|
const languages = await getLanguages(codeql, languagesInput, repository, logger);
|
||||||
const augmentationProperties = calculateAugmentation(rawPacksInput, rawQueriesInput, languages);
|
const buildMode = await parseBuildModeInput(buildModeInput, languages, features, logger);
|
||||||
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(trapCachingEnabled, codeQL, languages, logger);
|
const augmentationProperties = calculateAugmentation(packsInput, queriesInput, languages);
|
||||||
|
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime(trapCachingEnabled, codeql, languages, logger);
|
||||||
return {
|
return {
|
||||||
languages,
|
languages,
|
||||||
|
buildMode,
|
||||||
originalUserInput: parsedYAML,
|
originalUserInput: parsedYAML,
|
||||||
tempDir,
|
tempDir,
|
||||||
codeQLCmd: codeQL.getPath(),
|
codeQLCmd: codeql.getPath(),
|
||||||
gitHubVersion,
|
gitHubVersion: githubVersion,
|
||||||
dbLocation: dbLocationOrDefault(dbLocation, tempDir),
|
dbLocation: dbLocationOrDefault(dbLocation, tempDir),
|
||||||
debugMode,
|
debugMode,
|
||||||
debugArtifactName,
|
debugArtifactName,
|
||||||
@@ -313,7 +324,7 @@ function parseQueriesFromInput(rawQueriesInput, queriesInputCombines) {
|
|||||||
? rawQueriesInput.trim().slice(1).trim()
|
? rawQueriesInput.trim().slice(1).trim()
|
||||||
: rawQueriesInput?.trim() ?? "";
|
: rawQueriesInput?.trim() ?? "";
|
||||||
if (queriesInputCombines && trimmedInput.length === 0) {
|
if (queriesInputCombines && trimmedInput.length === 0) {
|
||||||
throw new util_1.UserError(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 util_1.ConfigurationError(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."));
|
||||||
}
|
}
|
||||||
return trimmedInput.split(",").map((query) => ({ uses: query.trim() }));
|
return trimmedInput.split(",").map((query) => ({ uses: query.trim() }));
|
||||||
}
|
}
|
||||||
@@ -333,16 +344,16 @@ function parsePacksFromInput(rawPacksInput, languages, packsInputCombines) {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
if (languages.length > 1) {
|
if (languages.length > 1) {
|
||||||
throw new util_1.UserError("Cannot specify a 'packs' input in a multi-language analysis. Use a codeql-config.yml file instead and specify packs by language.");
|
throw new util_1.ConfigurationError("Cannot specify a 'packs' input in a multi-language analysis. Use a codeql-config.yml file instead and specify packs by language.");
|
||||||
}
|
}
|
||||||
else if (languages.length === 0) {
|
else if (languages.length === 0) {
|
||||||
throw new util_1.UserError("No languages specified. Cannot process the packs input.");
|
throw new util_1.ConfigurationError("No languages specified. Cannot process the packs input.");
|
||||||
}
|
}
|
||||||
rawPacksInput = rawPacksInput.trim();
|
rawPacksInput = rawPacksInput.trim();
|
||||||
if (packsInputCombines) {
|
if (packsInputCombines) {
|
||||||
rawPacksInput = rawPacksInput.trim().substring(1).trim();
|
rawPacksInput = rawPacksInput.trim().substring(1).trim();
|
||||||
if (!rawPacksInput) {
|
if (!rawPacksInput) {
|
||||||
throw new util_1.UserError(getConfigFilePropertyError(undefined, "packs", "A '+' was used in the 'packs' 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 util_1.ConfigurationError(getConfigFilePropertyError(undefined, "packs", "A '+' was used in the 'packs' 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."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@@ -373,7 +384,7 @@ exports.parsePacksFromInput = parsePacksFromInput;
|
|||||||
*/
|
*/
|
||||||
function parsePacksSpecification(packStr) {
|
function parsePacksSpecification(packStr) {
|
||||||
if (typeof packStr !== "string") {
|
if (typeof packStr !== "string") {
|
||||||
throw new util_1.UserError(getPacksStrInvalid(packStr));
|
throw new util_1.ConfigurationError(getPacksStrInvalid(packStr));
|
||||||
}
|
}
|
||||||
packStr = packStr.trim();
|
packStr = packStr.trim();
|
||||||
const atIndex = packStr.indexOf("@");
|
const atIndex = packStr.indexOf("@");
|
||||||
@@ -394,7 +405,7 @@ function parsePacksSpecification(packStr) {
|
|||||||
? packStr.slice(pathStart, pathEnd).trim()
|
? packStr.slice(pathStart, pathEnd).trim()
|
||||||
: undefined;
|
: undefined;
|
||||||
if (!PACK_IDENTIFIER_PATTERN.test(packName)) {
|
if (!PACK_IDENTIFIER_PATTERN.test(packName)) {
|
||||||
throw new util_1.UserError(getPacksStrInvalid(packStr));
|
throw new util_1.ConfigurationError(getPacksStrInvalid(packStr));
|
||||||
}
|
}
|
||||||
if (version) {
|
if (version) {
|
||||||
try {
|
try {
|
||||||
@@ -402,7 +413,7 @@ function parsePacksSpecification(packStr) {
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
// The range string is invalid. OK to ignore the caught error
|
// The range string is invalid. OK to ignore the caught error
|
||||||
throw new util_1.UserError(getPacksStrInvalid(packStr));
|
throw new util_1.ConfigurationError(getPacksStrInvalid(packStr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (packPath &&
|
if (packPath &&
|
||||||
@@ -413,11 +424,11 @@ function parsePacksSpecification(packStr) {
|
|||||||
// which seems more awkward.
|
// which seems more awkward.
|
||||||
path.normalize(packPath).split(path.sep).join("/") !==
|
path.normalize(packPath).split(path.sep).join("/") !==
|
||||||
packPath.split(path.sep).join("/"))) {
|
packPath.split(path.sep).join("/"))) {
|
||||||
throw new util_1.UserError(getPacksStrInvalid(packStr));
|
throw new util_1.ConfigurationError(getPacksStrInvalid(packStr));
|
||||||
}
|
}
|
||||||
if (!packPath && pathStart) {
|
if (!packPath && pathStart) {
|
||||||
// 0 length path
|
// 0 length path
|
||||||
throw new util_1.UserError(getPacksStrInvalid(packStr));
|
throw new util_1.ConfigurationError(getPacksStrInvalid(packStr));
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
name: packName,
|
name: packName,
|
||||||
@@ -452,24 +463,26 @@ 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, configFile, dbLocation, configInput, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, logger) {
|
async function initConfig(inputs) {
|
||||||
let config;
|
let config;
|
||||||
|
const { logger, tempDir } = inputs;
|
||||||
// if configInput is set, it takes precedence over configFile
|
// if configInput is set, it takes precedence over configFile
|
||||||
if (configInput) {
|
if (inputs.configInput) {
|
||||||
if (configFile) {
|
if (inputs.configFile) {
|
||||||
logger.warning(`Both a config file and config input were provided. Ignoring config file.`);
|
logger.warning(`Both a config file and config input were provided. Ignoring config file.`);
|
||||||
}
|
}
|
||||||
configFile = path.resolve(workspacePath, "user-config-from-action.yml");
|
inputs.configFile = path.resolve(tempDir, "user-config-from-action.yml");
|
||||||
fs.writeFileSync(configFile, configInput);
|
fs.writeFileSync(inputs.configFile, inputs.configInput);
|
||||||
logger.debug(`Using config from action input: ${configFile}`);
|
logger.debug(`Using config from action input: ${inputs.configFile}`);
|
||||||
}
|
}
|
||||||
// If no config file was provided create an empty one
|
// If no config file was provided create an empty one
|
||||||
if (!configFile) {
|
if (!inputs.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, gitHubVersion, logger);
|
config = await getDefaultConfig(inputs);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
config = await loadConfig(languagesInput, queriesInput, packsInput, configFile, dbLocation, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, logger);
|
// Convince the type checker that inputs.configFile is defined.
|
||||||
|
config = await loadConfig({ ...inputs, configFile: inputs.configFile });
|
||||||
}
|
}
|
||||||
// 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);
|
||||||
@@ -483,7 +496,7 @@ function parseRegistries(registriesInput) {
|
|||||||
: undefined;
|
: undefined;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
throw new util_1.UserError("Invalid registries input. Must be a YAML string.");
|
throw new util_1.ConfigurationError("Invalid registries input. Must be a YAML string.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function isLocal(configPath) {
|
function isLocal(configPath) {
|
||||||
@@ -496,11 +509,11 @@ function isLocal(configPath) {
|
|||||||
function getLocalConfig(configFile, workspacePath) {
|
function getLocalConfig(configFile, workspacePath) {
|
||||||
// Error if the config file is now outside of the workspace
|
// Error if the config file is now outside of the workspace
|
||||||
if (!(configFile + path.sep).startsWith(workspacePath + path.sep)) {
|
if (!(configFile + path.sep).startsWith(workspacePath + path.sep)) {
|
||||||
throw new util_1.UserError(getConfigFileOutsideWorkspaceErrorMessage(configFile));
|
throw new util_1.ConfigurationError(getConfigFileOutsideWorkspaceErrorMessage(configFile));
|
||||||
}
|
}
|
||||||
// Error if the file does not exist
|
// Error if the file does not exist
|
||||||
if (!fs.existsSync(configFile)) {
|
if (!fs.existsSync(configFile)) {
|
||||||
throw new util_1.UserError(getConfigFileDoesNotExistErrorMessage(configFile));
|
throw new util_1.ConfigurationError(getConfigFileDoesNotExistErrorMessage(configFile));
|
||||||
}
|
}
|
||||||
return yaml.load(fs.readFileSync(configFile, "utf8"));
|
return yaml.load(fs.readFileSync(configFile, "utf8"));
|
||||||
}
|
}
|
||||||
@@ -510,7 +523,7 @@ async function getRemoteConfig(configFile, apiDetails) {
|
|||||||
const pieces = format.exec(configFile);
|
const pieces = format.exec(configFile);
|
||||||
// 5 = 4 groups + the whole expression
|
// 5 = 4 groups + the whole expression
|
||||||
if (pieces === null || pieces.groups === undefined || pieces.length < 5) {
|
if (pieces === null || pieces.groups === undefined || pieces.length < 5) {
|
||||||
throw new util_1.UserError(getConfigFileRepoFormatInvalidMessage(configFile));
|
throw new util_1.ConfigurationError(getConfigFileRepoFormatInvalidMessage(configFile));
|
||||||
}
|
}
|
||||||
const response = await api
|
const response = await api
|
||||||
.getApiClientWithExternalAuth(apiDetails)
|
.getApiClientWithExternalAuth(apiDetails)
|
||||||
@@ -525,10 +538,10 @@ async function getRemoteConfig(configFile, apiDetails) {
|
|||||||
fileContents = response.data.content;
|
fileContents = response.data.content;
|
||||||
}
|
}
|
||||||
else if (Array.isArray(response.data)) {
|
else if (Array.isArray(response.data)) {
|
||||||
throw new util_1.UserError(getConfigFileDirectoryGivenMessage(configFile));
|
throw new util_1.ConfigurationError(getConfigFileDirectoryGivenMessage(configFile));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new util_1.UserError(getConfigFileFormatInvalidMessage(configFile));
|
throw new util_1.ConfigurationError(getConfigFileFormatInvalidMessage(configFile));
|
||||||
}
|
}
|
||||||
return yaml.load(Buffer.from(fileContents, "base64").toString("binary"));
|
return yaml.load(Buffer.from(fileContents, "base64").toString("binary"));
|
||||||
}
|
}
|
||||||
@@ -607,7 +620,7 @@ 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)) {
|
||||||
throw new util_1.UserError("Invalid 'registries' input. Must be an array of objects with 'url' and 'packages' properties.");
|
throw new util_1.ConfigurationError("Invalid 'registries' input. Must be an array of objects with 'url' and 'packages' properties.");
|
||||||
}
|
}
|
||||||
// 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) => ({
|
||||||
@@ -654,4 +667,20 @@ async function wrapEnvironment(env, operation) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.wrapEnvironment = wrapEnvironment;
|
exports.wrapEnvironment = wrapEnvironment;
|
||||||
|
// Exported for testing
|
||||||
|
async function parseBuildModeInput(input, languages, features, logger) {
|
||||||
|
if (input === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (!Object.values(BuildMode).includes(input)) {
|
||||||
|
throw new util_1.ConfigurationError(`Invalid build mode: '${input}'. Supported build modes are: ${Object.values(BuildMode).join(", ")}.`);
|
||||||
|
}
|
||||||
|
if (languages.includes(languages_1.Language.java) &&
|
||||||
|
(await features.getValue(feature_flags_1.Feature.DisableJavaBuildlessEnabled))) {
|
||||||
|
logger.warning("Scanning Java code without a build is temporarily unavailable. Falling back to 'autobuild' build mode.");
|
||||||
|
return BuildMode.Autobuild;
|
||||||
|
}
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
exports.parseBuildModeInput = parseBuildModeInput;
|
||||||
//# sourceMappingURL=config-utils.js.map
|
//# sourceMappingURL=config-utils.js.map
|
||||||
File diff suppressed because one or more lines are too long
256
lib/config-utils.test.js
generated
256
lib/config-utils.test.js
generated
@@ -35,20 +35,44 @@ const sinon = __importStar(require("sinon"));
|
|||||||
const api = __importStar(require("./api-client"));
|
const api = __importStar(require("./api-client"));
|
||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
const configUtils = __importStar(require("./config-utils"));
|
const configUtils = __importStar(require("./config-utils"));
|
||||||
|
const config_utils_1 = require("./config-utils");
|
||||||
|
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 testing_utils_1 = require("./testing-utils");
|
const testing_utils_1 = require("./testing-utils");
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
(0, testing_utils_1.setupTests)(ava_1.default);
|
(0, testing_utils_1.setupTests)(ava_1.default);
|
||||||
const sampleApiDetails = {
|
const githubVersion = { type: util_1.GitHubVariant.DOTCOM };
|
||||||
auth: "token",
|
function createTestInitConfigInputs(overrides) {
|
||||||
externalRepoAuth: "token",
|
return Object.assign({}, {
|
||||||
url: "https://github.example.com",
|
languagesInput: undefined,
|
||||||
apiURL: undefined,
|
queriesInput: undefined,
|
||||||
registriesAuthTokens: undefined,
|
packsInput: undefined,
|
||||||
};
|
configFile: undefined,
|
||||||
const gitHubVersion = { type: util_1.GitHubVariant.DOTCOM };
|
dbLocation: undefined,
|
||||||
|
configInput: undefined,
|
||||||
|
buildModeInput: undefined,
|
||||||
|
trapCachingEnabled: false,
|
||||||
|
debugMode: false,
|
||||||
|
debugArtifactName: "",
|
||||||
|
debugDatabaseName: "",
|
||||||
|
repository: { owner: "github", repo: "example" },
|
||||||
|
tempDir: "",
|
||||||
|
codeql: {},
|
||||||
|
workspacePath: "",
|
||||||
|
githubVersion,
|
||||||
|
apiDetails: {
|
||||||
|
auth: "token",
|
||||||
|
externalRepoAuth: "token",
|
||||||
|
url: "https://github.example.com",
|
||||||
|
apiURL: undefined,
|
||||||
|
registriesAuthTokens: undefined,
|
||||||
|
},
|
||||||
|
features: (0, testing_utils_1.createFeatures)([]),
|
||||||
|
logger: (0, logging_1.getRunnerLogger)(true),
|
||||||
|
}, overrides);
|
||||||
|
}
|
||||||
// Returns the filepath of the newly-created file
|
// Returns the filepath of the newly-created file
|
||||||
function createConfigFile(inputFileContents, tmpDir) {
|
function createConfigFile(inputFileContents, tmpDir) {
|
||||||
const configFilePath = path.join(tmpDir, "input");
|
const configFilePath = path.join(tmpDir, "input");
|
||||||
@@ -83,10 +107,10 @@ function mockListLanguages(languages) {
|
|||||||
sinon.stub(api, "getApiClient").value(() => client);
|
sinon.stub(api, "getApiClient").value(() => client);
|
||||||
}
|
}
|
||||||
(0, ava_1.default)("load empty config", async (t) => {
|
(0, ava_1.default)("load empty config", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
const logger = (0, logging_1.getRunnerLogger)(true);
|
const logger = (0, logging_1.getRunnerLogger)(true);
|
||||||
const languages = "javascript,python";
|
const languages = "javascript,python";
|
||||||
const codeQL = (0, codeql_1.setCodeQL)({
|
const codeql = (0, codeql_1.setCodeQL)({
|
||||||
async resolveQueries() {
|
async resolveQueries() {
|
||||||
return {
|
return {
|
||||||
byLanguage: {
|
byLanguage: {
|
||||||
@@ -101,14 +125,25 @@ function mockListLanguages(languages) {
|
|||||||
return { packs: [] };
|
return { packs: [] };
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const config = await configUtils.initConfig(languages, undefined, undefined, undefined, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, logger);
|
const config = await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
t.deepEqual(config, await configUtils.getDefaultConfig(languages, undefined, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, gitHubVersion, logger));
|
languagesInput: languages,
|
||||||
|
repository: { owner: "github", repo: "example" },
|
||||||
|
tempDir,
|
||||||
|
codeql,
|
||||||
|
logger,
|
||||||
|
}));
|
||||||
|
t.deepEqual(config, await configUtils.getDefaultConfig(createTestInitConfigInputs({
|
||||||
|
languagesInput: languages,
|
||||||
|
tempDir,
|
||||||
|
codeql,
|
||||||
|
logger,
|
||||||
|
})));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("loading config saves config", async (t) => {
|
(0, ava_1.default)("loading config saves config", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
const logger = (0, logging_1.getRunnerLogger)(true);
|
const logger = (0, logging_1.getRunnerLogger)(true);
|
||||||
const codeQL = (0, codeql_1.setCodeQL)({
|
const codeql = (0, codeql_1.setCodeQL)({
|
||||||
async resolveQueries() {
|
async resolveQueries() {
|
||||||
return {
|
return {
|
||||||
byLanguage: {
|
byLanguage: {
|
||||||
@@ -124,14 +159,20 @@ function mockListLanguages(languages) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
// Sanity check the saved config file does not already exist
|
// Sanity check the saved config file does not already exist
|
||||||
t.false(fs.existsSync(configUtils.getPathToParsedConfigFile(tmpDir)));
|
t.false(fs.existsSync(configUtils.getPathToParsedConfigFile(tempDir)));
|
||||||
// Sanity check that getConfig returns undefined before we have called initConfig
|
// Sanity check that getConfig returns undefined before we have called initConfig
|
||||||
t.deepEqual(await configUtils.getConfig(tmpDir, logger), undefined);
|
t.deepEqual(await configUtils.getConfig(tempDir, logger), undefined);
|
||||||
const config1 = await configUtils.initConfig("javascript,python", undefined, undefined, undefined, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, logger);
|
const config1 = await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
|
languagesInput: "javascript,python",
|
||||||
|
tempDir,
|
||||||
|
codeql,
|
||||||
|
workspacePath: tempDir,
|
||||||
|
logger,
|
||||||
|
}));
|
||||||
// The saved config file should now exist
|
// The saved config file should now exist
|
||||||
t.true(fs.existsSync(configUtils.getPathToParsedConfigFile(tmpDir)));
|
t.true(fs.existsSync(configUtils.getPathToParsedConfigFile(tempDir)));
|
||||||
// And that same newly-initialised config should now be returned by getConfig
|
// And that same newly-initialised config should now be returned by getConfig
|
||||||
const config2 = await configUtils.getConfig(tmpDir, logger);
|
const config2 = await configUtils.getConfig(tempDir, logger);
|
||||||
t.not(config2, undefined);
|
t.not(config2, undefined);
|
||||||
if (config2 !== undefined) {
|
if (config2 !== undefined) {
|
||||||
// removes properties assigned to undefined.
|
// removes properties assigned to undefined.
|
||||||
@@ -141,46 +182,62 @@ function mockListLanguages(languages) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("load input outside of workspace", async (t) => {
|
(0, ava_1.default)("load input outside of workspace", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
try {
|
try {
|
||||||
await configUtils.initConfig(undefined, undefined, undefined, "../input", undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
|
configFile: "../input",
|
||||||
|
tempDir,
|
||||||
|
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||||
|
workspacePath: tempDir,
|
||||||
|
}));
|
||||||
throw new Error("initConfig did not throw error");
|
throw new Error("initConfig did not throw error");
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
t.deepEqual(err, new util_1.UserError(configUtils.getConfigFileOutsideWorkspaceErrorMessage(path.join(tmpDir, "../input"))));
|
t.deepEqual(err, new util_1.ConfigurationError(configUtils.getConfigFileOutsideWorkspaceErrorMessage(path.join(tempDir, "../input"))));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("load non-local input with invalid repo syntax", async (t) => {
|
(0, ava_1.default)("load non-local input with invalid repo syntax", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
// no filename given, just a repo
|
// no filename given, just a repo
|
||||||
const configFile = "octo-org/codeql-config@main";
|
const configFile = "octo-org/codeql-config@main";
|
||||||
try {
|
try {
|
||||||
await configUtils.initConfig(undefined, undefined, undefined, configFile, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
|
configFile,
|
||||||
|
tempDir,
|
||||||
|
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||||
|
workspacePath: tempDir,
|
||||||
|
}));
|
||||||
throw new Error("initConfig did not throw error");
|
throw new Error("initConfig did not throw error");
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
t.deepEqual(err, new util_1.UserError(configUtils.getConfigFileRepoFormatInvalidMessage("octo-org/codeql-config@main")));
|
t.deepEqual(err, new util_1.ConfigurationError(configUtils.getConfigFileRepoFormatInvalidMessage("octo-org/codeql-config@main")));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("load non-existent input", async (t) => {
|
(0, ava_1.default)("load non-existent input", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
const languages = "javascript";
|
const languagesInput = "javascript";
|
||||||
const configFile = "input";
|
const configFile = "input";
|
||||||
t.false(fs.existsSync(path.join(tmpDir, configFile)));
|
t.false(fs.existsSync(path.join(tempDir, configFile)));
|
||||||
try {
|
try {
|
||||||
await configUtils.initConfig(languages, undefined, undefined, configFile, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
|
languagesInput,
|
||||||
|
configFile,
|
||||||
|
tempDir,
|
||||||
|
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||||
|
workspacePath: tempDir,
|
||||||
|
}));
|
||||||
throw new Error("initConfig did not throw error");
|
throw new Error("initConfig did not throw error");
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
t.deepEqual(err, new util_1.UserError(configUtils.getConfigFileDoesNotExistErrorMessage(path.join(tmpDir, "input"))));
|
t.deepEqual(err, new util_1.ConfigurationError(configUtils.getConfigFileDoesNotExistErrorMessage(path.join(tempDir, "input"))));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("load non-empty input", async (t) => {
|
(0, ava_1.default)("load non-empty input", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
const codeQL = (0, codeql_1.setCodeQL)({
|
const codeql = (0, codeql_1.setCodeQL)({
|
||||||
async resolveQueries() {
|
async resolveQueries() {
|
||||||
return {
|
return {
|
||||||
byLanguage: {
|
byLanguage: {
|
||||||
@@ -208,10 +265,11 @@ function mockListLanguages(languages) {
|
|||||||
- b
|
- b
|
||||||
paths:
|
paths:
|
||||||
- c/d`;
|
- c/d`;
|
||||||
fs.mkdirSync(path.join(tmpDir, "foo"));
|
fs.mkdirSync(path.join(tempDir, "foo"));
|
||||||
// And the config we expect it to parse to
|
// And the config we expect it to parse to
|
||||||
const expectedConfig = {
|
const expectedConfig = {
|
||||||
languages: [languages_1.Language.javascript],
|
languages: [languages_1.Language.javascript],
|
||||||
|
buildMode: config_utils_1.BuildMode.None,
|
||||||
originalUserInput: {
|
originalUserInput: {
|
||||||
name: "my config",
|
name: "my config",
|
||||||
"disable-default-queries": true,
|
"disable-default-queries": true,
|
||||||
@@ -219,10 +277,10 @@ function mockListLanguages(languages) {
|
|||||||
"paths-ignore": ["a", "b"],
|
"paths-ignore": ["a", "b"],
|
||||||
paths: ["c/d"],
|
paths: ["c/d"],
|
||||||
},
|
},
|
||||||
tempDir: tmpDir,
|
tempDir,
|
||||||
codeQLCmd: codeQL.getPath(),
|
codeQLCmd: codeql.getPath(),
|
||||||
gitHubVersion,
|
gitHubVersion: githubVersion,
|
||||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
dbLocation: path.resolve(tempDir, "codeql_databases"),
|
||||||
debugMode: false,
|
debugMode: false,
|
||||||
debugArtifactName: "my-artifact",
|
debugArtifactName: "my-artifact",
|
||||||
debugDatabaseName: "my-db",
|
debugDatabaseName: "my-db",
|
||||||
@@ -230,9 +288,18 @@ function mockListLanguages(languages) {
|
|||||||
trapCaches: {},
|
trapCaches: {},
|
||||||
trapCacheDownloadTime: 0,
|
trapCacheDownloadTime: 0,
|
||||||
};
|
};
|
||||||
const languages = "javascript";
|
const languagesInput = "javascript";
|
||||||
const configFilePath = createConfigFile(inputFileContents, tmpDir);
|
const configFilePath = createConfigFile(inputFileContents, tempDir);
|
||||||
const actualConfig = await configUtils.initConfig(languages, undefined, undefined, configFilePath, undefined, undefined, false, false, "my-artifact", "my-db", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
const actualConfig = await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
|
languagesInput,
|
||||||
|
buildModeInput: "none",
|
||||||
|
configFile: configFilePath,
|
||||||
|
debugArtifactName: "my-artifact",
|
||||||
|
debugDatabaseName: "my-db",
|
||||||
|
tempDir,
|
||||||
|
codeql,
|
||||||
|
workspacePath: tempDir,
|
||||||
|
}));
|
||||||
// Should exactly equal the object we constructed earlier
|
// Should exactly equal the object we constructed earlier
|
||||||
t.deepEqual(actualConfig, expectedConfig);
|
t.deepEqual(actualConfig, expectedConfig);
|
||||||
});
|
});
|
||||||
@@ -256,14 +323,14 @@ function queriesToResolvedQueryForm(queries) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
(0, ava_1.default)("Using config input and file together, config input should be used.", async (t) => {
|
(0, ava_1.default)("Using config input and file together, config input should be used.", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
process.env["RUNNER_TEMP"] = tmpDir;
|
process.env["RUNNER_TEMP"] = tempDir;
|
||||||
process.env["GITHUB_WORKSPACE"] = tmpDir;
|
process.env["GITHUB_WORKSPACE"] = tempDir;
|
||||||
const inputFileContents = `
|
const inputFileContents = `
|
||||||
name: my config
|
name: my config
|
||||||
queries:
|
queries:
|
||||||
- uses: ./foo_file`;
|
- uses: ./foo_file`;
|
||||||
const configFilePath = createConfigFile(inputFileContents, tmpDir);
|
const configFilePath = createConfigFile(inputFileContents, tempDir);
|
||||||
const configInput = `
|
const configInput = `
|
||||||
name: my config
|
name: my config
|
||||||
queries:
|
queries:
|
||||||
@@ -274,9 +341,9 @@ function queriesToResolvedQueryForm(queries) {
|
|||||||
python:
|
python:
|
||||||
- c/d@1.2.3
|
- c/d@1.2.3
|
||||||
`;
|
`;
|
||||||
fs.mkdirSync(path.join(tmpDir, "foo"));
|
fs.mkdirSync(path.join(tempDir, "foo"));
|
||||||
const resolveQueriesArgs = [];
|
const resolveQueriesArgs = [];
|
||||||
const codeQL = (0, codeql_1.setCodeQL)({
|
const codeql = (0, codeql_1.setCodeQL)({
|
||||||
async resolveQueries(queries, extraSearchPath) {
|
async resolveQueries(queries, extraSearchPath) {
|
||||||
resolveQueriesArgs.push({ queries, extraSearchPath });
|
resolveQueriesArgs.push({ queries, extraSearchPath });
|
||||||
return queriesToResolvedQueryForm(queries);
|
return queriesToResolvedQueryForm(queries);
|
||||||
@@ -286,14 +353,21 @@ function queriesToResolvedQueryForm(queries) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
// Only JS, python packs will be ignored
|
// Only JS, python packs will be ignored
|
||||||
const languages = "javascript";
|
const languagesInput = "javascript";
|
||||||
const config = await configUtils.initConfig(languages, undefined, undefined, undefined, configFilePath, configInput, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
const config = await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
|
languagesInput,
|
||||||
|
configFile: configFilePath,
|
||||||
|
configInput,
|
||||||
|
tempDir,
|
||||||
|
codeql,
|
||||||
|
workspacePath: tempDir,
|
||||||
|
}));
|
||||||
t.deepEqual(config.originalUserInput, yaml.load(configInput));
|
t.deepEqual(config.originalUserInput, yaml.load(configInput));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("API client used when reading remote config", async (t) => {
|
(0, ava_1.default)("API client used when reading remote config", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
const codeQL = (0, codeql_1.setCodeQL)({
|
const codeql = (0, codeql_1.setCodeQL)({
|
||||||
async resolveQueries() {
|
async resolveQueries() {
|
||||||
return {
|
return {
|
||||||
byLanguage: {
|
byLanguage: {
|
||||||
@@ -326,47 +400,63 @@ function queriesToResolvedQueryForm(queries) {
|
|||||||
};
|
};
|
||||||
const spyGetContents = mockGetContents(dummyResponse);
|
const spyGetContents = mockGetContents(dummyResponse);
|
||||||
// Create checkout directory for remote queries repository
|
// Create checkout directory for remote queries repository
|
||||||
fs.mkdirSync(path.join(tmpDir, "foo/bar/dev"), { recursive: true });
|
fs.mkdirSync(path.join(tempDir, "foo/bar/dev"), { recursive: true });
|
||||||
const configFile = "octo-org/codeql-config/config.yaml@main";
|
const configFile = "octo-org/codeql-config/config.yaml@main";
|
||||||
const languages = "javascript";
|
const languagesInput = "javascript";
|
||||||
await configUtils.initConfig(languages, undefined, undefined, configFile, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
|
languagesInput,
|
||||||
|
configFile,
|
||||||
|
tempDir,
|
||||||
|
codeql,
|
||||||
|
workspacePath: tempDir,
|
||||||
|
}));
|
||||||
t.assert(spyGetContents.called);
|
t.assert(spyGetContents.called);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("Remote config handles the case where a directory is provided", async (t) => {
|
(0, ava_1.default)("Remote config handles the case where a directory is provided", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
const dummyResponse = []; // directories are returned as arrays
|
const dummyResponse = []; // directories are returned as arrays
|
||||||
mockGetContents(dummyResponse);
|
mockGetContents(dummyResponse);
|
||||||
const repoReference = "octo-org/codeql-config/config.yaml@main";
|
const repoReference = "octo-org/codeql-config/config.yaml@main";
|
||||||
try {
|
try {
|
||||||
await configUtils.initConfig(undefined, undefined, undefined, repoReference, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
|
configFile: repoReference,
|
||||||
|
tempDir,
|
||||||
|
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||||
|
workspacePath: tempDir,
|
||||||
|
}));
|
||||||
throw new Error("initConfig did not throw error");
|
throw new Error("initConfig did not throw error");
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
t.deepEqual(err, new util_1.UserError(configUtils.getConfigFileDirectoryGivenMessage(repoReference)));
|
t.deepEqual(err, new util_1.ConfigurationError(configUtils.getConfigFileDirectoryGivenMessage(repoReference)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("Invalid format of remote config handled correctly", async (t) => {
|
(0, ava_1.default)("Invalid format of remote config handled correctly", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
const dummyResponse = {
|
const dummyResponse = {
|
||||||
// note no "content" property here
|
// note no "content" property here
|
||||||
};
|
};
|
||||||
mockGetContents(dummyResponse);
|
mockGetContents(dummyResponse);
|
||||||
const repoReference = "octo-org/codeql-config/config.yaml@main";
|
const repoReference = "octo-org/codeql-config/config.yaml@main";
|
||||||
try {
|
try {
|
||||||
await configUtils.initConfig(undefined, undefined, undefined, repoReference, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
|
configFile: repoReference,
|
||||||
|
tempDir,
|
||||||
|
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||||
|
workspacePath: tempDir,
|
||||||
|
}));
|
||||||
throw new Error("initConfig did not throw error");
|
throw new Error("initConfig did not throw error");
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
t.deepEqual(err, new util_1.UserError(configUtils.getConfigFileFormatInvalidMessage(repoReference)));
|
t.deepEqual(err, new util_1.ConfigurationError(configUtils.getConfigFileFormatInvalidMessage(repoReference)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("No detected languages", async (t) => {
|
(0, ava_1.default)("No detected languages", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
mockListLanguages([]);
|
mockListLanguages([]);
|
||||||
const codeQL = (0, codeql_1.setCodeQL)({
|
const codeql = (0, codeql_1.setCodeQL)({
|
||||||
async resolveLanguages() {
|
async resolveLanguages() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
@@ -375,23 +465,32 @@ function queriesToResolvedQueryForm(queries) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
await configUtils.initConfig(undefined, undefined, undefined, undefined, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
|
tempDir,
|
||||||
|
codeql,
|
||||||
|
workspacePath: tempDir,
|
||||||
|
}));
|
||||||
throw new Error("initConfig did not throw error");
|
throw new Error("initConfig did not throw error");
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
t.deepEqual(err, new util_1.UserError(configUtils.getNoLanguagesError()));
|
t.deepEqual(err, new util_1.ConfigurationError(configUtils.getNoLanguagesError()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("Unknown languages", async (t) => {
|
(0, ava_1.default)("Unknown languages", async (t) => {
|
||||||
return await (0, util_1.withTmpDir)(async (tmpDir) => {
|
return await (0, util_1.withTmpDir)(async (tempDir) => {
|
||||||
const languages = "rubbish,english";
|
const languagesInput = "rubbish,english";
|
||||||
try {
|
try {
|
||||||
await configUtils.initConfig(languages, undefined, undefined, undefined, undefined, undefined, false, false, "", "", { owner: "github", repo: "example" }, tmpDir, (0, codeql_1.getCachedCodeQL)(), tmpDir, gitHubVersion, sampleApiDetails, (0, logging_1.getRunnerLogger)(true));
|
await configUtils.initConfig(createTestInitConfigInputs({
|
||||||
|
languagesInput,
|
||||||
|
tempDir,
|
||||||
|
codeql: (0, codeql_1.getCachedCodeQL)(),
|
||||||
|
workspacePath: tempDir,
|
||||||
|
}));
|
||||||
throw new Error("initConfig did not throw error");
|
throw new Error("initConfig did not throw error");
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
t.deepEqual(err, new util_1.UserError(configUtils.getUnknownLanguagesError(["rubbish", "english"])));
|
t.deepEqual(err, new util_1.ConfigurationError(configUtils.getUnknownLanguagesError(["rubbish", "english"])));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -666,4 +765,27 @@ const mockRepositoryNwo = (0, repository_1.parseRepositoryNwo)("owner/repo");
|
|||||||
t.deepEqual(mockRequest.called, args.expectedApiCall);
|
t.deepEqual(mockRequest.called, args.expectedApiCall);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
(0, ava_1.default)("Build mode not overridden when disable Java buildless feature flag disabled", async (t) => {
|
||||||
|
const messages = [];
|
||||||
|
const buildMode = await configUtils.parseBuildModeInput("none", [languages_1.Language.java], (0, testing_utils_1.createFeatures)([]), (0, testing_utils_1.getRecordingLogger)(messages));
|
||||||
|
t.is(buildMode, config_utils_1.BuildMode.None);
|
||||||
|
t.deepEqual(messages, []);
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("Build mode not overridden for other languages", async (t) => {
|
||||||
|
const messages = [];
|
||||||
|
const buildMode = await configUtils.parseBuildModeInput("none", [languages_1.Language.python], (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.DisableJavaBuildlessEnabled]), (0, testing_utils_1.getRecordingLogger)(messages));
|
||||||
|
t.is(buildMode, config_utils_1.BuildMode.None);
|
||||||
|
t.deepEqual(messages, []);
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("Build mode overridden when analyzing Java and disable Java buildless feature flag enabled", async (t) => {
|
||||||
|
const messages = [];
|
||||||
|
const buildMode = await configUtils.parseBuildModeInput("none", [languages_1.Language.java], (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.DisableJavaBuildlessEnabled]), (0, testing_utils_1.getRecordingLogger)(messages));
|
||||||
|
t.is(buildMode, config_utils_1.BuildMode.Autobuild);
|
||||||
|
t.deepEqual(messages, [
|
||||||
|
{
|
||||||
|
message: "Scanning Java code without a build is temporarily unavailable. Falling back to 'autobuild' build mode.",
|
||||||
|
type: "warning",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
});
|
||||||
//# sourceMappingURL=config-utils.test.js.map
|
//# sourceMappingURL=config-utils.test.js.map
|
||||||
File diff suppressed because one or more lines are too long
15
lib/database-upload.test.js
generated
15
lib/database-upload.test.js
generated
@@ -33,7 +33,6 @@ const sinon = __importStar(require("sinon"));
|
|||||||
const actionsUtil = __importStar(require("./actions-util"));
|
const actionsUtil = __importStar(require("./actions-util"));
|
||||||
const apiClient = __importStar(require("./api-client"));
|
const apiClient = __importStar(require("./api-client"));
|
||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
const config_utils_1 = require("./config-utils");
|
|
||||||
const database_upload_1 = require("./database-upload");
|
const database_upload_1 = require("./database-upload");
|
||||||
const languages_1 = require("./languages");
|
const languages_1 = require("./languages");
|
||||||
const testing_utils_1 = require("./testing-utils");
|
const testing_utils_1 = require("./testing-utils");
|
||||||
@@ -49,20 +48,10 @@ const testApiDetails = {
|
|||||||
apiURL: undefined,
|
apiURL: undefined,
|
||||||
};
|
};
|
||||||
function getTestConfig(tmpDir) {
|
function getTestConfig(tmpDir) {
|
||||||
return {
|
return (0, testing_utils_1.createTestConfig)({
|
||||||
languages: [languages_1.Language.javascript],
|
languages: [languages_1.Language.javascript],
|
||||||
originalUserInput: {},
|
|
||||||
tempDir: tmpDir,
|
|
||||||
codeQLCmd: "foo",
|
|
||||||
gitHubVersion: { type: util_1.GitHubVariant.DOTCOM },
|
|
||||||
dbLocation: tmpDir,
|
dbLocation: tmpDir,
|
||||||
debugMode: false,
|
});
|
||||||
debugArtifactName: util_1.DEFAULT_DEBUG_ARTIFACT_NAME,
|
|
||||||
debugDatabaseName: util_1.DEFAULT_DEBUG_DATABASE_NAME,
|
|
||||||
augmentationProperties: config_utils_1.defaultAugmentationProperties,
|
|
||||||
trapCaches: {},
|
|
||||||
trapCacheDownloadTime: 0,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
async function mockHttpRequests(databaseUploadStatusCode) {
|
async function mockHttpRequests(databaseUploadStatusCode) {
|
||||||
// Passing an auth token is required, so we just use a dummy value
|
// Passing an auth token is required, so we just use a dummy value
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"bundleVersion": "codeql-bundle-v2.16.0",
|
"bundleVersion": "codeql-bundle-v2.16.2",
|
||||||
"cliVersion": "2.16.0",
|
"cliVersion": "2.16.2",
|
||||||
"priorBundleVersion": "codeql-bundle-v2.15.5",
|
"priorBundleVersion": "codeql-bundle-v2.16.1",
|
||||||
"priorCliVersion": "2.15.5"
|
"priorCliVersion": "2.16.1"
|
||||||
}
|
}
|
||||||
|
|||||||
10
lib/environment.js
generated
10
lib/environment.js
generated
@@ -1,10 +1,18 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.EnvVar = void 0;
|
exports.EnvVar = void 0;
|
||||||
|
/**
|
||||||
|
* Environment variables used by the CodeQL Action.
|
||||||
|
*
|
||||||
|
* We recommend prefixing environment variables with `CODEQL_ACTION_`
|
||||||
|
* to reduce the risk that they are overwritten by other steps.
|
||||||
|
*/
|
||||||
var EnvVar;
|
var EnvVar;
|
||||||
(function (EnvVar) {
|
(function (EnvVar) {
|
||||||
/** Whether the `analyze` Action completes successfully. */
|
/** Whether the `analyze` Action completes successfully. */
|
||||||
EnvVar["ANALYZE_DID_COMPLETE_SUCCESSFULLY"] = "CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY";
|
EnvVar["ANALYZE_DID_COMPLETE_SUCCESSFULLY"] = "CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY";
|
||||||
|
/** Whether the `autobuild` Action completes successfully. */
|
||||||
|
EnvVar["AUTOBUILD_DID_COMPLETE_SUCCESSFULLY"] = "CODEQL_ACTION_AUTOBUILD_DID_COMPLETE_SUCCESSFULLY";
|
||||||
/** Whether the CodeQL Action has invoked the Go autobuilder. */
|
/** Whether the CodeQL Action has invoked the Go autobuilder. */
|
||||||
EnvVar["DID_AUTOBUILD_GOLANG"] = "CODEQL_ACTION_DID_AUTOBUILD_GOLANG";
|
EnvVar["DID_AUTOBUILD_GOLANG"] = "CODEQL_ACTION_DID_AUTOBUILD_GOLANG";
|
||||||
/**
|
/**
|
||||||
@@ -30,6 +38,8 @@ var EnvVar;
|
|||||||
EnvVar["HAS_WARNED_ABOUT_DISK_SPACE"] = "CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE";
|
EnvVar["HAS_WARNED_ABOUT_DISK_SPACE"] = "CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE";
|
||||||
/** UUID representing the current job run. */
|
/** UUID representing the current job run. */
|
||||||
EnvVar["JOB_RUN_UUID"] = "JOB_RUN_UUID";
|
EnvVar["JOB_RUN_UUID"] = "JOB_RUN_UUID";
|
||||||
|
/** Status for the entire job, submitted to the status report in `init-post` */
|
||||||
|
EnvVar["JOB_STATUS"] = "CODEQL_ACTION_JOB_STATUS";
|
||||||
EnvVar["ODASA_TRACER_CONFIGURATION"] = "ODASA_TRACER_CONFIGURATION";
|
EnvVar["ODASA_TRACER_CONFIGURATION"] = "ODASA_TRACER_CONFIGURATION";
|
||||||
/**
|
/**
|
||||||
* What percentage of the total amount of RAM over 8 GB that the Action should reserve for the
|
* What percentage of the total amount of RAM over 8 GB that the Action should reserve for the
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;;AAAA,IAAY,MAsEX;AAtED,WAAY,MAAM;IAChB,2DAA2D;IAC3D,+FAAqF,CAAA;IAErF,gEAAgE;IAChE,qEAA2D,CAAA;IAE3D;;;OAGG;IACH,yFAA+E,CAAA;IAE/E;;;OAGG;IACH,yEAA+D,CAAA;IAE/D,gFAAgF;IAChF,6DAAmD,CAAA;IAEnD;;;OAGG;IACH,uEAA6D,CAAA;IAE7D,gEAAgE;IAChE,mEAAyD,CAAA;IAEzD,kFAAkF;IAClF,mFAAyE,CAAA;IAEzE,6CAA6C;IAC7C,uCAA6B,CAAA;IAE7B,mEAAyD,CAAA;IAEzD;;;OAGG;IACH,2FAAiF,CAAA;IAEjF,mFAAmF;IACnF,6FAAmF,CAAA;IAEnF,qFAAqF;IACrF,+CAAqC,CAAA;IAErC,mEAAyD,CAAA;IAEzD,kEAAkE;IAClE,2CAAiC,CAAA;IAEjC;;;;;;OAMG;IACH,4DAAkD,CAAA;IAElD;;;OAGG;IACH,wDAA8C,CAAA;AAChD,CAAC,EAtEW,MAAM,sBAAN,MAAM,QAsEjB"}
|
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,MA4EX;AA5ED,WAAY,MAAM;IAChB,2DAA2D;IAC3D,+FAAqF,CAAA;IAErF,6DAA6D;IAC7D,mGAAyF,CAAA;IAEzF,gEAAgE;IAChE,qEAA2D,CAAA;IAE3D;;;OAGG;IACH,yFAA+E,CAAA;IAE/E;;;OAGG;IACH,yEAA+D,CAAA;IAE/D,gFAAgF;IAChF,6DAAmD,CAAA;IAEnD;;;OAGG;IACH,uEAA6D,CAAA;IAE7D,gEAAgE;IAChE,mEAAyD,CAAA;IAEzD,kFAAkF;IAClF,mFAAyE,CAAA;IAEzE,6CAA6C;IAC7C,uCAA6B,CAAA;IAE7B,+EAA+E;IAC/E,iDAAuC,CAAA;IAEvC,mEAAyD,CAAA;IAEzD;;;OAGG;IACH,2FAAiF,CAAA;IAEjF,mFAAmF;IACnF,6FAAmF,CAAA;IAEnF,qFAAqF;IACrF,+CAAqC,CAAA;IAErC,mEAAyD,CAAA;IAEzD,kEAAkE;IAClE,2CAAiC,CAAA;IAEjC;;;;;;OAMG;IACH,4DAAkD,CAAA;IAElD;;;OAGG;IACH,wDAA8C,CAAA;AAChD,CAAC,EA5EW,MAAM,sBAAN,MAAM,QA4EjB"}
|
||||||
26
lib/feature-flags.js
generated
26
lib/feature-flags.js
generated
@@ -48,34 +48,34 @@ exports.CODEQL_VERSION_FINE_GRAINED_PARALLELISM = "2.15.1";
|
|||||||
*/
|
*/
|
||||||
var Feature;
|
var Feature;
|
||||||
(function (Feature) {
|
(function (Feature) {
|
||||||
Feature["CodeqlJavaLombokEnabled"] = "codeql_java_lombok_enabled";
|
|
||||||
Feature["CppDependencyInstallation"] = "cpp_dependency_installation_enabled";
|
Feature["CppDependencyInstallation"] = "cpp_dependency_installation_enabled";
|
||||||
|
Feature["CppTrapCachingEnabled"] = "cpp_trap_caching_enabled";
|
||||||
|
Feature["DisableJavaBuildlessEnabled"] = "disable_java_buildless_enabled";
|
||||||
Feature["DisableKotlinAnalysisEnabled"] = "disable_kotlin_analysis_enabled";
|
Feature["DisableKotlinAnalysisEnabled"] = "disable_kotlin_analysis_enabled";
|
||||||
Feature["DisablePythonDependencyInstallationEnabled"] = "disable_python_dependency_installation_enabled";
|
Feature["DisablePythonDependencyInstallationEnabled"] = "disable_python_dependency_installation_enabled";
|
||||||
Feature["PythonDefaultIsToSkipDependencyInstallationEnabled"] = "python_default_is_to_skip_dependency_installation_enabled";
|
Feature["PythonDefaultIsToSkipDependencyInstallationEnabled"] = "python_default_is_to_skip_dependency_installation_enabled";
|
||||||
Feature["EvaluatorFineGrainedParallelismEnabled"] = "evaluator_fine_grained_parallelism_enabled";
|
|
||||||
Feature["ExportDiagnosticsEnabled"] = "export_diagnostics_enabled";
|
Feature["ExportDiagnosticsEnabled"] = "export_diagnostics_enabled";
|
||||||
Feature["QaTelemetryEnabled"] = "qa_telemetry_enabled";
|
Feature["QaTelemetryEnabled"] = "qa_telemetry_enabled";
|
||||||
})(Feature || (exports.Feature = Feature = {}));
|
})(Feature || (exports.Feature = Feature = {}));
|
||||||
exports.featureConfig = {
|
exports.featureConfig = {
|
||||||
[Feature.CodeqlJavaLombokEnabled]: {
|
|
||||||
envVar: "CODEQL_JAVA_LOMBOK",
|
|
||||||
minimumVersion: "2.14.0",
|
|
||||||
defaultValue: false,
|
|
||||||
},
|
|
||||||
[Feature.CppDependencyInstallation]: {
|
[Feature.CppDependencyInstallation]: {
|
||||||
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
|
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
|
||||||
minimumVersion: "2.15.0",
|
minimumVersion: "2.15.0",
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
},
|
},
|
||||||
[Feature.DisableKotlinAnalysisEnabled]: {
|
[Feature.CppTrapCachingEnabled]: {
|
||||||
envVar: "CODEQL_DISABLE_KOTLIN_ANALYSIS",
|
envVar: "CODEQL_CPP_TRAP_CACHING",
|
||||||
|
minimumVersion: "2.16.1",
|
||||||
|
defaultValue: false,
|
||||||
|
},
|
||||||
|
[Feature.DisableJavaBuildlessEnabled]: {
|
||||||
|
envVar: "CODEQL_ACTION_DISABLE_JAVA_BUILDLESS",
|
||||||
minimumVersion: undefined,
|
minimumVersion: undefined,
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
},
|
},
|
||||||
[Feature.EvaluatorFineGrainedParallelismEnabled]: {
|
[Feature.DisableKotlinAnalysisEnabled]: {
|
||||||
envVar: "CODEQL_EVALUATOR_FINE_GRAINED_PARALLELISM",
|
envVar: "CODEQL_DISABLE_KOTLIN_ANALYSIS",
|
||||||
minimumVersion: exports.CODEQL_VERSION_FINE_GRAINED_PARALLELISM,
|
minimumVersion: undefined,
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
},
|
},
|
||||||
[Feature.ExportDiagnosticsEnabled]: {
|
[Feature.ExportDiagnosticsEnabled]: {
|
||||||
@@ -105,7 +105,7 @@ exports.featureConfig = {
|
|||||||
// here!
|
// here!
|
||||||
envVar: "CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION",
|
envVar: "CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION",
|
||||||
minimumVersion: "2.16.0",
|
minimumVersion: "2.16.0",
|
||||||
defaultValue: false,
|
defaultValue: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
exports.FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json";
|
exports.FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json";
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
28
lib/init-action-post-helper.js
generated
28
lib/init-action-post-helper.js
generated
@@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.run = exports.tryUploadSarifIfRunFailed = void 0;
|
exports.getFinalJobStatus = exports.run = exports.tryUploadSarifIfRunFailed = void 0;
|
||||||
|
const core = __importStar(require("@actions/core"));
|
||||||
const github = __importStar(require("@actions/github"));
|
const github = __importStar(require("@actions/github"));
|
||||||
const actionsUtil = __importStar(require("./actions-util"));
|
const actionsUtil = __importStar(require("./actions-util"));
|
||||||
const api_client_1 = require("./api-client");
|
const api_client_1 = require("./api-client");
|
||||||
@@ -32,6 +33,7 @@ const config_utils_1 = require("./config-utils");
|
|||||||
const environment_1 = require("./environment");
|
const environment_1 = require("./environment");
|
||||||
const feature_flags_1 = require("./feature-flags");
|
const feature_flags_1 = require("./feature-flags");
|
||||||
const repository_1 = require("./repository");
|
const repository_1 = require("./repository");
|
||||||
|
const status_report_1 = require("./status-report");
|
||||||
const uploadLib = __importStar(require("./upload-lib"));
|
const uploadLib = __importStar(require("./upload-lib"));
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
const workflow_1 = require("./workflow");
|
const workflow_1 = require("./workflow");
|
||||||
@@ -73,7 +75,7 @@ async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) {
|
|||||||
await codeql.databaseExportDiagnostics(databasePath, sarifFile, category, config.tempDir, logger);
|
await codeql.databaseExportDiagnostics(databasePath, sarifFile, category, config.tempDir, logger);
|
||||||
}
|
}
|
||||||
logger.info(`Uploading failed SARIF file ${sarifFile}`);
|
logger.info(`Uploading failed SARIF file ${sarifFile}`);
|
||||||
const uploadResult = await uploadLib.uploadFromActions(sarifFile, checkoutPath, category, logger, { considerInvalidRequestUserError: false });
|
const uploadResult = await uploadLib.uploadFromActions(sarifFile, checkoutPath, category, logger, { considerInvalidRequestConfigError: false });
|
||||||
await uploadLib.waitForProcessing(repositoryNwo, uploadResult.sarifID, logger, { isUnsuccessfulExecution: true });
|
await uploadLib.waitForProcessing(repositoryNwo, uploadResult.sarifID, logger, { isUnsuccessfulExecution: true });
|
||||||
return uploadResult
|
return uploadResult
|
||||||
? { ...uploadResult.statusReport, sarifID: uploadResult.sarifID }
|
? { ...uploadResult.statusReport, sarifID: uploadResult.sarifID }
|
||||||
@@ -81,6 +83,12 @@ async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) {
|
|||||||
}
|
}
|
||||||
async function tryUploadSarifIfRunFailed(config, repositoryNwo, features, logger) {
|
async function tryUploadSarifIfRunFailed(config, repositoryNwo, features, logger) {
|
||||||
if (process.env[environment_1.EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] !== "true") {
|
if (process.env[environment_1.EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] !== "true") {
|
||||||
|
// If analyze didn't complete successfully and the job status hasn't
|
||||||
|
// already been set to Failure/ConfigurationError previously, this
|
||||||
|
// means that something along the way failed in a step that is not
|
||||||
|
// owned by the Action, for example a manual build step. We
|
||||||
|
// consider this a configuration error.
|
||||||
|
core.exportVariable(environment_1.EnvVar.JOB_STATUS, process.env[environment_1.EnvVar.JOB_STATUS] ?? status_report_1.JobStatus.ConfigErrorStatus);
|
||||||
try {
|
try {
|
||||||
return await maybeUploadFailedSarif(config, repositoryNwo, features, logger);
|
return await maybeUploadFailedSarif(config, repositoryNwo, features, logger);
|
||||||
}
|
}
|
||||||
@@ -90,6 +98,7 @@ async function tryUploadSarifIfRunFailed(config, repositoryNwo, features, logger
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
core.exportVariable(environment_1.EnvVar.JOB_STATUS, process.env[environment_1.EnvVar.JOB_STATUS] ?? status_report_1.JobStatus.SuccessStatus);
|
||||||
return {
|
return {
|
||||||
upload_failed_run_skipped_because: "Analyze Action completed successfully",
|
upload_failed_run_skipped_because: "Analyze Action completed successfully",
|
||||||
};
|
};
|
||||||
@@ -185,4 +194,19 @@ async function removeUploadedSarif(uploadFailedSarifResult, logger) {
|
|||||||
logger.warning("Could not delete the uploaded SARIF analysis because a SARIF ID wasn't provided by the API when uploading the SARIF file.");
|
logger.warning("Could not delete the uploaded SARIF analysis because a SARIF ID wasn't provided by the API when uploading the SARIF file.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Returns the final job status sent in the `init-post` Action, based on the
|
||||||
|
* current value of the JOB_STATUS environment variable. If the variable is
|
||||||
|
* unset, or if its value is not one of the JobStatus enum values, returns
|
||||||
|
* Unknown. Otherwise it returns the status set in the environment variable.
|
||||||
|
*/
|
||||||
|
function getFinalJobStatus() {
|
||||||
|
const jobStatusFromEnvironment = process.env[environment_1.EnvVar.JOB_STATUS];
|
||||||
|
if (!jobStatusFromEnvironment ||
|
||||||
|
!Object.values(status_report_1.JobStatus).includes(jobStatusFromEnvironment)) {
|
||||||
|
return status_report_1.JobStatus.UnknownStatus;
|
||||||
|
}
|
||||||
|
return jobStatusFromEnvironment;
|
||||||
|
}
|
||||||
|
exports.getFinalJobStatus = getFinalJobStatus;
|
||||||
//# sourceMappingURL=init-action-post-helper.js.map
|
//# sourceMappingURL=init-action-post-helper.js.map
|
||||||
File diff suppressed because one or more lines are too long
1
lib/init-action-post.js
generated
1
lib/init-action-post.js
generated
@@ -59,6 +59,7 @@ async function runWrapper() {
|
|||||||
const statusReport = {
|
const statusReport = {
|
||||||
...statusReportBase,
|
...statusReportBase,
|
||||||
...uploadFailedSarifResult,
|
...uploadFailedSarifResult,
|
||||||
|
job_status: initActionPostHelper.getFinalJobStatus(),
|
||||||
};
|
};
|
||||||
await (0, status_report_1.sendStatusReport)(statusReport);
|
await (0, status_report_1.sendStatusReport)(statusReport);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"init-action-post.js","sourceRoot":"","sources":["../src/init-action-post.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oDAAsC;AAEtC,iDAAuE;AACvE,6CAAgD;AAChD,kEAAoD;AACpD,mDAA2C;AAC3C,gFAAkE;AAClE,uCAA6C;AAC7C,6CAAkD;AAClD,mDAKyB;AACzB,iCAKgB;AAMhB,KAAK,UAAU,UAAU;IACvB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,IAAI,uBAES,CAAC;IACd,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;QAClC,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAgB,GAAE,CAAC;QAC/C,IAAA,gCAAyB,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAEjD,MAAM,aAAa,GAAG,IAAA,+BAAkB,EACtC,IAAA,0BAAmB,EAAC,mBAAmB,CAAC,CACzC,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,wBAAQ,CAC3B,aAAa,EACb,aAAa,EACb,IAAA,oCAAqB,GAAE,EACvB,MAAM,CACP,CAAC;QAEF,uBAAuB,GAAG,MAAM,oBAAoB,CAAC,GAAG,CACtD,cAAc,CAAC,iCAAiC,EAChD,cAAc,CAAC,uBAAuB,EACtC,6BAAc,EACd,aAAa,EACb,QAAQ,EACR,MAAM,CACP,CAAC;IACJ,CAAC;IAAC,OAAO,cAAc,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE9B,MAAM,IAAA,gCAAgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,WAAW,EACX,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;QACF,OAAO;IACT,CAAC;IACD,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,WAAW,EACX,SAAS,EACT,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,CACvB,CAAC;IACF,MAAM,YAAY,GAAyB;QACzC,GAAG,gBAAgB;QACnB,GAAG,uBAAuB;KAC3B,CAAC;IACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
{"version":3,"file":"init-action-post.js","sourceRoot":"","sources":["../src/init-action-post.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oDAAsC;AAEtC,iDAAuE;AACvE,6CAAgD;AAChD,kEAAoD;AACpD,mDAA2C;AAC3C,gFAAkE;AAClE,uCAA6C;AAC7C,6CAAkD;AAClD,mDAKyB;AACzB,iCAKgB;AAOhB,KAAK,UAAU,UAAU;IACvB,MAAM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E;KACrD,CAAC;IACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||||
61
lib/init-action.js
generated
61
lib/init-action.js
generated
@@ -122,9 +122,7 @@ async function run() {
|
|||||||
const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, (0, actions_util_1.getTemporaryDirectory)(), logger);
|
const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, (0, actions_util_1.getTemporaryDirectory)(), logger);
|
||||||
core.exportVariable(environment_1.EnvVar.JOB_RUN_UUID, (0, uuid_1.v4)());
|
core.exportVariable(environment_1.EnvVar.JOB_RUN_UUID, (0, uuid_1.v4)());
|
||||||
try {
|
try {
|
||||||
if (!(await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)("init", "starting", startedAt, await (0, util_1.checkDiskUsage)(logger))))) {
|
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)("init", "starting", startedAt, await (0, util_1.checkDiskUsage)(logger)));
|
||||||
return;
|
|
||||||
}
|
|
||||||
const codeQLDefaultVersionInfo = await features.getDefaultCliVersion(gitHubVersion.type);
|
const codeQLDefaultVersionInfo = await features.getDefaultCliVersion(gitHubVersion.type);
|
||||||
toolsFeatureFlagsValid = codeQLDefaultVersionInfo.toolsFeatureFlagsValid;
|
toolsFeatureFlagsValid = codeQLDefaultVersionInfo.toolsFeatureFlagsValid;
|
||||||
const initCodeQLResult = await (0, init_1.initCodeQL)((0, actions_util_1.getOptionalInput)("tools"), apiDetails, (0, actions_util_1.getTemporaryDirectory)(), gitHubVersion.type, codeQLDefaultVersionInfo, logger);
|
const initCodeQLResult = await (0, init_1.initCodeQL)((0, actions_util_1.getOptionalInput)("tools"), apiDetails, (0, actions_util_1.getTemporaryDirectory)(), gitHubVersion.type, codeQLDefaultVersionInfo, logger);
|
||||||
@@ -137,12 +135,31 @@ async function run() {
|
|||||||
logger.info("Detected no issues with the code scanning workflow.");
|
logger.info("Detected no issues with the code scanning workflow.");
|
||||||
}
|
}
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
config = await (0, init_1.initConfig)((0, actions_util_1.getOptionalInput)("languages"), (0, actions_util_1.getOptionalInput)("queries"), (0, actions_util_1.getOptionalInput)("packs"), (0, actions_util_1.getOptionalInput)("config-file"), (0, actions_util_1.getOptionalInput)("db-location"), (0, actions_util_1.getOptionalInput)("config"), getTrapCachingEnabled(),
|
config = await (0, init_1.initConfig)({
|
||||||
// Debug mode is enabled if:
|
languagesInput: (0, actions_util_1.getOptionalInput)("languages"),
|
||||||
// - The `init` Action is passed `debug: true`.
|
queriesInput: (0, actions_util_1.getOptionalInput)("queries"),
|
||||||
// - Actions step debugging is enabled (e.g. by [enabling debug logging for a rerun](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs#re-running-all-the-jobs-in-a-workflow),
|
packsInput: (0, actions_util_1.getOptionalInput)("packs"),
|
||||||
// or by setting the `ACTIONS_STEP_DEBUG` secret to `true`).
|
buildModeInput: (0, actions_util_1.getOptionalInput)("build-mode"),
|
||||||
(0, actions_util_1.getOptionalInput)("debug") === "true" || core.isDebug(), (0, actions_util_1.getOptionalInput)("debug-artifact-name") || util_1.DEFAULT_DEBUG_ARTIFACT_NAME, (0, actions_util_1.getOptionalInput)("debug-database-name") || util_1.DEFAULT_DEBUG_DATABASE_NAME, repositoryNwo, (0, actions_util_1.getTemporaryDirectory)(), codeql, (0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE"), gitHubVersion, apiDetails, logger);
|
configFile: (0, actions_util_1.getOptionalInput)("config-file"),
|
||||||
|
dbLocation: (0, actions_util_1.getOptionalInput)("db-location"),
|
||||||
|
configInput: (0, actions_util_1.getOptionalInput)("config"),
|
||||||
|
trapCachingEnabled: getTrapCachingEnabled(),
|
||||||
|
// Debug mode is enabled if:
|
||||||
|
// - The `init` Action is passed `debug: true`.
|
||||||
|
// - Actions step debugging is enabled (e.g. by [enabling debug logging for a rerun](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs#re-running-all-the-jobs-in-a-workflow),
|
||||||
|
// or by setting the `ACTIONS_STEP_DEBUG` secret to `true`).
|
||||||
|
debugMode: (0, actions_util_1.getOptionalInput)("debug") === "true" || core.isDebug(),
|
||||||
|
debugArtifactName: (0, actions_util_1.getOptionalInput)("debug-artifact-name") || util_1.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||||
|
debugDatabaseName: (0, actions_util_1.getOptionalInput)("debug-database-name") || util_1.DEFAULT_DEBUG_DATABASE_NAME,
|
||||||
|
repository: repositoryNwo,
|
||||||
|
tempDir: (0, actions_util_1.getTemporaryDirectory)(),
|
||||||
|
codeql,
|
||||||
|
workspacePath: (0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE"),
|
||||||
|
githubVersion: gitHubVersion,
|
||||||
|
apiDetails,
|
||||||
|
features,
|
||||||
|
logger,
|
||||||
|
});
|
||||||
await (0, init_1.checkInstallPython311)(config.languages, codeql);
|
await (0, init_1.checkInstallPython311)(config.languages, codeql);
|
||||||
if (config.languages.includes(languages_1.Language.python) &&
|
if (config.languages.includes(languages_1.Language.python) &&
|
||||||
(0, actions_util_1.getRequiredInput)("setup-python-dependencies") === "true") {
|
(0, actions_util_1.getRequiredInput)("setup-python-dependencies") === "true") {
|
||||||
@@ -163,12 +180,10 @@ async function run() {
|
|||||||
catch (unwrappedError) {
|
catch (unwrappedError) {
|
||||||
const error = (0, util_1.wrapError)(unwrappedError);
|
const error = (0, util_1.wrapError)(unwrappedError);
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)("init", error instanceof util_1.UserError ? "user-error" : "aborted", startedAt, await (0, util_1.checkDiskUsage)(), error.message, error.stack));
|
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)("init", error instanceof util_1.ConfigurationError ? "user-error" : "aborted", startedAt, await (0, util_1.checkDiskUsage)(), error.message, error.stack));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// Query CLI for supported features
|
|
||||||
const versionInfo = await codeql.getVersion();
|
|
||||||
// Forward Go flags
|
// Forward Go flags
|
||||||
const goFlags = process.env["GOFLAGS"];
|
const goFlags = process.env["GOFLAGS"];
|
||||||
if (goFlags) {
|
if (goFlags) {
|
||||||
@@ -185,7 +200,7 @@ async function run() {
|
|||||||
// replacing the `go` binary with a shell script that invokes the actual `go` binary. Since the shell is
|
// replacing the `go` binary with a shell script that invokes the actual `go` binary. Since the shell is
|
||||||
// typically dynamically linked, this provides a suitable entry point for the CodeQL tracer.
|
// typically dynamically linked, this provides a suitable entry point for the CodeQL tracer.
|
||||||
if (fileOutput.includes("statically linked") &&
|
if (fileOutput.includes("statically linked") &&
|
||||||
!(0, tools_features_1.isSupportedToolsFeature)(versionInfo, tools_features_1.ToolsFeature.IndirectTracingSupportsStaticBinaries)) {
|
!(await codeql.supportsFeature(tools_features_1.ToolsFeature.IndirectTracingSupportsStaticBinaries))) {
|
||||||
try {
|
try {
|
||||||
logger.debug(`Applying static binary workaround for Go`);
|
logger.debug(`Applying static binary workaround for Go`);
|
||||||
// Create a directory that we can add to the system PATH.
|
// Create a directory that we can add to the system PATH.
|
||||||
@@ -231,17 +246,31 @@ async function run() {
|
|||||||
!(await (0, util_1.codeQlVersionAbove)(codeql, "2.14.4"))) {
|
!(await (0, util_1.codeQlVersionAbove)(codeql, "2.14.4"))) {
|
||||||
core.exportVariable(kotlinLimitVar, "1.9.20");
|
core.exportVariable(kotlinLimitVar, "1.9.20");
|
||||||
}
|
}
|
||||||
if (config.languages.includes(languages_1.Language.java)) {
|
if (config.languages.includes(languages_1.Language.java) &&
|
||||||
|
// Java Lombok support is enabled by default for >= 2.14.4
|
||||||
|
(await (0, util_1.codeQlVersionAbove)(codeql, "2.14.0")) &&
|
||||||
|
!(await (0, util_1.codeQlVersionAbove)(codeql, "2.14.4"))) {
|
||||||
const envVar = "CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS";
|
const envVar = "CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS";
|
||||||
if (process.env[envVar]) {
|
if (process.env[envVar]) {
|
||||||
logger.info(`Environment variable ${envVar} already set. Not en/disabling CodeQL Java Lombok support`);
|
logger.info(`Environment variable ${envVar} already set. Not en/disabling CodeQL Java Lombok support`);
|
||||||
}
|
}
|
||||||
else if (await features.getValue(feature_flags_1.Feature.CodeqlJavaLombokEnabled, codeql)) {
|
else {
|
||||||
logger.info("Enabling CodeQL Java Lombok support");
|
logger.info("Enabling CodeQL Java Lombok support");
|
||||||
core.exportVariable(envVar, "true");
|
core.exportVariable(envVar, "true");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (config.languages.includes(languages_1.Language.cpp)) {
|
||||||
|
const envVar = "CODEQL_EXTRACTOR_CPP_TRAP_CACHING";
|
||||||
|
if (process.env[envVar]) {
|
||||||
|
logger.info(`Environment variable ${envVar} already set. Not en/disabling CodeQL C++ TRAP caching support`);
|
||||||
|
}
|
||||||
|
else if (getTrapCachingEnabled() &&
|
||||||
|
(await features.getValue(feature_flags_1.Feature.CppTrapCachingEnabled, codeql))) {
|
||||||
|
logger.info("Enabling CodeQL C++ TRAP caching support");
|
||||||
|
core.exportVariable(envVar, "true");
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
logger.info("Disabling CodeQL Java Lombok support");
|
logger.info("Disabling CodeQL C++ TRAP caching support");
|
||||||
core.exportVariable(envVar, "false");
|
core.exportVariable(envVar, "false");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
55
lib/init.js
generated
55
lib/init.js
generated
@@ -32,7 +32,6 @@ const codeql_1 = require("./codeql");
|
|||||||
const configUtils = __importStar(require("./config-utils"));
|
const configUtils = __importStar(require("./config-utils"));
|
||||||
const languages_1 = require("./languages");
|
const languages_1 = require("./languages");
|
||||||
const tracer_config_1 = require("./tracer-config");
|
const tracer_config_1 = require("./tracer-config");
|
||||||
const util = __importStar(require("./util"));
|
|
||||||
async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger) {
|
async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger) {
|
||||||
logger.startGroup("Setup CodeQL tools");
|
logger.startGroup("Setup CodeQL tools");
|
||||||
const { codeql, toolsDownloadDurationMs, toolsSource, toolsVersion } = await (0, codeql_1.setupCodeQL)(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger, true);
|
const { codeql, toolsDownloadDurationMs, toolsSource, toolsVersion } = await (0, codeql_1.setupCodeQL)(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger, true);
|
||||||
@@ -41,9 +40,10 @@ async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVe
|
|||||||
return { codeql, toolsDownloadDurationMs, toolsSource, toolsVersion };
|
return { codeql, toolsDownloadDurationMs, toolsSource, toolsVersion };
|
||||||
}
|
}
|
||||||
exports.initCodeQL = initCodeQL;
|
exports.initCodeQL = initCodeQL;
|
||||||
async function initConfig(languagesInput, queriesInput, packsInput, configFile, dbLocation, configInput, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, logger) {
|
async function initConfig(inputs) {
|
||||||
|
const logger = inputs.logger;
|
||||||
logger.startGroup("Load language configuration");
|
logger.startGroup("Load language configuration");
|
||||||
const config = await configUtils.initConfig(languagesInput, queriesInput, packsInput, configFile, dbLocation, configInput, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, logger);
|
const config = await configUtils.initConfig(inputs);
|
||||||
printPathFiltersWarning(config, logger);
|
printPathFiltersWarning(config, logger);
|
||||||
logger.endGroup();
|
logger.endGroup();
|
||||||
return config;
|
return config;
|
||||||
@@ -51,19 +51,14 @@ async function initConfig(languagesInput, queriesInput, packsInput, configFile,
|
|||||||
exports.initConfig = initConfig;
|
exports.initConfig = initConfig;
|
||||||
async function runInit(codeql, config, sourceRoot, processName, registriesInput, apiDetails, logger) {
|
async function runInit(codeql, config, sourceRoot, processName, registriesInput, apiDetails, logger) {
|
||||||
fs.mkdirSync(config.dbLocation, { recursive: true });
|
fs.mkdirSync(config.dbLocation, { recursive: true });
|
||||||
try {
|
const { registriesAuthTokens, qlconfigFile } = await configUtils.generateRegistries(registriesInput, config.tempDir, logger);
|
||||||
const { registriesAuthTokens, qlconfigFile } = await configUtils.generateRegistries(registriesInput, config.tempDir, logger);
|
await configUtils.wrapEnvironment({
|
||||||
await configUtils.wrapEnvironment({
|
GITHUB_TOKEN: apiDetails.auth,
|
||||||
GITHUB_TOKEN: apiDetails.auth,
|
CODEQL_REGISTRIES_AUTH: registriesAuthTokens,
|
||||||
CODEQL_REGISTRIES_AUTH: registriesAuthTokens,
|
},
|
||||||
},
|
// Init a database cluster
|
||||||
// Init a database cluster
|
async () => await codeql.databaseInitCluster(config, sourceRoot, processName, qlconfigFile, logger));
|
||||||
async () => await codeql.databaseInitCluster(config, sourceRoot, processName, qlconfigFile, logger));
|
return await (0, tracer_config_1.getCombinedTracerConfig)(codeql, config);
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
throw processError(e);
|
|
||||||
}
|
|
||||||
return await (0, tracer_config_1.getCombinedTracerConfig)(await codeql.getVersion(), config);
|
|
||||||
}
|
}
|
||||||
exports.runInit = runInit;
|
exports.runInit = runInit;
|
||||||
function printPathFiltersWarning(config, logger) {
|
function printPathFiltersWarning(config, logger) {
|
||||||
@@ -76,34 +71,6 @@ function printPathFiltersWarning(config, logger) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.printPathFiltersWarning = printPathFiltersWarning;
|
exports.printPathFiltersWarning = printPathFiltersWarning;
|
||||||
/**
|
|
||||||
* Possibly convert this error into a UserError in order to avoid
|
|
||||||
* counting this error towards our internal error budget.
|
|
||||||
*
|
|
||||||
* @param e The error to possibly convert to a UserError.
|
|
||||||
*
|
|
||||||
* @returns A UserError if the error is a known error that can be
|
|
||||||
* attributed to the user, otherwise the original error.
|
|
||||||
*/
|
|
||||||
function processError(e) {
|
|
||||||
if (!(e instanceof Error)) {
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
// Init action called twice
|
|
||||||
e.message?.includes("Refusing to create databases") &&
|
|
||||||
e.message?.includes("exists and is not an empty directory.")) {
|
|
||||||
return new util.UserError(`Is the "init" action called twice in the same job? ${e.message}`);
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
// Version of CodeQL CLI is incompatible with this version of the CodeQL Action
|
|
||||||
e.message?.includes("is not compatible with this CodeQL CLI") ||
|
|
||||||
// Expected source location for database creation does not exist
|
|
||||||
e.message?.includes("Invalid source root")) {
|
|
||||||
return new util.UserError(e.message);
|
|
||||||
}
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* If we are running python 3.12+ on windows, we need to switch to python 3.11.
|
* If we are running python 3.12+ on windows, we need to switch to python 3.11.
|
||||||
* This check happens in a powershell script.
|
* This check happens in a powershell script.
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,yEAA2D;AAC3D,kEAAoD;AAGpD,qCAA+C;AAC/C,4DAA8C;AAE9C,2CAA0D;AAI1D,mDAAwE;AACxE,6CAA+B;AAExB,KAAK,UAAU,UAAU,CAC9B,UAA8B,EAC9B,UAA4B,EAC5B,OAAe,EACf,OAA2B,EAC3B,iBAA2C,EAC3C,MAAc;IAOd,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAE,YAAY,EAAE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AAS,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE;gBACpE,IAAI;gBACJ,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;gBAChC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;aAC/B,CAAC,CAAC,IAAI,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClB,MAAM,CAAC,OAAO,CACZ,gFAAgF,CAAC,IAAI;YACnF,qGAAqG;YACrG,oGAAoG;YACpG,iDAAiD,CACpD,CAAC;QACF,OAAO;IACT,CAAC;IACD,MAAM,CAAC,QAAQ,EAAE,CAAC;AACpB,CAAC;AAzCD,8CAyCC"}
|
||||||
2
lib/repository.js
generated
2
lib/repository.js
generated
@@ -5,7 +5,7 @@ const util_1 = require("./util");
|
|||||||
function parseRepositoryNwo(input) {
|
function parseRepositoryNwo(input) {
|
||||||
const parts = input.split("/");
|
const parts = input.split("/");
|
||||||
if (parts.length !== 2) {
|
if (parts.length !== 2) {
|
||||||
throw new util_1.UserError(`"${input}" is not a valid repository name`);
|
throw new util_1.ConfigurationError(`"${input}" is not a valid repository name`);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
owner: parts[0],
|
owner: parts[0],
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"repository.js","sourceRoot":"","sources":["../src/repository.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AAQnC,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,gBAAS,CAAC,IAAI,KAAK,kCAAkC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACf,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;KACf,CAAC;AACJ,CAAC;AATD,gDASC"}
|
{"version":3,"file":"repository.js","sourceRoot":"","sources":["../src/repository.ts"],"names":[],"mappings":";;;AAAA,iCAA4C;AAQ5C,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,yBAAkB,CAAC,IAAI,KAAK,kCAAkC,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACf,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;KACf,CAAC;AACJ,CAAC;AATD,gDASC"}
|
||||||
8
lib/resolve-environment-action.js
generated
8
lib/resolve-environment-action.js
generated
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
const core = __importStar(require("@actions/core"));
|
const core = __importStar(require("@actions/core"));
|
||||||
const actions_util_1 = require("./actions-util");
|
const actions_util_1 = require("./actions-util");
|
||||||
const api_client_1 = require("./api-client");
|
const api_client_1 = require("./api-client");
|
||||||
const codeql_1 = require("./codeql");
|
const cli_errors_1 = require("./cli-errors");
|
||||||
const configUtils = __importStar(require("./config-utils"));
|
const configUtils = __importStar(require("./config-utils"));
|
||||||
const logging_1 = require("./logging");
|
const logging_1 = require("./logging");
|
||||||
const resolve_environment_1 = require("./resolve-environment");
|
const resolve_environment_1 = require("./resolve-environment");
|
||||||
@@ -38,9 +38,7 @@ async function run() {
|
|||||||
const startedAt = new Date();
|
const startedAt = new Date();
|
||||||
const logger = (0, logging_1.getActionsLogger)();
|
const logger = (0, logging_1.getActionsLogger)();
|
||||||
try {
|
try {
|
||||||
if (!(await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(ACTION_NAME, "starting", startedAt, await (0, util_1.checkDiskUsage)(logger))))) {
|
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(ACTION_NAME, "starting", startedAt, await (0, util_1.checkDiskUsage)(logger)));
|
||||||
return;
|
|
||||||
}
|
|
||||||
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
||||||
(0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger);
|
(0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger);
|
||||||
(0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion);
|
(0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion);
|
||||||
@@ -54,7 +52,7 @@ async function run() {
|
|||||||
}
|
}
|
||||||
catch (unwrappedError) {
|
catch (unwrappedError) {
|
||||||
const error = (0, util_1.wrapError)(unwrappedError);
|
const error = (0, util_1.wrapError)(unwrappedError);
|
||||||
if (error instanceof codeql_1.CommandInvocationError) {
|
if (error instanceof cli_errors_1.CommandInvocationError) {
|
||||||
// If the CLI failed to run successfully for whatever reason,
|
// If the CLI failed to run successfully for whatever reason,
|
||||||
// we just return an empty JSON object and proceed with the workflow.
|
// we just return an empty JSON object and proceed with the workflow.
|
||||||
core.setOutput(ENVIRONMENT_OUTPUT_NAME, {});
|
core.setOutput(ENVIRONMENT_OUTPUT_NAME, {});
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"resolve-environment-action.js","sourceRoot":"","sources":["../src/resolve-environment-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAKwB;AACxB,6CAAgD;AAChD,qCAAkD;AAClD,4DAA8C;AAC9C,uCAA6C;AAC7C,+DAAmE;AACnE,mDAIyB;AACzB,iCAMgB;AAEhB,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAC1C,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAE9C,KAAK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C;YAC5C,MAAM,CAAC,OAAO,CACZ,wFAAwF,KAAK,CAAC,OAAO,EAAE,CACxG,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,kFAAkF;YAClF,IAAI,CAAC,SAAS,CACZ,wFAAwF,KAAK,CAAC,OAAO,EAAE,CACxG,CAAC;YAEF,MAAM,IAAA,gCAAgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,WAAW,EACX,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;QACJ,CAAC;QAED,OAAO;IACT,CAAC;IAED,MAAM,IAAA,gCAAgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,WAAW,EACX,SAAS,EACT,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,CACvB,CACF,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CAAC,GAAG,WAAW,mBAAmB,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
{"version":3,"file":"resolve-environment-action.js","sourceRoot":"","sources":["../src/resolve-environment-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAKwB;AACxB,6CAAgD;AAChD,6CAAsD;AACtD,4DAA8C;AAC9C,uCAA6C;AAC7C,+DAAmE;AACnE,mDAIyB;AACzB,iCAMgB;AAEhB,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAC1C,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAE9C,KAAK,UAAU,G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AO,EAAE,CACxG,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,kFAAkF;YAClF,IAAI,CAAC,SAAS,CACZ,wFAAwF,KAAK,CAAC,OAAO,EAAE,CACxG,CAAC;YAEF,MAAM,IAAA,gCAAgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,WAAW,EACX,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;QACJ,CAAC;QAED,OAAO;IACT,CAAC;IAED,MAAM,IAAA,gCAAgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,WAAW,EACX,SAAS,EACT,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,CACvB,CACF,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CAAC,GAAG,WAAW,mBAAmB,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||||
2
lib/resolve-environment.js
generated
2
lib/resolve-environment.js
generated
@@ -36,7 +36,7 @@ async function runResolveBuildEnvironment(cmd, logger, workingDir, languageInput
|
|||||||
if (!(await util.codeQlVersionAbove(codeql, codeql_1.CODEQL_VERSION_LANGUAGE_ALIASING))) {
|
if (!(await util.codeQlVersionAbove(codeql, codeql_1.CODEQL_VERSION_LANGUAGE_ALIASING))) {
|
||||||
const parsedLanguage = (0, languages_1.parseLanguage)(languageInput)?.toString();
|
const parsedLanguage = (0, languages_1.parseLanguage)(languageInput)?.toString();
|
||||||
if (parsedLanguage === undefined) {
|
if (parsedLanguage === undefined) {
|
||||||
throw new util.UserError(`Did not recognize the language '${languageInput}'.`);
|
throw new util.ConfigurationError(`Did not recognize the language '${languageInput}'.`);
|
||||||
}
|
}
|
||||||
language = parsedLanguage;
|
language = parsedLanguage;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"resolve-environment.js","sourceRoot":"","sources":["../src/resolve-environment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAIkB;AAClB,2CAA4C;AAE5C,6CAA+B;AAExB,KAAK,UAAU,0BAA0B,CAC9C,GAAW,EACX,MAAc,EACd,UAA8B,EAC9B,aAAqB;IAErB,MAAM,CAAC,UAAU,CACf,+CAA+C,aAAa,EAAE,CAC/D,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC;IAEpC,IAAI,QAAQ,GAAG,aAAa,CAAC;IAC7B,6FAA6F;IAC7F,mFAAmF;IACnF,IACE,CAAC,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,yCAAgC,CAAC,CAAC,EAC1E,CAAC;QACD,MAAM,cAAc,GAAG,IAAA,yBAAa,EAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC;QAChE,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,IAAI,CAAC,SAAS,CACtB,mCAAmC,aAAa,IAAI,CACrD,CAAC;QACJ,CAAC;QACD,QAAQ,GAAG,cAAc,CAAC;IAC5B,CAAC;IAED,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,gFAAgF;IAChF,yEAAyE;IACzE,IACE,CAAC,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,2CAAkC,CAAC,CAAC,EAC5E,CAAC;QACD,MAAM,CAAC,OAAO,CACZ,0EAA0E;YACxE,mCAAmC,CACtC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,IAAI,UAA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ACD,MAAM,CAAC,OAAO,CACZ,0EAA0E;YACxE,mCAAmC,CACtC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,SAAS,UAAU,4BAA4B,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC;AAChB,CAAC;AAhDD,gEAgDC"}
|
||||||
2
lib/setup-codeql.js
generated
2
lib/setup-codeql.js
generated
@@ -441,7 +441,7 @@ exports.downloadCodeQL = downloadCodeQL;
|
|||||||
function getCodeQLURLVersion(url) {
|
function getCodeQLURLVersion(url) {
|
||||||
const match = url.match(/\/codeql-bundle-(.*)\//);
|
const match = url.match(/\/codeql-bundle-(.*)\//);
|
||||||
if (match === null || match.length < 2) {
|
if (match === null || match.length < 2) {
|
||||||
throw new util.UserError(`Malformed tools url: ${url}. Version could not be inferred`);
|
throw new util.ConfigurationError(`Malformed tools url: ${url}. Version could not be inferred`);
|
||||||
}
|
}
|
||||||
return match[1];
|
return match[1];
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
57
lib/status-report.js
generated
57
lib/status-report.js
generated
@@ -23,22 +23,43 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.sendStatusReport = exports.createStatusReportBase = exports.getActionsStatus = void 0;
|
exports.sendStatusReport = exports.createStatusReportBase = exports.getActionsStatus = exports.JobStatus = void 0;
|
||||||
const os = __importStar(require("os"));
|
const os = __importStar(require("os"));
|
||||||
const core = __importStar(require("@actions/core"));
|
const core = __importStar(require("@actions/core"));
|
||||||
const actions_util_1 = require("./actions-util");
|
const actions_util_1 = require("./actions-util");
|
||||||
const api_client_1 = require("./api-client");
|
const api_client_1 = require("./api-client");
|
||||||
const environment_1 = require("./environment");
|
const environment_1 = require("./environment");
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
|
/** Overall status of the entire job. String values match the Hydro schema. */
|
||||||
|
var JobStatus;
|
||||||
|
(function (JobStatus) {
|
||||||
|
JobStatus["UnknownStatus"] = "JOB_STATUS_UNKNOWN";
|
||||||
|
JobStatus["SuccessStatus"] = "JOB_STATUS_SUCCESS";
|
||||||
|
JobStatus["FailureStatus"] = "JOB_STATUS_FAILURE";
|
||||||
|
JobStatus["ConfigErrorStatus"] = "JOB_STATUS_CONFIGURATION_ERROR";
|
||||||
|
})(JobStatus || (exports.JobStatus = JobStatus = {}));
|
||||||
function getActionsStatus(error, otherFailureCause) {
|
function getActionsStatus(error, otherFailureCause) {
|
||||||
if (error || otherFailureCause) {
|
if (error || otherFailureCause) {
|
||||||
return error instanceof util_1.UserError ? "user-error" : "failure";
|
return error instanceof util_1.ConfigurationError ? "user-error" : "failure";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return "success";
|
return "success";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.getActionsStatus = getActionsStatus;
|
exports.getActionsStatus = getActionsStatus;
|
||||||
|
/**
|
||||||
|
* Sets the overall job status environment variable to configuration error
|
||||||
|
* or failure, unless it's already been set to one of these values in a
|
||||||
|
* previous step.
|
||||||
|
*/
|
||||||
|
function setJobStatusIfUnsuccessful(actionStatus) {
|
||||||
|
if (actionStatus === "user-error") {
|
||||||
|
core.exportVariable(environment_1.EnvVar.JOB_STATUS, process.env[environment_1.EnvVar.JOB_STATUS] ?? JobStatus.ConfigErrorStatus);
|
||||||
|
}
|
||||||
|
else if (actionStatus === "failure" || actionStatus === "aborted") {
|
||||||
|
core.exportVariable(environment_1.EnvVar.JOB_STATUS, process.env[environment_1.EnvVar.JOB_STATUS] ?? JobStatus.FailureStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Compose a StatusReport.
|
* Compose a StatusReport.
|
||||||
*
|
*
|
||||||
@@ -82,9 +103,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, diskI
|
|||||||
job_name: jobName,
|
job_name: jobName,
|
||||||
job_run_uuid: jobRunUUID,
|
job_run_uuid: jobRunUUID,
|
||||||
ref,
|
ref,
|
||||||
runner_available_disk_space_bytes: diskInfo.numAvailableBytes,
|
|
||||||
runner_os: runnerOs,
|
runner_os: runnerOs,
|
||||||
runner_total_disk_space_bytes: diskInfo.numTotalBytes,
|
|
||||||
started_at: workflowStartedAt,
|
started_at: workflowStartedAt,
|
||||||
status,
|
status,
|
||||||
testing_environment: testingEnvironment,
|
testing_environment: testingEnvironment,
|
||||||
@@ -92,6 +111,10 @@ async function createStatusReportBase(actionName, status, actionStartedAt, diskI
|
|||||||
workflow_run_attempt: workflowRunAttempt,
|
workflow_run_attempt: workflowRunAttempt,
|
||||||
workflow_run_id: workflowRunID,
|
workflow_run_id: workflowRunID,
|
||||||
};
|
};
|
||||||
|
if (diskInfo) {
|
||||||
|
statusReport.runner_available_disk_space_bytes = diskInfo.numAvailableBytes;
|
||||||
|
statusReport.runner_total_disk_space_bytes = diskInfo.numTotalBytes;
|
||||||
|
}
|
||||||
// Add optional parameters
|
// Add optional parameters
|
||||||
if (cause) {
|
if (cause) {
|
||||||
statusReport.cause = cause;
|
statusReport.cause = cause;
|
||||||
@@ -127,8 +150,6 @@ async function createStatusReportBase(actionName, status, actionStartedAt, diskI
|
|||||||
return statusReport;
|
return statusReport;
|
||||||
}
|
}
|
||||||
exports.createStatusReportBase = createStatusReportBase;
|
exports.createStatusReportBase = createStatusReportBase;
|
||||||
const GENERIC_403_MSG = "The repo on which this action is running is not opted-in to CodeQL code scanning.";
|
|
||||||
const GENERIC_404_MSG = "Not authorized to use the CodeQL code scanning feature on this repo.";
|
|
||||||
const OUT_OF_DATE_MSG = "CodeQL Action is out-of-date. Please upgrade to the latest version of codeql-action.";
|
const OUT_OF_DATE_MSG = "CodeQL Action is out-of-date. Please upgrade to the latest version of codeql-action.";
|
||||||
const INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the code scanning endpoint. Please update to a compatible version of codeql-action.";
|
const INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the code scanning endpoint. Please update to a compatible version of codeql-action.";
|
||||||
/**
|
/**
|
||||||
@@ -138,15 +159,19 @@ const INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the code sc
|
|||||||
* as failed if the status report failed. This is only expected to be used
|
* as failed if the status report failed. This is only expected to be used
|
||||||
* when sending a 'starting' report.
|
* when sending a 'starting' report.
|
||||||
*
|
*
|
||||||
* Returns whether sending the status report was successful of not.
|
* The `/code-scanning/analysis/status` endpoint is internal and it is not critical that it succeeds:
|
||||||
|
* https://github.com/github/codeql/issues/15462#issuecomment-1919186317
|
||||||
|
*
|
||||||
|
* Failures while calling this endpoint are logged as warings.
|
||||||
*/
|
*/
|
||||||
async function sendStatusReport(statusReport) {
|
async function sendStatusReport(statusReport) {
|
||||||
|
setJobStatusIfUnsuccessful(statusReport.status);
|
||||||
const statusReportJSON = JSON.stringify(statusReport);
|
const statusReportJSON = JSON.stringify(statusReport);
|
||||||
core.debug(`Sending status report: ${statusReportJSON}`);
|
core.debug(`Sending status report: ${statusReportJSON}`);
|
||||||
// If in test mode we don't want to upload the results
|
// If in test mode we don't want to upload the results
|
||||||
if ((0, util_1.isInTestMode)()) {
|
if ((0, util_1.isInTestMode)()) {
|
||||||
core.debug("In test mode. Status reports are not uploaded.");
|
core.debug("In test mode. Status reports are not uploaded.");
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
const nwo = (0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY");
|
const nwo = (0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY");
|
||||||
const [owner, repo] = nwo.split("/");
|
const [owner, repo] = nwo.split("/");
|
||||||
@@ -157,7 +182,6 @@ async function sendStatusReport(statusReport) {
|
|||||||
repo,
|
repo,
|
||||||
data: statusReportJSON,
|
data: statusReportJSON,
|
||||||
});
|
});
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
@@ -166,18 +190,18 @@ async function sendStatusReport(statusReport) {
|
|||||||
case 403:
|
case 403:
|
||||||
if ((0, actions_util_1.getWorkflowEventName)() === "push" &&
|
if ((0, actions_util_1.getWorkflowEventName)() === "push" &&
|
||||||
process.env["GITHUB_ACTOR"] === "dependabot[bot]") {
|
process.env["GITHUB_ACTOR"] === "dependabot[bot]") {
|
||||||
core.setFailed('Workflows triggered by Dependabot on the "push" event run with read-only access. ' +
|
core.warning('Workflows triggered by Dependabot on the "push" event run with read-only access. ' +
|
||||||
"Uploading Code Scanning results requires write access. " +
|
"Uploading Code Scanning results requires write access. " +
|
||||||
'To use Code Scanning with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. ' +
|
'To use Code Scanning with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. ' +
|
||||||
"See https://docs.github.com/en/code-security/secure-coding/configuring-code-scanning#scanning-on-push for more information on how to configure these events.");
|
"See https://docs.github.com/en/code-security/secure-coding/configuring-code-scanning#scanning-on-push for more information on how to configure these events.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.setFailed(e.message || GENERIC_403_MSG);
|
core.warning(e.message);
|
||||||
}
|
}
|
||||||
return false;
|
return;
|
||||||
case 404:
|
case 404:
|
||||||
core.setFailed(GENERIC_404_MSG);
|
core.warning(e.message);
|
||||||
return false;
|
return;
|
||||||
case 422:
|
case 422:
|
||||||
// schema incompatibility when reporting status
|
// schema incompatibility when reporting status
|
||||||
// this means that this action version is no longer compatible with the API
|
// this means that this action version is no longer compatible with the API
|
||||||
@@ -188,13 +212,12 @@ async function sendStatusReport(statusReport) {
|
|||||||
else {
|
else {
|
||||||
core.debug(OUT_OF_DATE_MSG);
|
core.debug(OUT_OF_DATE_MSG);
|
||||||
}
|
}
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// something else has gone wrong and the request/response will be logged by octokit
|
// something else has gone wrong and the request/response will be logged by octokit
|
||||||
// it's possible this is a transient error and we should continue scanning
|
// it's possible this is a transient error and we should continue scanning
|
||||||
core.error("An unexpected error occurred when sending code scanning status report.");
|
core.warning("An unexpected error occurred when sending code scanning status report.");
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.sendStatusReport = sendStatusReport;
|
exports.sendStatusReport = sendStatusReport;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
33
lib/testing-utils.js
generated
33
lib/testing-utils.js
generated
@@ -26,14 +26,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.mockBundleDownloadApi = exports.createFeatures = exports.mockCodeQLVersion = exports.makeVersionInfo = exports.mockLanguagesInRepo = exports.mockFeatureFlagApiEndpoint = exports.getRecordingLogger = exports.setupActionsVars = exports.setupTests = exports.SAMPLE_DEFAULT_CLI_VERSION = exports.SAMPLE_DOTCOM_API_DETAILS = void 0;
|
exports.createTestConfig = exports.mockBundleDownloadApi = exports.createFeatures = exports.mockCodeQLVersion = exports.makeVersionInfo = exports.mockLanguagesInRepo = exports.mockFeatureFlagApiEndpoint = exports.getRecordingLogger = exports.setupActionsVars = exports.setupTests = exports.SAMPLE_DEFAULT_CLI_VERSION = exports.SAMPLE_DOTCOM_API_DETAILS = void 0;
|
||||||
const node_util_1 = require("node:util");
|
const node_util_1 = require("node:util");
|
||||||
const path_1 = __importDefault(require("path"));
|
const path_1 = __importDefault(require("path"));
|
||||||
const github = __importStar(require("@actions/github"));
|
const github = __importStar(require("@actions/github"));
|
||||||
const nock_1 = __importDefault(require("nock"));
|
const nock_1 = __importDefault(require("nock"));
|
||||||
const sinon = __importStar(require("sinon"));
|
const sinon = __importStar(require("sinon"));
|
||||||
const apiClient = __importStar(require("./api-client"));
|
const apiClient = __importStar(require("./api-client"));
|
||||||
const CodeQL = __importStar(require("./codeql"));
|
const codeql = __importStar(require("./codeql"));
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
exports.SAMPLE_DOTCOM_API_DETAILS = {
|
exports.SAMPLE_DOTCOM_API_DETAILS = {
|
||||||
auth: "token",
|
auth: "token",
|
||||||
@@ -74,7 +74,7 @@ function setupTests(test) {
|
|||||||
typedTest.beforeEach((t) => {
|
typedTest.beforeEach((t) => {
|
||||||
// Set an empty CodeQL object so that all method calls will fail
|
// Set an empty CodeQL object so that all method calls will fail
|
||||||
// unless the test explicitly sets one up.
|
// unless the test explicitly sets one up.
|
||||||
CodeQL.setCodeQL({});
|
codeql.setCodeQL({});
|
||||||
// Replace stdout and stderr so we can record output during tests
|
// Replace stdout and stderr so we can record output during tests
|
||||||
t.context.testOutput = "";
|
t.context.testOutput = "";
|
||||||
const processStdoutWrite = process.stdout.write.bind(process.stdout);
|
const processStdoutWrite = process.stdout.write.bind(process.stdout);
|
||||||
@@ -196,11 +196,11 @@ const makeVersionInfo = (version, features) => ({
|
|||||||
});
|
});
|
||||||
exports.makeVersionInfo = makeVersionInfo;
|
exports.makeVersionInfo = makeVersionInfo;
|
||||||
function mockCodeQLVersion(version, features) {
|
function mockCodeQLVersion(version, features) {
|
||||||
return {
|
return codeql.setCodeQL({
|
||||||
async getVersion() {
|
async getVersion() {
|
||||||
return (0, exports.makeVersionInfo)(version, features);
|
return (0, exports.makeVersionInfo)(version, features);
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
exports.mockCodeQLVersion = mockCodeQLVersion;
|
exports.mockCodeQLVersion = mockCodeQLVersion;
|
||||||
/**
|
/**
|
||||||
@@ -241,4 +241,27 @@ function mockBundleDownloadApi({ apiDetails = exports.SAMPLE_DOTCOM_API_DETAILS,
|
|||||||
return `${baseUrl}${relativeUrl}`;
|
return `${baseUrl}${relativeUrl}`;
|
||||||
}
|
}
|
||||||
exports.mockBundleDownloadApi = mockBundleDownloadApi;
|
exports.mockBundleDownloadApi = mockBundleDownloadApi;
|
||||||
|
function createTestConfig(overrides) {
|
||||||
|
return Object.assign({}, {
|
||||||
|
languages: [],
|
||||||
|
buildMode: undefined,
|
||||||
|
originalUserInput: {},
|
||||||
|
tempDir: "",
|
||||||
|
codeQLCmd: "",
|
||||||
|
gitHubVersion: {
|
||||||
|
type: util_1.GitHubVariant.DOTCOM,
|
||||||
|
},
|
||||||
|
dbLocation: "",
|
||||||
|
debugMode: false,
|
||||||
|
debugArtifactName: util_1.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||||
|
debugDatabaseName: util_1.DEFAULT_DEBUG_DATABASE_NAME,
|
||||||
|
augmentationProperties: {
|
||||||
|
packsInputCombines: false,
|
||||||
|
queriesInputCombines: false,
|
||||||
|
},
|
||||||
|
trapCaches: {},
|
||||||
|
trapCacheDownloadTime: 0,
|
||||||
|
}, overrides);
|
||||||
|
}
|
||||||
|
exports.createTestConfig = createTestConfig;
|
||||||
//# sourceMappingURL=testing-utils.js.map
|
//# sourceMappingURL=testing-utils.js.map
|
||||||
File diff suppressed because one or more lines are too long
2
lib/tools-features.js
generated
2
lib/tools-features.js
generated
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
exports.isSupportedToolsFeature = exports.ToolsFeature = void 0;
|
exports.isSupportedToolsFeature = exports.ToolsFeature = void 0;
|
||||||
var ToolsFeature;
|
var ToolsFeature;
|
||||||
(function (ToolsFeature) {
|
(function (ToolsFeature) {
|
||||||
|
ToolsFeature["BuildModeOption"] = "buildModeOption";
|
||||||
ToolsFeature["IndirectTracingSupportsStaticBinaries"] = "indirectTracingSupportsStaticBinaries";
|
ToolsFeature["IndirectTracingSupportsStaticBinaries"] = "indirectTracingSupportsStaticBinaries";
|
||||||
ToolsFeature["SetsCodeqlRunnerEnvVar"] = "setsCodeqlRunnerEnvVar";
|
ToolsFeature["SetsCodeqlRunnerEnvVar"] = "setsCodeqlRunnerEnvVar";
|
||||||
|
ToolsFeature["TraceCommandUseBuildMode"] = "traceCommandUseBuildMode";
|
||||||
})(ToolsFeature || (exports.ToolsFeature = ToolsFeature = {}));
|
})(ToolsFeature || (exports.ToolsFeature = ToolsFeature = {}));
|
||||||
/**
|
/**
|
||||||
* Determines if the given feature is supported by the CLI.
|
* Determines if the given feature is supported by the CLI.
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"tools-features.js","sourceRoot":"","sources":["../src/tools-features.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+FAA+E,CAAA;IAC/E,iEAAiD,CAAA;AACnD,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,WAAwB,EACxB,OAAqB;IAErB,OAAO,CAAC,CAAC,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACjE,CAAC;AALD,0DAKC"}
|
{"version":3,"file":"tools-features.js","sourceRoot":"","sources":["../src/tools-features.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,mDAAmC,CAAA;IACnC,+FAA+E,CAAA;IAC/E,iEAAiD,CAAA;IACjD,qEAAqD,CAAA;AACvD,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,WAAwB,EACxB,OAAqB;IAErB,OAAO,CAAC,CAAC,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACjE,CAAC;AALD,0DAKC"}
|
||||||
4
lib/tracer-config.js
generated
4
lib/tracer-config.js
generated
@@ -59,7 +59,7 @@ async function getTracerConfigForCluster(config) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.getTracerConfigForCluster = getTracerConfigForCluster;
|
exports.getTracerConfigForCluster = getTracerConfigForCluster;
|
||||||
async function getCombinedTracerConfig(versionInfo, config) {
|
async function getCombinedTracerConfig(codeql, config) {
|
||||||
// Abort if there are no traced languages as there's nothing to do
|
// Abort if there are no traced languages as there's nothing to do
|
||||||
const tracedLanguages = config.languages.filter((l) => (0, languages_1.isTracedLanguage)(l));
|
const tracedLanguages = config.languages.filter((l) => (0, languages_1.isTracedLanguage)(l));
|
||||||
if (tracedLanguages.length === 0) {
|
if (tracedLanguages.length === 0) {
|
||||||
@@ -68,7 +68,7 @@ async function getCombinedTracerConfig(versionInfo, config) {
|
|||||||
const mainTracerConfig = await getTracerConfigForCluster(config);
|
const mainTracerConfig = await getTracerConfigForCluster(config);
|
||||||
// If the CLI doesn't yet support setting the CODEQL_RUNNER environment variable to
|
// If the CLI doesn't yet support setting the CODEQL_RUNNER environment variable to
|
||||||
// the runner executable path, we set it here in the Action.
|
// the runner executable path, we set it here in the Action.
|
||||||
if (!(0, tools_features_1.isSupportedToolsFeature)(versionInfo, tools_features_1.ToolsFeature.SetsCodeqlRunnerEnvVar)) {
|
if (!(await codeql.supportsFeature(tools_features_1.ToolsFeature.SetsCodeqlRunnerEnvVar))) {
|
||||||
// On MacOS when System Integrity Protection is enabled, it's necessary to prefix
|
// On MacOS when System Integrity Protection is enabled, it's necessary to prefix
|
||||||
// the build command with the runner executable for indirect tracing, so we expose
|
// the build command with the runner executable for indirect tracing, so we expose
|
||||||
// it here via the CODEQL_RUNNER environment variable.
|
// it here via the CODEQL_RUNNER environment variable.
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3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AAU,EACjB,4CAA4C,CAC7C,EACD,MAAM,CACP,CACF,CAAC;IACF,OAAO;QACL,GAAG,EAAE,mBAAmB;KACzB,CAAC;AACJ,CAAC;AAfD,8DAeC;AAEM,KAAK,UAAU,uBAAuB,CAC3C,MAAc,EACd,MAA0B;IAE1B,kEAAkE;IAClE,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,4BAAgB,EAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAEjE,mFAAmF;IACnF,4DAA4D;IAC5D,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,eAAe,CAAC,6BAAY,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC;QACzE,iFAAiF;QACjF,kFAAkF;QAClF,sDAAsD;QACtD,iFAAiF;QACjF,gCAAgC;QAChC,MAAM,aAAa,GACjB,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC;QACzD,gBAAgB,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,IAAI,CAC/C,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,EACnC,OAAO,EACP,gBAAgB,CAAC,GAAG,CAAC,iBAAiB,CAAC,EACvC,aAAa,CACd,CAAC;IACJ,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AA/BD,0DA+BC"}
|
||||||
26
lib/tracer-config.test.js
generated
26
lib/tracer-config.test.js
generated
@@ -29,34 +29,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
const fs = __importStar(require("fs"));
|
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 configUtils = __importStar(require("./config-utils"));
|
|
||||||
const languages_1 = require("./languages");
|
const languages_1 = require("./languages");
|
||||||
const testing_utils_1 = require("./testing-utils");
|
const testing_utils_1 = require("./testing-utils");
|
||||||
const tracer_config_1 = require("./tracer-config");
|
const tracer_config_1 = require("./tracer-config");
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
(0, testing_utils_1.setupTests)(ava_1.default);
|
(0, testing_utils_1.setupTests)(ava_1.default);
|
||||||
function getTestConfig(tmpDir) {
|
function getTestConfig(tempDir) {
|
||||||
return {
|
return (0, testing_utils_1.createTestConfig)({
|
||||||
languages: [languages_1.Language.java],
|
languages: [languages_1.Language.java],
|
||||||
originalUserInput: {},
|
tempDir,
|
||||||
tempDir: tmpDir,
|
dbLocation: path.resolve(tempDir, "codeql_databases"),
|
||||||
codeQLCmd: "",
|
});
|
||||||
gitHubVersion: { type: util.GitHubVariant.DOTCOM },
|
|
||||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
|
||||||
debugMode: false,
|
|
||||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
|
||||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
|
||||||
augmentationProperties: configUtils.defaultAugmentationProperties,
|
|
||||||
trapCaches: {},
|
|
||||||
trapCacheDownloadTime: 0,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
(0, ava_1.default)("getCombinedTracerConfig - return undefined when no languages are traced languages", async (t) => {
|
(0, ava_1.default)("getCombinedTracerConfig - return undefined when no languages are traced languages", async (t) => {
|
||||||
await util.withTmpDir(async (tmpDir) => {
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
const config = getTestConfig(tmpDir);
|
const config = getTestConfig(tmpDir);
|
||||||
// No traced languages
|
// No traced languages
|
||||||
config.languages = [languages_1.Language.javascript, languages_1.Language.python];
|
config.languages = [languages_1.Language.javascript, languages_1.Language.python];
|
||||||
t.deepEqual(await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.makeVersionInfo)("1.0.0"), config), undefined);
|
t.deepEqual(await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.mockCodeQLVersion)("1.0.0"), config), undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("getCombinedTracerConfig - with start-tracing.json environment file", async (t) => {
|
(0, ava_1.default)("getCombinedTracerConfig - with start-tracing.json environment file", async (t) => {
|
||||||
@@ -77,7 +67,7 @@ function getTestConfig(tmpDir) {
|
|||||||
fs.mkdirSync(tracingEnvironmentDir, { recursive: true });
|
fs.mkdirSync(tracingEnvironmentDir, { recursive: true });
|
||||||
const startTracingJson = path.join(tracingEnvironmentDir, "start-tracing.json");
|
const startTracingJson = path.join(tracingEnvironmentDir, "start-tracing.json");
|
||||||
fs.writeFileSync(startTracingJson, JSON.stringify(startTracingEnv));
|
fs.writeFileSync(startTracingJson, JSON.stringify(startTracingEnv));
|
||||||
const result = await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.makeVersionInfo)("1.0.0"), config);
|
const result = await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.mockCodeQLVersion)("1.0.0"), config);
|
||||||
t.notDeepEqual(result, undefined);
|
t.notDeepEqual(result, undefined);
|
||||||
const expectedEnv = startTracingEnv;
|
const expectedEnv = startTracingEnv;
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
@@ -112,7 +102,7 @@ function getTestConfig(tmpDir) {
|
|||||||
fs.mkdirSync(tracingEnvironmentDir, { recursive: true });
|
fs.mkdirSync(tracingEnvironmentDir, { recursive: true });
|
||||||
const startTracingJson = path.join(tracingEnvironmentDir, "start-tracing.json");
|
const startTracingJson = path.join(tracingEnvironmentDir, "start-tracing.json");
|
||||||
fs.writeFileSync(startTracingJson, JSON.stringify(startTracingEnv));
|
fs.writeFileSync(startTracingJson, JSON.stringify(startTracingEnv));
|
||||||
const result = await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.makeVersionInfo)("1.0.0", { setsCodeqlRunnerEnvVar: true }), config);
|
const result = await (0, tracer_config_1.getCombinedTracerConfig)((0, testing_utils_1.mockCodeQLVersion)("1.0.0", { setsCodeqlRunnerEnvVar: true }), config);
|
||||||
t.notDeepEqual(result, undefined);
|
t.notDeepEqual(result, undefined);
|
||||||
t.false(Object.prototype.hasOwnProperty.call(result?.env, "CODEQL_RUNNER"));
|
t.false(Object.prototype.hasOwnProperty.call(result?.env, "CODEQL_RUNNER"));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"tracer-config.test.js","sourceRoot":"","sources":["../src/tracer-config.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,8CAAuB;AAEvB,4DAA8C;AAC9C,2CAAuC;AACvC,mDAA8D;AAC9D,mDAA0D;AAC1D,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,SAAS,aAAa,CAAC,MAAc;IACnC,OAAO;QACL,SAAS,EAAE,CAAC,oBAAQ,CAAC,IAAI,CAAC;QAC1B,iBAAiB,EAAE,EAAE;QACrB,OAAO,EAAE,MAAM;QACf,SAAS,EAAE,EAAE;QACb,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAwB;QACxE,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,kBAAkB,CAAC;QACpD,SAAS,EAAE,KAAK;QAChB,iBAAiB,EAAE,IAAI,CAAC,2BAA2B;QACnD,iBAAiB,EAAE,IAAI,CAAC,2BAA2B;QACnD,sBAAsB,EAAE,WAAW,CAAC,6BAA6B;QACjE,UAAU,EAAE,EAAE;QACd,qBAAqB,E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AM,EAAE,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
||||||
44
lib/trap-caching.test.js
generated
44
lib/trap-caching.test.js
generated
@@ -78,48 +78,22 @@ const stubCodeql = (0, codeql_1.setCodeQL)({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const testConfigWithoutTmpDir = {
|
const testConfigWithoutTmpDir = (0, testing_utils_1.createTestConfig)({
|
||||||
languages: [languages_1.Language.javascript, languages_1.Language.cpp],
|
languages: [languages_1.Language.javascript, languages_1.Language.cpp],
|
||||||
originalUserInput: {},
|
|
||||||
tempDir: "",
|
|
||||||
codeQLCmd: "",
|
|
||||||
gitHubVersion: {
|
|
||||||
type: util.GitHubVariant.DOTCOM,
|
|
||||||
},
|
|
||||||
dbLocation: "",
|
|
||||||
debugMode: false,
|
|
||||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
|
||||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
|
||||||
augmentationProperties: {
|
|
||||||
packsInputCombines: false,
|
|
||||||
queriesInputCombines: false,
|
|
||||||
},
|
|
||||||
trapCaches: {
|
trapCaches: {
|
||||||
javascript: "/some/cache/dir",
|
javascript: "/some/cache/dir",
|
||||||
},
|
},
|
||||||
trapCacheDownloadTime: 0,
|
});
|
||||||
};
|
function getTestConfigWithTempDir(tempDir) {
|
||||||
function getTestConfigWithTempDir(tmpDir) {
|
return (0, testing_utils_1.createTestConfig)({
|
||||||
return {
|
|
||||||
languages: [languages_1.Language.javascript, languages_1.Language.ruby],
|
languages: [languages_1.Language.javascript, languages_1.Language.ruby],
|
||||||
originalUserInput: {},
|
tempDir,
|
||||||
tempDir: tmpDir,
|
dbLocation: path.resolve(tempDir, "codeql_databases"),
|
||||||
codeQLCmd: "",
|
|
||||||
gitHubVersion: { type: util.GitHubVariant.DOTCOM },
|
|
||||||
dbLocation: path.resolve(tmpDir, "codeql_databases"),
|
|
||||||
debugMode: false,
|
|
||||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
|
||||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
|
||||||
augmentationProperties: {
|
|
||||||
packsInputCombines: false,
|
|
||||||
queriesInputCombines: false,
|
|
||||||
},
|
|
||||||
trapCaches: {
|
trapCaches: {
|
||||||
javascript: path.resolve(tmpDir, "jsCache"),
|
javascript: path.resolve(tempDir, "jsCache"),
|
||||||
ruby: path.resolve(tmpDir, "rubyCache"),
|
ruby: path.resolve(tempDir, "rubyCache"),
|
||||||
},
|
},
|
||||||
trapCacheDownloadTime: 0,
|
});
|
||||||
};
|
|
||||||
}
|
}
|
||||||
(0, ava_1.default)("check flags for JS, analyzing default branch", async (t) => {
|
(0, ava_1.default)("check flags for JS, analyzing default branch", async (t) => {
|
||||||
await util.withTmpDir(async (tmpDir) => {
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
50
lib/upload-lib.js
generated
50
lib/upload-lib.js
generated
@@ -40,6 +40,8 @@ const fingerprints = __importStar(require("./fingerprints"));
|
|||||||
const repository_1 = require("./repository");
|
const repository_1 = require("./repository");
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
|
const GENERIC_403_MSG = "The repo on which this action is running has not opted-in to CodeQL code scanning.";
|
||||||
|
const GENERIC_404_MSG = "The CodeQL code scanning feature is forbidden on this repository.";
|
||||||
// Takes a list of paths to sarif files and combines them together,
|
// Takes a list of paths to sarif files and combines them together,
|
||||||
// returning the contents of the combined sarif file.
|
// returning the contents of the combined sarif file.
|
||||||
function combineSarifFiles(sarifFiles) {
|
function combineSarifFiles(sarifFiles) {
|
||||||
@@ -100,14 +102,32 @@ async function uploadPayload(payload, repositoryNwo, logger) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const client = api.getApiClient();
|
const client = api.getApiClient();
|
||||||
const response = await client.request("PUT /repos/:owner/:repo/code-scanning/analysis", {
|
try {
|
||||||
owner: repositoryNwo.owner,
|
const response = await client.request("PUT /repos/:owner/:repo/code-scanning/analysis", {
|
||||||
repo: repositoryNwo.repo,
|
owner: repositoryNwo.owner,
|
||||||
data: payload,
|
repo: repositoryNwo.repo,
|
||||||
});
|
data: payload,
|
||||||
logger.debug(`response status: ${response.status}`);
|
});
|
||||||
logger.info("Successfully uploaded results");
|
logger.debug(`response status: ${response.status}`);
|
||||||
return response.data.id;
|
logger.info("Successfully uploaded results");
|
||||||
|
return response.data.id;
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
if (util.isHTTPError(e)) {
|
||||||
|
switch (e.status) {
|
||||||
|
case 403:
|
||||||
|
core.warning(e.message || GENERIC_403_MSG);
|
||||||
|
break;
|
||||||
|
case 404:
|
||||||
|
core.warning(e.message || GENERIC_404_MSG);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
core.warning(e.message);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Recursively walks a directory and returns all SARIF files it finds.
|
// Recursively walks a directory and returns all SARIF files it finds.
|
||||||
// Does not follow symlinks.
|
// Does not follow symlinks.
|
||||||
@@ -132,17 +152,17 @@ exports.findSarifFilesInDir = findSarifFilesInDir;
|
|||||||
* Uploads a single SARIF file or a directory of SARIF files depending on what `sarifPath` refers
|
* Uploads a single SARIF file or a directory of SARIF files depending on what `sarifPath` refers
|
||||||
* to.
|
* to.
|
||||||
*
|
*
|
||||||
* @param considerInvalidRequestUserError Whether an invalid request, for example one with a
|
* @param considerInvalidRequestConfigError Whether an invalid request, for example one with a
|
||||||
* `sarifPath` that does not exist, should be considered a
|
* `sarifPath` that does not exist, should be considered a
|
||||||
* user error.
|
* user error.
|
||||||
*/
|
*/
|
||||||
async function uploadFromActions(sarifPath, checkoutPath, category, logger, { considerInvalidRequestUserError, }) {
|
async function uploadFromActions(sarifPath, checkoutPath, category, logger, { considerInvalidRequestConfigError: considerInvalidRequestConfigError, }) {
|
||||||
try {
|
try {
|
||||||
return await uploadFiles(getSarifFilePaths(sarifPath), (0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY")), await actionsUtil.getCommitOid(checkoutPath), await actionsUtil.getRef(), await api.getAnalysisKey(), category, util.getRequiredEnvParam("GITHUB_WORKFLOW"), actionsUtil.getWorkflowRunID(), actionsUtil.getWorkflowRunAttempt(), checkoutPath, actionsUtil.getRequiredInput("matrix"), logger);
|
return await uploadFiles(getSarifFilePaths(sarifPath), (0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY")), await actionsUtil.getCommitOid(checkoutPath), await actionsUtil.getRef(), await api.getAnalysisKey(), category, util.getRequiredEnvParam("GITHUB_WORKFLOW"), actionsUtil.getWorkflowRunID(), actionsUtil.getWorkflowRunAttempt(), checkoutPath, actionsUtil.getRequiredInput("matrix"), logger);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if (e instanceof InvalidRequestError && considerInvalidRequestUserError) {
|
if (e instanceof InvalidRequestError && considerInvalidRequestConfigError) {
|
||||||
throw new util_1.UserError(e.message);
|
throw new util_1.ConfigurationError(e.message);
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
@@ -343,8 +363,8 @@ async function waitForProcessing(repositoryNwo, sarifID, logger, options = {
|
|||||||
}
|
}
|
||||||
else if (status === "failed") {
|
else if (status === "failed") {
|
||||||
const message = `Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`;
|
const message = `Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`;
|
||||||
throw shouldConsiderAsUserError(response.data.errors)
|
throw shouldConsiderConfigurationError(response.data.errors)
|
||||||
? new util_1.UserError(message)
|
? new util_1.ConfigurationError(message)
|
||||||
: new InvalidRequestError(message);
|
: new InvalidRequestError(message);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -363,7 +383,7 @@ exports.waitForProcessing = waitForProcessing;
|
|||||||
/**
|
/**
|
||||||
* Returns whether the provided processing errors should be considered a user error.
|
* Returns whether the provided processing errors should be considered a user error.
|
||||||
*/
|
*/
|
||||||
function shouldConsiderAsUserError(processingErrors) {
|
function shouldConsiderConfigurationError(processingErrors) {
|
||||||
return (processingErrors.length === 1 &&
|
return (processingErrors.length === 1 &&
|
||||||
processingErrors[0] ===
|
processingErrors[0] ===
|
||||||
"CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled");
|
"CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled");
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
6
lib/upload-sarif-action.js
generated
6
lib/upload-sarif-action.js
generated
@@ -46,11 +46,9 @@ async function run() {
|
|||||||
(0, util_1.initializeEnvironment)((0, actions_util_1.getActionVersion)());
|
(0, util_1.initializeEnvironment)((0, actions_util_1.getActionVersion)());
|
||||||
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
||||||
(0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion);
|
(0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion);
|
||||||
if (!(await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)("upload-sarif", "starting", startedAt, await (0, util_1.checkDiskUsage)())))) {
|
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)("upload-sarif", "starting", startedAt, await (0, util_1.checkDiskUsage)()));
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
const uploadResult = await upload_lib.uploadFromActions(actionsUtil.getRequiredInput("sarif_file"), actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, { considerInvalidRequestUserError: true });
|
const uploadResult = await upload_lib.uploadFromActions(actionsUtil.getRequiredInput("sarif_file"), actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, { considerInvalidRequestConfigError: true });
|
||||||
core.setOutput("sarif-id", uploadResult.sarifID);
|
core.setOutput("sarif-id", uploadResult.sarifID);
|
||||||
// We don't upload results in test mode, so don't wait for processing
|
// We don't upload results in test mode, so don't wait for processing
|
||||||
if ((0, util_1.isInTestMode)()) {
|
if ((0, util_1.isInTestMode)()) {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"upload-sarif-action.js","sourceRoot":"","sources":["../src/upload-sarif-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,iDAAkD;AAClD,6CAAgD;AAChD,uCAA6C;AAC7C,6CAAkD;AAClD,mDAKyB;AACzB,yDAA2C;AAC3C,iCAOgB;AAMhB,KAAK,UAAU,uBAAuB,CACpC,SAAe,EACf,WAA0C;IAE1C,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,cAAc,EACd,SAAS,EACT,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,CACvB,CAAC;IACF,MAAM,YAAY,GAA4B;QAC5C,GAAG,gBAAgB;QACnB,GAAG,WAAW;KACf,CAAC;IACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAClC,IAAA,4BAAqB,EAAC,IAAA,+BAAgB,GAAE,CAAC,CAAC;IAE1C,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAgB,GAAE,CAAC;IAC/C,IAAA,yBAAkB,EAAC,IAAA,+BAAgB,GAAE,EAAE,aAAa,CAAC,CAAC;IAEtD,IACE,CAAC,CAAC,MAA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Ac,EACd,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,OAAO,EACP,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;QACF,OAAO;IACT,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CACZ,sCAAsC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CACjE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
{"version":3,"file":"upload-sarif-action.js","sourceRoot":"","sources":["../src/upload-sarif-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,iDAAkD;AAClD,6CAAgD;AAChD,uCAA6C;AAC7C,6CAAkD;AAClD,mDAKyB;AACzB,yDAA2C;AAC3C,iCAOgB;AAMhB,KAAK,UAAU,uBAAuB,CACpC,SAAe,EACf,WAA0C;IAE1C,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,cAAc,EACd,SAAS,EACT,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,CACvB,CAAC;IACF,MAAM,YAAY,GAA4B;QAC5C,GAAG,gBAAgB;QACnB,GAAG,WAAW;KACf,CAAC;IACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAClC,IAAA,4BAAqB,EAAC,IAAA,+BAAgB,GAAE,CAAC,CAAC;IAE1C,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAgB,GAAE,CAAC;IAC/C,IAA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AgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,cAAc,EACd,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,OAAO,EACP,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;QACF,OAAO;IACT,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CACZ,sCAAsC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CACjE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||||
119
lib/util.js
generated
119
lib/util.js
generated
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.checkActionVersion = exports.checkDiskUsage = exports.prettyPrintPack = exports.getErrorMessage = exports.wrapError = exports.fixInvalidNotificationsInFile = exports.fixInvalidNotifications = exports.parseMatrixInput = exports.isHostedRunner = exports.checkForTimeout = exports.withTimeout = exports.tryGetFolderBytes = exports.listFolder = exports.doesDirectoryExist = exports.isInTestMode = exports.supportExpectDiscardedCache = exports.isGoodVersion = exports.delay = exports.bundleDb = exports.codeQlVersionAbove = exports.getCachedCodeQlVersion = exports.cacheCodeQlVersion = exports.isHTTPError = exports.UserError = exports.HTTPError = exports.getRequiredEnvParam = exports.initializeEnvironment = exports.assertNever = exports.apiVersionInRange = exports.DisallowedAPIVersionReason = exports.checkGitHubVersionInRange = exports.GitHubVariant = exports.parseGitHubUrl = exports.getCodeQLDatabasePath = exports.getThreadsFlag = exports.getThreadsFlagValue = exports.getAddSnippetsFlag = exports.getMemoryFlag = exports.getMemoryFlagValue = exports.getMemoryFlagValueForPlatform = exports.withTmpDir = exports.getToolNames = exports.getExtraOptionsEnvParam = exports.DEFAULT_DEBUG_DATABASE_NAME = exports.DEFAULT_DEBUG_ARTIFACT_NAME = exports.GITHUB_DOTCOM_URL = void 0;
|
exports.checkActionVersion = exports.checkDiskUsage = exports.prettyPrintPack = exports.getErrorMessage = exports.wrapError = exports.fixInvalidNotificationsInFile = exports.fixInvalidNotifications = exports.parseMatrixInput = exports.isHostedRunner = exports.checkForTimeout = exports.withTimeout = exports.tryGetFolderBytes = exports.listFolder = exports.doesDirectoryExist = exports.isInTestMode = exports.supportExpectDiscardedCache = exports.isGoodVersion = exports.delay = exports.bundleDb = exports.codeQlVersionAbove = exports.getCachedCodeQlVersion = exports.cacheCodeQlVersion = exports.isHTTPError = exports.ConfigurationError = exports.HTTPError = exports.getRequiredEnvParam = exports.initializeEnvironment = exports.assertNever = exports.apiVersionInRange = exports.DisallowedAPIVersionReason = exports.checkGitHubVersionInRange = exports.GitHubVariant = exports.parseGitHubUrl = exports.getCodeQLDatabasePath = exports.getThreadsFlag = exports.getThreadsFlagValue = exports.getAddSnippetsFlag = exports.getMemoryFlag = exports.getMemoryFlagValue = exports.getMemoryFlagValueForPlatform = exports.withTmpDir = exports.getToolNames = exports.getExtraOptionsEnvParam = exports.DEFAULT_DEBUG_DATABASE_NAME = exports.DEFAULT_DEBUG_ARTIFACT_NAME = exports.GITHUB_DOTCOM_URL = 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"));
|
||||||
@@ -78,7 +78,7 @@ function getExtraOptionsEnvParam() {
|
|||||||
}
|
}
|
||||||
catch (unwrappedError) {
|
catch (unwrappedError) {
|
||||||
const error = wrapError(unwrappedError);
|
const error = wrapError(unwrappedError);
|
||||||
throw new UserError(`${varName} environment variable is set, but does not contain valid JSON: ${error.message}`);
|
throw new ConfigurationError(`${varName} environment variable is set, but does not contain valid JSON: ${error.message}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.getExtraOptionsEnvParam = getExtraOptionsEnvParam;
|
exports.getExtraOptionsEnvParam = getExtraOptionsEnvParam;
|
||||||
@@ -142,7 +142,7 @@ function getMemoryFlagValueForPlatform(userInput, totalMemoryBytes, platform) {
|
|||||||
if (userInput) {
|
if (userInput) {
|
||||||
memoryToUseMegaBytes = Number(userInput);
|
memoryToUseMegaBytes = Number(userInput);
|
||||||
if (Number.isNaN(memoryToUseMegaBytes) || memoryToUseMegaBytes <= 0) {
|
if (Number.isNaN(memoryToUseMegaBytes) || memoryToUseMegaBytes <= 0) {
|
||||||
throw new UserError(`Invalid RAM setting "${userInput}", specified.`);
|
throw new ConfigurationError(`Invalid RAM setting "${userInput}", specified.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -247,11 +247,22 @@ exports.getAddSnippetsFlag = getAddSnippetsFlag;
|
|||||||
*/
|
*/
|
||||||
function getThreadsFlagValue(userInput, logger) {
|
function getThreadsFlagValue(userInput, logger) {
|
||||||
let numThreads;
|
let numThreads;
|
||||||
const maxThreads = os.cpus().length;
|
const maxThreadsCandidates = [os.cpus().length];
|
||||||
|
if (os.platform() === "linux") {
|
||||||
|
maxThreadsCandidates.push(...["/sys/fs/cgroup/cpuset.cpus.effective", "/sys/fs/cgroup/cpuset.cpus"]
|
||||||
|
.map((file) => getCgroupCpuCountFromCpus(file, logger))
|
||||||
|
.filter((count) => count !== undefined && count > 0)
|
||||||
|
.map((count) => count));
|
||||||
|
maxThreadsCandidates.push(...["/sys/fs/cgroup/cpu.max"]
|
||||||
|
.map((file) => getCgroupCpuCountFromCpuMax(file, logger))
|
||||||
|
.filter((count) => count !== undefined && count > 0)
|
||||||
|
.map((count) => count));
|
||||||
|
}
|
||||||
|
const maxThreads = Math.min(...maxThreadsCandidates);
|
||||||
if (userInput) {
|
if (userInput) {
|
||||||
numThreads = Number(userInput);
|
numThreads = Number(userInput);
|
||||||
if (Number.isNaN(numThreads)) {
|
if (Number.isNaN(numThreads)) {
|
||||||
throw new UserError(`Invalid threads setting "${userInput}", specified.`);
|
throw new ConfigurationError(`Invalid threads setting "${userInput}", specified.`);
|
||||||
}
|
}
|
||||||
if (numThreads > maxThreads) {
|
if (numThreads > maxThreads) {
|
||||||
logger.info(`Clamping desired number of threads (${numThreads}) to max available (${maxThreads}).`);
|
logger.info(`Clamping desired number of threads (${numThreads}) to max available (${maxThreads}).`);
|
||||||
@@ -270,6 +281,56 @@ function getThreadsFlagValue(userInput, logger) {
|
|||||||
return numThreads;
|
return numThreads;
|
||||||
}
|
}
|
||||||
exports.getThreadsFlagValue = getThreadsFlagValue;
|
exports.getThreadsFlagValue = getThreadsFlagValue;
|
||||||
|
/**
|
||||||
|
* Gets the number of available cores specified by the cgroup cpu.max file at the given path.
|
||||||
|
* Format of file: two values, the limit and the duration (period). If the limit is "max" then
|
||||||
|
* we return undefined and do not use this file to determine CPU limits.
|
||||||
|
*/
|
||||||
|
function getCgroupCpuCountFromCpuMax(cpuMaxFile, logger) {
|
||||||
|
if (!fs.existsSync(cpuMaxFile)) {
|
||||||
|
logger.debug(`While resolving threads, did not find a cgroup CPU file at ${cpuMaxFile}.`);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const cpuMaxString = fs.readFileSync(cpuMaxFile, "utf-8");
|
||||||
|
const cpuMaxStringSplit = cpuMaxString.split(" ");
|
||||||
|
if (cpuMaxStringSplit.length !== 2) {
|
||||||
|
logger.debug(`While resolving threads, did not use cgroup CPU file at ${cpuMaxFile} because it contained ${cpuMaxStringSplit.length} value(s) rather than the two expected.`);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const cpuLimit = cpuMaxStringSplit[0];
|
||||||
|
if (cpuLimit === "max") {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const duration = cpuMaxStringSplit[1];
|
||||||
|
const cpuCount = Math.floor(parseInt(cpuLimit) / parseInt(duration));
|
||||||
|
logger.info(`While resolving threads, found a cgroup CPU file with ${cpuCount} CPUs in ${cpuMaxFile}.`);
|
||||||
|
return cpuCount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets the number of available cores listed in the cgroup cpuset.cpus file at the given path.
|
||||||
|
*/
|
||||||
|
function getCgroupCpuCountFromCpus(cpusFile, logger) {
|
||||||
|
if (!fs.existsSync(cpusFile)) {
|
||||||
|
logger.debug(`While resolving threads, did not find a cgroup CPUs file at ${cpusFile}.`);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
let cpuCount = 0;
|
||||||
|
// Comma-separated numbers and ranges, for eg. 0-1,3
|
||||||
|
const cpusString = fs.readFileSync(cpusFile, "utf-8");
|
||||||
|
for (const token of cpusString.split(",")) {
|
||||||
|
if (!token.includes("-")) {
|
||||||
|
// Not a range
|
||||||
|
++cpuCount;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const cpuStartIndex = parseInt(token.split("-")[0]);
|
||||||
|
const cpuEndIndex = parseInt(token.split("-")[1]);
|
||||||
|
cpuCount += cpuEndIndex - cpuStartIndex + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.info(`While resolving threads, found a cgroup CPUs file with ${cpuCount} CPUs in ${cpusFile}.`);
|
||||||
|
return cpuCount;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Get the codeql `--threads` flag specified for the `threads` input.
|
* Get the codeql `--threads` flag specified for the `threads` input.
|
||||||
* If no value was specified, all available threads will be used.
|
* If no value was specified, all available threads will be used.
|
||||||
@@ -299,14 +360,14 @@ function parseGitHubUrl(inputUrl) {
|
|||||||
inputUrl = `https://${inputUrl}`;
|
inputUrl = `https://${inputUrl}`;
|
||||||
}
|
}
|
||||||
if (!inputUrl.startsWith("http://") && !inputUrl.startsWith("https://")) {
|
if (!inputUrl.startsWith("http://") && !inputUrl.startsWith("https://")) {
|
||||||
throw new UserError(`"${originalUrl}" is not a http or https URL`);
|
throw new ConfigurationError(`"${originalUrl}" is not a http or https URL`);
|
||||||
}
|
}
|
||||||
let url;
|
let url;
|
||||||
try {
|
try {
|
||||||
url = new URL(inputUrl);
|
url = new URL(inputUrl);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
throw new UserError(`"${originalUrl}" is not a valid URL`);
|
throw new ConfigurationError(`"${originalUrl}" is not a valid URL`);
|
||||||
}
|
}
|
||||||
// If we detect this is trying to be to github.com
|
// If we detect this is trying to be to github.com
|
||||||
// then return with a fixed canonical URL.
|
// then return with a fixed canonical URL.
|
||||||
@@ -417,12 +478,12 @@ exports.HTTPError = HTTPError;
|
|||||||
* An Error class that indicates an error that occurred due to
|
* An Error class that indicates an error that occurred due to
|
||||||
* a misconfiguration of the action or the CodeQL CLI.
|
* a misconfiguration of the action or the CodeQL CLI.
|
||||||
*/
|
*/
|
||||||
class UserError extends Error {
|
class ConfigurationError extends Error {
|
||||||
constructor(message) {
|
constructor(message) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.UserError = UserError;
|
exports.ConfigurationError = ConfigurationError;
|
||||||
function isHTTPError(arg) {
|
function isHTTPError(arg) {
|
||||||
return arg?.status !== undefined && Number.isInteger(arg.status);
|
return arg?.status !== undefined && Number.isInteger(arg.status);
|
||||||
}
|
}
|
||||||
@@ -728,27 +789,35 @@ function prettyPrintPack(pack) {
|
|||||||
}
|
}
|
||||||
exports.prettyPrintPack = prettyPrintPack;
|
exports.prettyPrintPack = prettyPrintPack;
|
||||||
async function checkDiskUsage(logger) {
|
async function checkDiskUsage(logger) {
|
||||||
const diskUsage = await (0, check_disk_space_1.default)(getRequiredEnvParam("GITHUB_WORKSPACE"));
|
try {
|
||||||
const gbInBytes = 1024 * 1024 * 1024;
|
const diskUsage = await (0, check_disk_space_1.default)(getRequiredEnvParam("GITHUB_WORKSPACE"));
|
||||||
if (logger && diskUsage.free < 2 * gbInBytes) {
|
const gbInBytes = 1024 * 1024 * 1024;
|
||||||
const message = "The Actions runner is running low on disk space " +
|
if (logger && diskUsage.free < 2 * gbInBytes) {
|
||||||
`(${(diskUsage.free / gbInBytes).toPrecision(4)} GB available).`;
|
const message = "The Actions runner is running low on disk space " +
|
||||||
if (process.env[environment_1.EnvVar.HAS_WARNED_ABOUT_DISK_SPACE] !== "true") {
|
`(${(diskUsage.free / gbInBytes).toPrecision(4)} GB available).`;
|
||||||
logger.warning(message);
|
if (process.env[environment_1.EnvVar.HAS_WARNED_ABOUT_DISK_SPACE] !== "true") {
|
||||||
|
logger.warning(message);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
logger.debug(message);
|
||||||
|
}
|
||||||
|
core.exportVariable(environment_1.EnvVar.HAS_WARNED_ABOUT_DISK_SPACE, "true");
|
||||||
}
|
}
|
||||||
else {
|
return {
|
||||||
logger.debug(message);
|
numAvailableBytes: diskUsage.free,
|
||||||
}
|
numTotalBytes: diskUsage.size,
|
||||||
core.exportVariable(environment_1.EnvVar.HAS_WARNED_ABOUT_DISK_SPACE, "true");
|
};
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
if (logger) {
|
||||||
|
logger.warning(`Failed to check available disk space: ${getErrorMessage(error)}`);
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
return {
|
|
||||||
numAvailableBytes: diskUsage.free,
|
|
||||||
numTotalBytes: diskUsage.size,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
exports.checkDiskUsage = checkDiskUsage;
|
exports.checkDiskUsage = checkDiskUsage;
|
||||||
/**
|
/**
|
||||||
* Prompt the customer to upgrade to CodeQL Action v2, if appropriate.
|
* Prompt the customer to upgrade to CodeQL Action v3, if appropriate.
|
||||||
*
|
*
|
||||||
* Check whether a customer is running v2. If they are, and we can determine that the GitHub
|
* Check whether a customer is running v2. If they are, and we can determine that the GitHub
|
||||||
* instance supports v3, then log a warning about v2's upcoming deprecation prompting the customer
|
* instance supports v3, then log a warning about v2's upcoming deprecation prompting the customer
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
116
node_modules/.package-lock.json
generated
vendored
116
node_modules/.package-lock.json
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "codeql",
|
"name": "codeql",
|
||||||
"version": "2.23.1",
|
"version": "2.24.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
@@ -25,9 +25,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/cache": {
|
"node_modules/@actions/cache": {
|
||||||
"version": "3.2.3",
|
"version": "3.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.4.tgz",
|
||||||
"integrity": "sha512-m8KvmcD+JxSLOfNUXuBF2jL0Lp+co/Fhbf0NTt0M9lz61WnXRdqpIGrOvTRZmKIl+7HaHil6kGE3fkEfrKQCQA==",
|
"integrity": "sha512-RuHnwfcDagtX+37s0ZWy7clbOfnZ7AlDJQ7k/9rzt2W4Gnwde3fa/qjSjVuz4vLcLIpc7fUob27CMrqiWZytYA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.1",
|
||||||
@@ -923,9 +923,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/semver": {
|
"node_modules/@types/semver": {
|
||||||
"version": "7.5.6",
|
"version": "7.5.7",
|
||||||
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.7.tgz",
|
||||||
"integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==",
|
"integrity": "sha512-/wdoPq1QqkSj9/QOeKkFquEuPzQbHTWAMPH/PaUMB+JuR31lXhlWXRZ52IpfDYVlDOUBvX09uBrPwxGT1hjNBg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/sinon": {
|
"node_modules/@types/sinon": {
|
||||||
@@ -952,21 +952,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/uuid": {
|
"node_modules/@types/uuid": {
|
||||||
"version": "9.0.7",
|
"version": "9.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz",
|
||||||
"integrity": "sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g=="
|
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||||
"version": "6.19.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz",
|
||||||
"integrity": "sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==",
|
"integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/regexpp": "^4.5.1",
|
"@eslint-community/regexpp": "^4.5.1",
|
||||||
"@typescript-eslint/scope-manager": "6.19.0",
|
"@typescript-eslint/scope-manager": "6.21.0",
|
||||||
"@typescript-eslint/type-utils": "6.19.0",
|
"@typescript-eslint/type-utils": "6.21.0",
|
||||||
"@typescript-eslint/utils": "6.19.0",
|
"@typescript-eslint/utils": "6.21.0",
|
||||||
"@typescript-eslint/visitor-keys": "6.19.0",
|
"@typescript-eslint/visitor-keys": "6.21.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"graphemer": "^1.4.0",
|
"graphemer": "^1.4.0",
|
||||||
"ignore": "^5.2.4",
|
"ignore": "^5.2.4",
|
||||||
@@ -992,15 +992,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser": {
|
"node_modules/@typescript-eslint/parser": {
|
||||||
"version": "6.19.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz",
|
||||||
"integrity": "sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==",
|
"integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "6.19.0",
|
"@typescript-eslint/scope-manager": "6.21.0",
|
||||||
"@typescript-eslint/types": "6.19.0",
|
"@typescript-eslint/types": "6.21.0",
|
||||||
"@typescript-eslint/typescript-estree": "6.19.0",
|
"@typescript-eslint/typescript-estree": "6.21.0",
|
||||||
"@typescript-eslint/visitor-keys": "6.19.0",
|
"@typescript-eslint/visitor-keys": "6.21.0",
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1020,13 +1020,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/scope-manager": {
|
"node_modules/@typescript-eslint/scope-manager": {
|
||||||
"version": "6.19.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz",
|
||||||
"integrity": "sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==",
|
"integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "6.19.0",
|
"@typescript-eslint/types": "6.21.0",
|
||||||
"@typescript-eslint/visitor-keys": "6.19.0"
|
"@typescript-eslint/visitor-keys": "6.21.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^16.0.0 || >=18.0.0"
|
"node": "^16.0.0 || >=18.0.0"
|
||||||
@@ -1037,13 +1037,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/type-utils": {
|
"node_modules/@typescript-eslint/type-utils": {
|
||||||
"version": "6.19.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz",
|
||||||
"integrity": "sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==",
|
"integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/typescript-estree": "6.19.0",
|
"@typescript-eslint/typescript-estree": "6.21.0",
|
||||||
"@typescript-eslint/utils": "6.19.0",
|
"@typescript-eslint/utils": "6.21.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"ts-api-utils": "^1.0.1"
|
"ts-api-utils": "^1.0.1"
|
||||||
},
|
},
|
||||||
@@ -1064,9 +1064,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/types": {
|
"node_modules/@typescript-eslint/types": {
|
||||||
"version": "6.19.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz",
|
||||||
"integrity": "sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==",
|
"integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^16.0.0 || >=18.0.0"
|
"node": "^16.0.0 || >=18.0.0"
|
||||||
@@ -1077,13 +1077,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree": {
|
"node_modules/@typescript-eslint/typescript-estree": {
|
||||||
"version": "6.19.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz",
|
||||||
"integrity": "sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==",
|
"integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "6.19.0",
|
"@typescript-eslint/types": "6.21.0",
|
||||||
"@typescript-eslint/visitor-keys": "6.19.0",
|
"@typescript-eslint/visitor-keys": "6.21.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"globby": "^11.1.0",
|
"globby": "^11.1.0",
|
||||||
"is-glob": "^4.0.3",
|
"is-glob": "^4.0.3",
|
||||||
@@ -1129,17 +1129,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/utils": {
|
"node_modules/@typescript-eslint/utils": {
|
||||||
"version": "6.19.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz",
|
||||||
"integrity": "sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==",
|
"integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.4.0",
|
"@eslint-community/eslint-utils": "^4.4.0",
|
||||||
"@types/json-schema": "^7.0.12",
|
"@types/json-schema": "^7.0.12",
|
||||||
"@types/semver": "^7.5.0",
|
"@types/semver": "^7.5.0",
|
||||||
"@typescript-eslint/scope-manager": "6.19.0",
|
"@typescript-eslint/scope-manager": "6.21.0",
|
||||||
"@typescript-eslint/types": "6.19.0",
|
"@typescript-eslint/types": "6.21.0",
|
||||||
"@typescript-eslint/typescript-estree": "6.19.0",
|
"@typescript-eslint/typescript-estree": "6.21.0",
|
||||||
"semver": "^7.5.4"
|
"semver": "^7.5.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1154,12 +1154,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/visitor-keys": {
|
"node_modules/@typescript-eslint/visitor-keys": {
|
||||||
"version": "6.19.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz",
|
||||||
"integrity": "sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==",
|
"integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "6.19.0",
|
"@typescript-eslint/types": "6.21.0",
|
||||||
"eslint-visitor-keys": "^3.4.1"
|
"eslint-visitor-keys": "^3.4.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -4561,9 +4561,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/nock": {
|
"node_modules/nock": {
|
||||||
"version": "13.5.0",
|
"version": "13.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/nock/-/nock-13.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/nock/-/nock-13.5.1.tgz",
|
||||||
"integrity": "sha512-9hc1eCS2HtOz+sE9W7JQw/tXJktg0zoPSu48s/pYe73e25JW9ywiowbqnUSd7iZPeVawLcVpPZeZS312fwSY+g==",
|
"integrity": "sha512-+s7b73fzj5KnxbKH4Oaqz07tQ8degcMilU4rrmnKvI//b0JMBU4wEXFQ8zqr+3+L4eWSfU3H/UoIVGUV0tue1Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^4.1.0",
|
"debug": "^4.1.0",
|
||||||
@@ -5436,9 +5436,9 @@
|
|||||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||||
},
|
},
|
||||||
"node_modules/semver": {
|
"node_modules/semver": {
|
||||||
"version": "7.5.4",
|
"version": "7.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
|
||||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
"integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lru-cache": "^6.0.0"
|
"lru-cache": "^6.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
5
node_modules/@actions/cache/lib/internal/cacheUtils.js
generated
vendored
5
node_modules/@actions/cache/lib/internal/cacheUtils.js
generated
vendored
@@ -189,7 +189,10 @@ function assertDefined(name, value) {
|
|||||||
exports.assertDefined = assertDefined;
|
exports.assertDefined = assertDefined;
|
||||||
function isGhes() {
|
function isGhes() {
|
||||||
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
|
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
|
||||||
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
|
const hostname = ghUrl.hostname.trimEnd().toUpperCase();
|
||||||
|
const isGitHubHost = hostname === 'GITHUB.COM';
|
||||||
|
const isGheHost = hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST');
|
||||||
|
return !isGitHubHost && !isGheHost;
|
||||||
}
|
}
|
||||||
exports.isGhes = isGhes;
|
exports.isGhes = isGhes;
|
||||||
//# sourceMappingURL=cacheUtils.js.map
|
//# sourceMappingURL=cacheUtils.js.map
|
||||||
2
node_modules/@actions/cache/lib/internal/cacheUtils.js.map
generated
vendored
2
node_modules/@actions/cache/lib/internal/cacheUtils.js.map
generated
vendored
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"cacheUtils.js","sourceRoot":"","sources":["../../src/internal/cacheUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAqC;AACrC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KACxD;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAND,sCAMC;AAED,SAAgB,MAAM;IACpB,MAAM,KAAK,GAAG,IAAI,GAAG,CACnB,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,oBAAoB,CACzD,CAAA;IAED,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,CAAA;IACvD,MAAM,YAAY,GAAG,QAAQ,KAAK,YAAY,CAAA;IAC9C,MAAM,SAAS,GACb,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAA;IAEtE,OAAO,CAAC,YAAY,IAAI,CAAC,SAAS,CAAA;AACpC,CAAC;AAXD,wBAWC"}
|
||||||
2
node_modules/@actions/cache/package.json
generated
vendored
2
node_modules/@actions/cache/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/cache",
|
"name": "@actions/cache",
|
||||||
"version": "3.2.3",
|
"version": "3.2.4",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"description": "Actions cache lib",
|
"description": "Actions cache lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
2
node_modules/@types/semver/README.md
generated
vendored
2
node_modules/@types/semver/README.md
generated
vendored
@@ -8,7 +8,7 @@ This package contains type definitions for semver (https://github.com/npm/node-s
|
|||||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/semver.
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/semver.
|
||||||
|
|
||||||
### Additional Details
|
### Additional Details
|
||||||
* Last updated: Mon, 20 Nov 2023 23:36:24 GMT
|
* Last updated: Sun, 11 Feb 2024 14:35:16 GMT
|
||||||
* Dependencies: none
|
* Dependencies: none
|
||||||
|
|
||||||
# Credits
|
# Credits
|
||||||
|
|||||||
2
node_modules/@types/semver/classes/semver.d.ts
generated
vendored
2
node_modules/@types/semver/classes/semver.d.ts
generated
vendored
@@ -57,6 +57,8 @@ declare class SemVer {
|
|||||||
compareBuild(other: string | SemVer): 1 | 0 | -1;
|
compareBuild(other: string | SemVer): 1 | 0 | -1;
|
||||||
|
|
||||||
inc(release: semver.ReleaseType, identifier?: string): SemVer;
|
inc(release: semver.ReleaseType, identifier?: string): SemVer;
|
||||||
|
|
||||||
|
toString(): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export = SemVer;
|
export = SemVer;
|
||||||
|
|||||||
6
node_modules/@types/semver/package.json
generated
vendored
6
node_modules/@types/semver/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@types/semver",
|
"name": "@types/semver",
|
||||||
"version": "7.5.6",
|
"version": "7.5.7",
|
||||||
"description": "TypeScript definitions for semver",
|
"description": "TypeScript definitions for semver",
|
||||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/semver",
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/semver",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -45,6 +45,6 @@
|
|||||||
},
|
},
|
||||||
"scripts": {},
|
"scripts": {},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"typesPublisherContentHash": "514fe51677a803481dc4a7c81866abc13c1ba8759d86ef517f2416e25a3d0b64",
|
"typesPublisherContentHash": "7c7ea7462a324ee8deea0da7362589ed48c4d8ade91fa5078d1f647af570c15e",
|
||||||
"typeScriptVersion": "4.5"
|
"typeScriptVersion": "4.6"
|
||||||
}
|
}
|
||||||
2
node_modules/@types/uuid/README.md
generated
vendored
2
node_modules/@types/uuid/README.md
generated
vendored
@@ -8,7 +8,7 @@ This package contains type definitions for uuid (https://github.com/uuidjs/uuid)
|
|||||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uuid.
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uuid.
|
||||||
|
|
||||||
### Additional Details
|
### Additional Details
|
||||||
* Last updated: Tue, 07 Nov 2023 20:08:00 GMT
|
* Last updated: Thu, 25 Jan 2024 23:07:19 GMT
|
||||||
* Dependencies: none
|
* Dependencies: none
|
||||||
|
|
||||||
# Credits
|
# Credits
|
||||||
|
|||||||
2
node_modules/@types/uuid/index.d.mts
generated
vendored
2
node_modules/@types/uuid/index.d.mts
generated
vendored
@@ -8,3 +8,5 @@ export import version = uuid.version;
|
|||||||
export import validate = uuid.validate;
|
export import validate = uuid.validate;
|
||||||
export import stringify = uuid.stringify;
|
export import stringify = uuid.stringify;
|
||||||
export import parse = uuid.parse;
|
export import parse = uuid.parse;
|
||||||
|
export import V1Options = uuid.V1Options;
|
||||||
|
export import V4Options = uuid.V4Options;
|
||||||
|
|||||||
6
node_modules/@types/uuid/package.json
generated
vendored
6
node_modules/@types/uuid/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@types/uuid",
|
"name": "@types/uuid",
|
||||||
"version": "9.0.7",
|
"version": "9.0.8",
|
||||||
"description": "TypeScript definitions for uuid",
|
"description": "TypeScript definitions for uuid",
|
||||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uuid",
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uuid",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -49,6 +49,6 @@
|
|||||||
},
|
},
|
||||||
"scripts": {},
|
"scripts": {},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"typesPublisherContentHash": "71fc550147b942c5824c8f2b1b9d6788b5342357a90b8f7d76e60260d05180c0",
|
"typesPublisherContentHash": "ee6ba7ad17fbbead7a508faf213a9ad0f49c12929e8c6b0f05fb35129bc72d61",
|
||||||
"typeScriptVersion": "4.5"
|
"typeScriptVersion": "4.6"
|
||||||
}
|
}
|
||||||
1
node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js
generated
vendored
1
node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js
generated
vendored
@@ -119,6 +119,7 @@ module.exports = {
|
|||||||
'prefer-destructuring': 'off',
|
'prefer-destructuring': 'off',
|
||||||
'@typescript-eslint/prefer-destructuring': 'error',
|
'@typescript-eslint/prefer-destructuring': 'error',
|
||||||
'@typescript-eslint/prefer-enum-initializers': 'error',
|
'@typescript-eslint/prefer-enum-initializers': 'error',
|
||||||
|
'@typescript-eslint/prefer-find': 'error',
|
||||||
'@typescript-eslint/prefer-for-of': 'error',
|
'@typescript-eslint/prefer-for-of': 'error',
|
||||||
'@typescript-eslint/prefer-function-type': 'error',
|
'@typescript-eslint/prefer-function-type': 'error',
|
||||||
'@typescript-eslint/prefer-includes': 'error',
|
'@typescript-eslint/prefer-includes': 'error',
|
||||||
|
|||||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js.map
generated
vendored
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"all.js","sourceRoot":"","sources":["../../src/configs/all.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,mDAAmD;AACnD,EAAE;AACF,4DAA4D;AAC5D,sDAAsD;AAEtD,iBAAS;IACP,OAAO,EAAE,CAAC,gBAAgB,EAAE,8BAA8B,CAAC;IAC3D,KAAK,EAAE;QACL,iDAAiD,EAAE,OAAO;QAC1D,+BAA+B,EAAE,OAAO;QACxC,mCAAmC,EAAE,OAAO;QAC5C,mCAAmC,EAAE,OAAO;QAC5C,uCAAuC,EAAE,OAAO;QAChD,8BAA8B,EAAE,OAAO;QACvC,iDAAiD,EAAE,OAAO;QAC1D,wBAAwB,EAAE,KAAK;QAC/B,2CAA2C,EAAE,OAAO;QACpD,oDAAoD,EAAE,OAAO;QAC7D,oDAAoD,EAAE,OAAO;QAC7D,+CAA+C,EAAE,OAAO;QACxD,gDAAgD,EA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OAAO;QAC1C,2CAA2C,EAAE,OAAO;QACpD,+CAA+C,EAAE,OAAO;QACxD,gDAAgD,EAAE,OAAO;QACzD,2CAA2C,EAAE,OAAO;QACpD,4BAA4B,EAAE,OAAO;QACrC,mCAAmC,EAAE,OAAO;QAC5C,uCAAuC,EAAE,OAAO;KACjD;CAC6B,CAAC"}
|
||||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js.map
generated
vendored
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,mDAAmD;AACnD,EAAE;AACF,4DAA4D;AAC5D,sDAAsD;AAEtD,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;IACvC,OAAO,EAAE,CAAC,oBAAoB,CAAC;CAChC,CAAC"}
|
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,mDAAmD;AACnD,EAAE;AACF,4DAA4D;AAC5D,sDAAsD;AAItD,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;IACvC,OAAO,EAAE,CAAC,oBAAoB,CAAC;CACD,CAAC"}
|
||||||
1
node_modules/@typescript-eslint/eslint-plugin/dist/configs/disable-type-checked.js
generated
vendored
1
node_modules/@typescript-eslint/eslint-plugin/dist/configs/disable-type-checked.js
generated
vendored
@@ -39,6 +39,7 @@ module.exports = {
|
|||||||
'@typescript-eslint/no-useless-template-literals': 'off',
|
'@typescript-eslint/no-useless-template-literals': 'off',
|
||||||
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
|
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
|
||||||
'@typescript-eslint/prefer-destructuring': 'off',
|
'@typescript-eslint/prefer-destructuring': 'off',
|
||||||
|
'@typescript-eslint/prefer-find': 'off',
|
||||||
'@typescript-eslint/prefer-includes': 'off',
|
'@typescript-eslint/prefer-includes': 'off',
|
||||||
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
||||||
'@typescript-eslint/prefer-optional-chain': 'off',
|
'@typescript-eslint/prefer-optional-chain': 'off',
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user