mirror of
https://github.com/github/codeql-action.git
synced 2025-12-11 02:04:31 +08:00
Compare commits
168 Commits
v3.27.2
...
codeql-bun
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3407610120 | ||
|
|
5bf0e05e7b | ||
|
|
ea41240bed | ||
|
|
0a7d6c210b | ||
|
|
1e7001479f | ||
|
|
5b6e617dc0 | ||
|
|
adc78ec946 | ||
|
|
d43af810ec | ||
|
|
dd5146d090 | ||
|
|
3239a39f73 | ||
|
|
78760076e3 | ||
|
|
985eb4f8f2 | ||
|
|
2012e4b9c6 | ||
|
|
48ab28a6f5 | ||
|
|
4946b765de | ||
|
|
d01b25e645 | ||
|
|
7d6d36ce5f | ||
|
|
b58f4471c8 | ||
|
|
64cc90bcd4 | ||
|
|
d8f8eca6c5 | ||
|
|
562042d742 | ||
|
|
beed6ff2e9 | ||
|
|
5f0a4d3e67 | ||
|
|
34cb19c91b | ||
|
|
5fc1bccccc | ||
|
|
9d599696ef | ||
|
|
38fd34c412 | ||
|
|
0de662d785 | ||
|
|
5a8fab3748 | ||
|
|
04cce6be94 | ||
|
|
706ef5896a | ||
|
|
62192f8dab | ||
|
|
dd75594246 | ||
|
|
ac43a2e599 | ||
|
|
48fe0d8fb1 | ||
|
|
df409f7d92 | ||
|
|
feca44ddf6 | ||
|
|
7972a42f3d | ||
|
|
44bf16d3a1 | ||
|
|
f124ad0e7e | ||
|
|
92753708cf | ||
|
|
a059a7a0ee | ||
|
|
8a93837afd | ||
|
|
90a270091b | ||
|
|
9cfbef4bda | ||
|
|
9a8645df7a | ||
|
|
78d0136ff7 | ||
|
|
c4bbe15558 | ||
|
|
47dd68ef62 | ||
|
|
849b60e504 | ||
|
|
f327a84ce5 | ||
|
|
1e5b59114b | ||
|
|
9e8cd42adc | ||
|
|
88bcf64e02 | ||
|
|
932369573c | ||
|
|
4d64ab66ad | ||
|
|
c6454d58c8 | ||
|
|
300d251cd6 | ||
|
|
b2c41ecd38 | ||
|
|
b0cd76b9fb | ||
|
|
dfed55caa4 | ||
|
|
417bb84fbc | ||
|
|
18cf30d984 | ||
|
|
9fd5c24857 | ||
|
|
babb554ede | ||
|
|
0a5a1c0d75 | ||
|
|
4c20d4f58a | ||
|
|
51e71f81a0 | ||
|
|
3951a82275 | ||
|
|
f9b0c1f2ea | ||
|
|
57a28594b9 | ||
|
|
3e10d3452b | ||
|
|
dd4aa40016 | ||
|
|
70aac4e018 | ||
|
|
c901aeec28 | ||
|
|
89757925c7 | ||
|
|
d853bec339 | ||
|
|
aab34601c1 | ||
|
|
0d3e640d0c | ||
|
|
b13515409a | ||
|
|
a89fbc80a2 | ||
|
|
3d09005851 | ||
|
|
8ba1205033 | ||
|
|
182c5e787f | ||
|
|
6f9e628e6f | ||
|
|
b706e37699 | ||
|
|
b4bc093eca | ||
|
|
9c48c8bf18 | ||
|
|
0bb80075c0 | ||
|
|
25488cc9b0 | ||
|
|
87548a27e8 | ||
|
|
78be2f1333 | ||
|
|
8f2cb3a931 | ||
|
|
0dc76a996d | ||
|
|
3096afedf9 | ||
|
|
5d7e6289af | ||
|
|
4a7b2d6c90 | ||
|
|
978ed829bd | ||
|
|
9922856ac1 | ||
|
|
f1c289a551 | ||
|
|
44e03577b2 | ||
|
|
5261a1223f | ||
|
|
49f7b34c3d | ||
|
|
7bcf845de9 | ||
|
|
93f3303766 | ||
|
|
b2a4442810 | ||
|
|
d5bcf48469 | ||
|
|
d57328a17b | ||
|
|
f8ccf38bb2 | ||
|
|
8c0517fff8 | ||
|
|
0b2048550c | ||
|
|
ef2fd42bcf | ||
|
|
fb1b8e22d9 | ||
|
|
a1a5527927 | ||
|
|
aa57810251 | ||
|
|
34e77b772d | ||
|
|
028cece17f | ||
|
|
198fb4b4b2 | ||
|
|
6695503422 | ||
|
|
be26fe61b5 | ||
|
|
af49565b85 | ||
|
|
5659f01a9c | ||
|
|
5333ff3db7 | ||
|
|
e4fb28de52 | ||
|
|
3d3d628990 | ||
|
|
2eea97e7b9 | ||
|
|
f8e782af56 | ||
|
|
49b7c9791d | ||
|
|
743a855bb8 | ||
|
|
f09c1c0a94 | ||
|
|
40daece232 | ||
|
|
67b73eaba5 | ||
|
|
a6c8729a5d | ||
|
|
8f3b48727f | ||
|
|
cba5fb58d4 | ||
|
|
e782c3a145 | ||
|
|
db6788195b | ||
|
|
ecde4d232d | ||
|
|
e3c67a01d3 | ||
|
|
f9ada54538 | ||
|
|
9222a972b5 | ||
|
|
b500b62cea | ||
|
|
946526174b | ||
|
|
43b75f7d9e | ||
|
|
a1695c562b | ||
|
|
1443ef52d1 | ||
|
|
49ec97c6f7 | ||
|
|
69656af4fe | ||
|
|
ea9e4e3799 | ||
|
|
845ea9230b | ||
|
|
3ab67a2193 | ||
|
|
58f2dfcb47 | ||
|
|
6e3a010dfe | ||
|
|
1c83cd1292 | ||
|
|
024283fcc9 | ||
|
|
613fe96926 | ||
|
|
e35d4aa1da | ||
|
|
396bb3e453 | ||
|
|
2b1319450a | ||
|
|
f047903675 | ||
|
|
427ce4600e | ||
|
|
5445a29a97 | ||
|
|
e6dd4048e9 | ||
|
|
7bc6222c12 | ||
|
|
b0c0aadc56 | ||
|
|
5cb4249dc7 | ||
|
|
a4ee280ec9 | ||
|
|
9a25759866 |
2
.github/workflows/__config-export.yml
generated
vendored
2
.github/workflows/__config-export.yml
generated
vendored
@@ -70,7 +70,7 @@ jobs:
|
|||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
upload-database: false
|
upload-database: false
|
||||||
- name: Upload SARIF
|
- name: Upload SARIF
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
path: ${{ runner.temp }}/results/javascript.sarif
|
||||||
|
|||||||
2
.github/workflows/__diagnostics-export.yml
generated
vendored
2
.github/workflows/__diagnostics-export.yml
generated
vendored
@@ -82,7 +82,7 @@ jobs:
|
|||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
upload-database: false
|
upload-database: false
|
||||||
- name: Upload SARIF
|
- name: Upload SARIF
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
path: ${{ runner.temp }}/results/javascript.sarif
|
||||||
|
|||||||
2
.github/workflows/__export-file-baseline-information.yml
generated
vendored
2
.github/workflows/__export-file-baseline-information.yml
generated
vendored
@@ -70,7 +70,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
- name: Upload SARIF
|
- name: Upload SARIF
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: with-baseline-information-${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
name: with-baseline-information-${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
path: ${{ runner.temp }}/results/javascript.sarif
|
||||||
|
|||||||
101
.github/workflows/__extract-direct-to-toolcache.yml
generated
vendored
Normal file
101
.github/workflows/__extract-direct-to-toolcache.yml
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
# 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 - Extract directly to toolcache
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- releases/v*
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
schedule:
|
||||||
|
- cron: '0 5 * * *'
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
extract-direct-to-toolcache:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: macos-latest
|
||||||
|
version: linked
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: linked
|
||||||
|
- os: windows-latest
|
||||||
|
version: linked
|
||||||
|
name: Extract directly to toolcache
|
||||||
|
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: runner.os == 'macOS' && 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'
|
||||||
|
setup-kotlin: 'true'
|
||||||
|
- name: Remove CodeQL from toolcache
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
|
||||||
|
fs.rmdirSync(codeqlPath, { recursive: true });
|
||||||
|
- name: Install @actions/tool-cache
|
||||||
|
run: npm install @actions/tool-cache
|
||||||
|
- name: Check toolcache does not contain CodeQL
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const toolcache = require('@actions/tool-cache');
|
||||||
|
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
|
||||||
|
if (allCodeqlVersions.length !== 0) {
|
||||||
|
throw new Error(`CodeQL should not be found in the toolcache, but found ${allCodeqlVersions}`);
|
||||||
|
}
|
||||||
|
console.log('No versions of CodeQL found in the toolcache');
|
||||||
|
- id: init
|
||||||
|
uses: ./../action/init
|
||||||
|
with:
|
||||||
|
languages: javascript
|
||||||
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
- uses: ./../action/analyze
|
||||||
|
with:
|
||||||
|
output: ${{ runner.temp }}/results
|
||||||
|
upload-database: false
|
||||||
|
- name: Check CodeQL is installed within the toolcache
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const toolcache = require('@actions/tool-cache');
|
||||||
|
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
|
||||||
|
console.log(`Found CodeQL versions: ${allCodeqlVersions}`);
|
||||||
|
if (allCodeqlVersions.length === 0) {
|
||||||
|
throw new Error('CodeQL not found in toolcache');
|
||||||
|
}
|
||||||
|
if (allCodeqlVersions.length > 1) {
|
||||||
|
throw new Error('Multiple CodeQL versions found in toolcache');
|
||||||
|
}
|
||||||
|
env:
|
||||||
|
CODEQL_ACTION_EXTRACT_TOOLCACHE: true
|
||||||
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
2
.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml
generated
vendored
2
.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml
generated
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.14.6
|
version: default
|
||||||
name: 'Go: diagnostic when Go is changed after init step'
|
name: 'Go: diagnostic when Go is changed after init step'
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
2
.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml
generated
vendored
2
.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml
generated
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.14.6
|
version: default
|
||||||
name: 'Go: diagnostic when `file` is not installed'
|
name: 'Go: diagnostic when `file` is not installed'
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
2
.github/workflows/__go-indirect-tracing-workaround.yml
generated
vendored
2
.github/workflows/__go-indirect-tracing-workaround.yml
generated
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.14.6
|
version: default
|
||||||
name: 'Go: workaround for indirect tracing'
|
name: 'Go: workaround for indirect tracing'
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
8
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
8
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
@@ -27,10 +27,6 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.14.6
|
|
||||||
- os: macos-13
|
|
||||||
version: stable-v2.14.6
|
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.15.5
|
version: stable-v2.15.5
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
@@ -47,6 +43,10 @@ jobs:
|
|||||||
version: stable-v2.18.4
|
version: stable-v2.18.4
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
version: stable-v2.18.4
|
version: stable-v2.18.4
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: stable-v2.19.4
|
||||||
|
- os: macos-latest
|
||||||
|
version: stable-v2.19.4
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: default
|
version: default
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
|
|||||||
8
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
8
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
@@ -27,10 +27,6 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.14.6
|
|
||||||
- os: macos-13
|
|
||||||
version: stable-v2.14.6
|
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.15.5
|
version: stable-v2.15.5
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
@@ -47,6 +43,10 @@ jobs:
|
|||||||
version: stable-v2.18.4
|
version: stable-v2.18.4
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
version: stable-v2.18.4
|
version: stable-v2.18.4
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: stable-v2.19.4
|
||||||
|
- os: macos-latest
|
||||||
|
version: stable-v2.19.4
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: default
|
version: default
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
|
|||||||
8
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
8
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
@@ -27,10 +27,6 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.14.6
|
|
||||||
- os: macos-13
|
|
||||||
version: stable-v2.14.6
|
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.15.5
|
version: stable-v2.15.5
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
@@ -47,6 +43,10 @@ jobs:
|
|||||||
version: stable-v2.18.4
|
version: stable-v2.18.4
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
version: stable-v2.18.4
|
version: stable-v2.18.4
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: stable-v2.19.4
|
||||||
|
- os: macos-latest
|
||||||
|
version: stable-v2.19.4
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: default
|
version: default
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
|
|||||||
2
.github/workflows/__job-run-uuid-sarif.yml
generated
vendored
2
.github/workflows/__job-run-uuid-sarif.yml
generated
vendored
@@ -59,7 +59,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
- name: Upload SARIF
|
- name: Upload SARIF
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
path: ${{ runner.temp }}/results/javascript.sarif
|
||||||
|
|||||||
20
.github/workflows/__multi-language-autodetect.yml
generated
vendored
20
.github/workflows/__multi-language-autodetect.yml
generated
vendored
@@ -27,10 +27,6 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: macos-13
|
|
||||||
version: stable-v2.14.6
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.14.6
|
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
version: stable-v2.15.5
|
version: stable-v2.15.5
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
@@ -47,6 +43,10 @@ jobs:
|
|||||||
version: stable-v2.18.4
|
version: stable-v2.18.4
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: stable-v2.18.4
|
version: stable-v2.18.4
|
||||||
|
- os: macos-latest
|
||||||
|
version: stable-v2.19.4
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: stable-v2.19.4
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
version: default
|
version: default
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
@@ -88,15 +88,12 @@ jobs:
|
|||||||
id: init
|
id: init
|
||||||
with:
|
with:
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
db-location: ${{ runner.temp }}/customDbLocation
|
||||||
# Swift is not supported on Ubuntu or codeql 2.14 so we manually exclude it from the list here
|
languages: ${{ runner.os == 'Linux' && 'cpp,csharp,go,java,javascript,python,ruby'
|
||||||
languages: ${{ (runner.os == 'Linux' || (runner.os == 'macOS' && matrix.version
|
|| '' }}
|
||||||
== 'stable-v2.14.6')) && 'cpp,csharp,go,java,javascript,python,ruby' ||
|
|
||||||
'' }}
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
|
||||||
- uses: ./../action/.github/actions/setup-swift
|
- uses: ./../action/.github/actions/setup-swift
|
||||||
# Exclude macos on v2.14.6 since we can not longer run swift on ARM runners
|
if: runner.os == 'macOS'
|
||||||
if: runner.os == 'macOS' && matrix.version != 'stable-v2.14.6'
|
|
||||||
with:
|
with:
|
||||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||||
|
|
||||||
@@ -149,8 +146,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check language autodetect for Swift on macOS
|
- name: Check language autodetect for Swift on macOS
|
||||||
# Exclude macos on v2.14.6 since we can not longer run swift on ARM runners
|
if: runner.os == 'macOS'
|
||||||
if: runner.os == 'macOS' && matrix.version != 'stable-v2.14.6'
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
|
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
|
||||||
|
|||||||
80
.github/workflows/__start-proxy.yml
generated
vendored
Normal file
80
.github/workflows/__start-proxy.yml
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
# 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 - Start proxy
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- releases/v*
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
schedule:
|
||||||
|
- cron: '0 5 * * *'
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
start-proxy:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: linked
|
||||||
|
- os: macos-latest
|
||||||
|
version: linked
|
||||||
|
- os: windows-latest
|
||||||
|
version: linked
|
||||||
|
name: Start proxy
|
||||||
|
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: runner.os == 'macOS' && 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'
|
||||||
|
setup-kotlin: 'true'
|
||||||
|
- uses: ./../action/init
|
||||||
|
with:
|
||||||
|
languages: csharp
|
||||||
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
|
||||||
|
- name: Setup proxy for registries
|
||||||
|
id: proxy
|
||||||
|
uses: ./../action/start-proxy
|
||||||
|
with:
|
||||||
|
registry_secrets: '[{ "type": "nuget_feed", "url": "https://api.nuget.org/v3/index.json"
|
||||||
|
}]'
|
||||||
|
|
||||||
|
- name: Print proxy outputs
|
||||||
|
run: |
|
||||||
|
echo "${{ steps.proxy.outputs.proxy_host }}"
|
||||||
|
echo "${{ steps.proxy.outputs.proxy_port }}"
|
||||||
|
echo "${{ steps.proxy.outputs.proxy_urls }}"
|
||||||
|
|
||||||
|
- name: Fail if proxy outputs are not set
|
||||||
|
if: (!steps.proxy.outputs.proxy_host) || (!steps.proxy.outputs.proxy_port)
|
||||||
|
|| (!steps.proxy.outputs.proxy_ca_certificate) || (!steps.proxy.outputs.proxy_urls)
|
||||||
|
run: exit 1
|
||||||
|
env:
|
||||||
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
15
.github/workflows/__test-proxy.yml
generated
vendored
15
.github/workflows/__test-proxy.yml
generated
vendored
@@ -29,6 +29,8 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
version: linked
|
version: linked
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: nightly-latest
|
||||||
name: Proxy test
|
name: Proxy test
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -36,6 +38,18 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
|
# These steps are required to initialise the `gh` cli in a container that doesn't
|
||||||
|
# come pre-installed with it. The reason for that is that this is later
|
||||||
|
# needed by the `prepare-test` workflow to find the latest release of CodeQL.
|
||||||
|
- name: Set up GitHub CLI
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt install -y curl libreadline8 gnupg2 software-properties-common zstd
|
||||||
|
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
|
||||||
|
apt-key add /usr/share/keyrings/githubcli-archive-keyring.gpg
|
||||||
|
apt-add-repository https://cli.github.com/packages
|
||||||
|
apt install -y gh
|
||||||
|
env: {}
|
||||||
- name: Setup Python on macOS
|
- name: Setup Python on macOS
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
if: runner.os == 'macOS' && matrix.version == 'stable-v2.14.6'
|
||||||
@@ -60,7 +74,6 @@ jobs:
|
|||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
container:
|
container:
|
||||||
image: ubuntu:22.04
|
image: ubuntu:22.04
|
||||||
options: --dns 127.0.0.1
|
|
||||||
services:
|
services:
|
||||||
squid-proxy:
|
squid-proxy:
|
||||||
image: ubuntu/squid:latest
|
image: ubuntu/squid:latest
|
||||||
|
|||||||
4
.github/workflows/__zstd-bundle-streaming.yml
generated
vendored
4
.github/workflows/__zstd-bundle-streaming.yml
generated
vendored
@@ -72,9 +72,9 @@ jobs:
|
|||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
upload-database: false
|
upload-database: false
|
||||||
- name: Upload SARIF
|
- name: Upload SARIF
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: zstd-bundle.sarif
|
name: ${{ matrix.os }}-zstd-bundle.sarif
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
path: ${{ runner.temp }}/results/javascript.sarif
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
- name: Check diagnostic with expected tools URL appears in SARIF
|
- name: Check diagnostic with expected tools URL appears in SARIF
|
||||||
|
|||||||
4
.github/workflows/__zstd-bundle.yml
generated
vendored
4
.github/workflows/__zstd-bundle.yml
generated
vendored
@@ -74,9 +74,9 @@ jobs:
|
|||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
upload-database: false
|
upload-database: false
|
||||||
- name: Upload SARIF
|
- name: Upload SARIF
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: zstd-bundle.sarif
|
name: ${{ matrix.os }}-zstd-bundle.sarif
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
path: ${{ runner.temp }}/results/javascript.sarif
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
- name: Check diagnostic with expected tools URL appears in SARIF
|
- name: Check diagnostic with expected tools URL appears in SARIF
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
name: PR Check - Debug artifacts after failure
|
name: PR Check - Debug artifacts after failure
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
CODEQL_ACTION_ARTIFACT_V4_UPGRADE: true
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
|||||||
99
.github/workflows/debug-artifacts-legacy.yml
vendored
99
.github/workflows/debug-artifacts-legacy.yml
vendored
@@ -1,99 +0,0 @@
|
|||||||
# Checks logs, SARIF, and database bundle debug artifacts exist and are accessible
|
|
||||||
# with download-artifact@v3 when CODEQL_ACTION_ARTIFACT_V4_UPGRADE is set to false.
|
|
||||||
name: PR Check - Debug artifact upload using artifact@v2
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
CODEQL_ACTION_ARTIFACT_V4_UPGRADE: false
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch: {}
|
|
||||||
jobs:
|
|
||||||
upload-artifacts:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
version:
|
|
||||||
- stable-v2.14.6
|
|
||||||
- stable-v2.15.5
|
|
||||||
- stable-v2.16.6
|
|
||||||
- stable-v2.17.6
|
|
||||||
- stable-v2.18.4
|
|
||||||
- default
|
|
||||||
- linked
|
|
||||||
- nightly-latest
|
|
||||||
name: Upload debug artifacts
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ^1.13.1
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
debug: true
|
|
||||||
debug-artifact-name: my-debug-artifacts
|
|
||||||
debug-database-name: my-db
|
|
||||||
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
|
|
||||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
|
||||||
- name: Build code
|
|
||||||
shell: bash
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
id: analysis
|
|
||||||
download-and-check-artifacts:
|
|
||||||
name: Download and check debug artifacts
|
|
||||||
needs: upload-artifacts
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Download all artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
- name: Check expected artifacts exist
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
VERSIONS="stable-v2.14.6 stable-v2.15.5 stable-v2.16.6 stable-v2.17.6 stable-v2.18.4 default linked nightly-latest"
|
|
||||||
LANGUAGES="cpp csharp go java javascript python"
|
|
||||||
for version in $VERSIONS; do
|
|
||||||
pushd "./my-debug-artifacts-${version//./}"
|
|
||||||
echo "Artifacts from version $version:"
|
|
||||||
for language in $LANGUAGES; do
|
|
||||||
echo "- Checking $language"
|
|
||||||
if [[ ! -f "$language.sarif" ]] ; then
|
|
||||||
echo "Missing a SARIF file for $language"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ ! -f "my-db-$language.zip" ]] ; then
|
|
||||||
echo "Missing a database bundle for $language"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ ! -d "$language/log" ]] ; then
|
|
||||||
echo "Missing logs for $language"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
done
|
|
||||||
env:
|
|
||||||
GO111MODULE: auto
|
|
||||||
5
.github/workflows/debug-artifacts.yml
vendored
5
.github/workflows/debug-artifacts.yml
vendored
@@ -2,7 +2,6 @@
|
|||||||
name: PR Check - Debug artifact upload
|
name: PR Check - Debug artifact upload
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
CODEQL_ACTION_ARTIFACT_V4_UPGRADE: true
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@@ -23,11 +22,11 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version:
|
version:
|
||||||
- stable-v2.14.6
|
|
||||||
- stable-v2.15.5
|
- stable-v2.15.5
|
||||||
- stable-v2.16.6
|
- stable-v2.16.6
|
||||||
- stable-v2.17.6
|
- stable-v2.17.6
|
||||||
- stable-v2.18.4
|
- stable-v2.18.4
|
||||||
|
- stable-v2.19.4
|
||||||
- default
|
- default
|
||||||
- linked
|
- linked
|
||||||
- nightly-latest
|
- nightly-latest
|
||||||
@@ -72,7 +71,7 @@ jobs:
|
|||||||
- name: Check expected artifacts exist
|
- name: Check expected artifacts exist
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
VERSIONS="stable-v2.14.6 stable-v2.15.5 stable-v2.16.6 stable-v2.17.6 stable-v2.18.4 default linked nightly-latest"
|
VERSIONS="stable-v2.15.5 stable-v2.16.6 stable-v2.17.6 stable-v2.18.4 stable-v2.19.4 default linked 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
|
||||||
pushd "./my-debug-artifacts-${version//./}"
|
pushd "./my-debug-artifacts-${version//./}"
|
||||||
|
|||||||
10
.github/workflows/post-release-mergeback.yml
vendored
10
.github/workflows/post-release-mergeback.yml
vendored
@@ -21,6 +21,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
merge-back:
|
merge-back:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
environment: Automation
|
||||||
if: github.repository == 'github/codeql-action'
|
if: github.repository == 'github/codeql-action'
|
||||||
env:
|
env:
|
||||||
BASE_BRANCH: "${{ github.event.inputs.baseBranch || 'main' }}"
|
BASE_BRANCH: "${{ github.event.inputs.baseBranch || 'main' }}"
|
||||||
@@ -162,11 +163,18 @@ jobs:
|
|||||||
--assignee "${GITHUB_ACTOR}" \
|
--assignee "${GITHUB_ACTOR}" \
|
||||||
--draft
|
--draft
|
||||||
|
|
||||||
|
- name: Generate token
|
||||||
|
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755
|
||||||
|
id: app-token
|
||||||
|
with:
|
||||||
|
app-id: ${{ vars.AUTOMATION_APP_ID }}
|
||||||
|
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: Create the GitHub release
|
- name: Create the GitHub release
|
||||||
env:
|
env:
|
||||||
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
|
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
|
||||||
VERSION: "${{ steps.getVersion.outputs.version }}"
|
VERSION: "${{ steps.getVersion.outputs.version }}"
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
# Do not mark this release as latest. The most recent CLI release must be marked as latest.
|
# Do not mark this release as latest. The most recent CLI release must be marked as latest.
|
||||||
gh release create \
|
gh release create \
|
||||||
|
|||||||
2
.github/workflows/update-release-branch.yml
vendored
2
.github/workflows/update-release-branch.yml
vendored
@@ -116,7 +116,7 @@ jobs:
|
|||||||
TARGET_BRANCH: ${{ matrix.target_branch }}
|
TARGET_BRANCH: ${{ matrix.target_branch }}
|
||||||
steps:
|
steps:
|
||||||
- name: Generate token
|
- name: Generate token
|
||||||
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69
|
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755
|
||||||
id: app-token
|
id: app-token
|
||||||
with:
|
with:
|
||||||
app-id: ${{ vars.AUTOMATION_APP_ID }}
|
app-id: ${{ vars.AUTOMATION_APP_ID }}
|
||||||
|
|||||||
38
CHANGELOG.md
38
CHANGELOG.md
@@ -4,6 +4,44 @@ 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.
|
||||||
|
|
||||||
|
## [UNRELEASED]
|
||||||
|
|
||||||
|
No user facing changes.
|
||||||
|
|
||||||
|
## 3.28.0 - 20 Dec 2024
|
||||||
|
|
||||||
|
- Bump the minimum CodeQL bundle version to 2.15.5. [#2655](https://github.com/github/codeql-action/pull/2655)
|
||||||
|
- Don't fail in the unusual case that a file is on the search path. [#2660](https://github.com/github/codeql-action/pull/2660).
|
||||||
|
|
||||||
|
## 3.27.9 - 12 Dec 2024
|
||||||
|
|
||||||
|
No user facing changes.
|
||||||
|
|
||||||
|
## 3.27.8 - 12 Dec 2024
|
||||||
|
|
||||||
|
- Fixed an issue where streaming the download and extraction of the CodeQL bundle did not respect proxy settings. [#2624](https://github.com/github/codeql-action/pull/2624)
|
||||||
|
|
||||||
|
## 3.27.7 - 10 Dec 2024
|
||||||
|
|
||||||
|
- We are rolling out a change in December 2024 that will extract the CodeQL bundle directly to the toolcache to improve performance. [#2631](https://github.com/github/codeql-action/pull/2631)
|
||||||
|
- Update default CodeQL bundle version to 2.20.0. [#2636](https://github.com/github/codeql-action/pull/2636)
|
||||||
|
|
||||||
|
## 3.27.6 - 03 Dec 2024
|
||||||
|
|
||||||
|
- Update default CodeQL bundle version to 2.19.4. [#2626](https://github.com/github/codeql-action/pull/2626)
|
||||||
|
|
||||||
|
## 3.27.5 - 19 Nov 2024
|
||||||
|
|
||||||
|
No user facing changes.
|
||||||
|
|
||||||
|
## 3.27.4 - 14 Nov 2024
|
||||||
|
|
||||||
|
No user facing changes.
|
||||||
|
|
||||||
|
## 3.27.3 - 12 Nov 2024
|
||||||
|
|
||||||
|
No user facing changes.
|
||||||
|
|
||||||
## 3.27.2 - 12 Nov 2024
|
## 3.27.2 - 12 Nov 2024
|
||||||
|
|
||||||
- Fixed an issue where setting up the CodeQL tools would sometimes fail with the message "Invalid value 'undefined' for header 'authorization'". [#2590](https://github.com/github/codeql-action/pull/2590)
|
- Fixed an issue where setting up the CodeQL tools would sometimes fail with the message "Invalid value 'undefined' for header 'authorization'". [#2590](https://github.com/github/codeql-action/pull/2590)
|
||||||
|
|||||||
@@ -81,9 +81,8 @@ We typically release new minor versions of the CodeQL Action and Bundle when a n
|
|||||||
| `v3.25.11` | `2.17.6` | Enterprise Server 3.14 | |
|
| `v3.25.11` | `2.17.6` | Enterprise Server 3.14 | |
|
||||||
| `v3.24.11` | `2.16.6` | Enterprise Server 3.13 | |
|
| `v3.24.11` | `2.16.6` | Enterprise Server 3.13 | |
|
||||||
| `v3.22.12` | `2.15.5` | Enterprise Server 3.12 | |
|
| `v3.22.12` | `2.15.5` | Enterprise Server 3.12 | |
|
||||||
| `v2.22.1` | `2.14.6` | Enterprise Server 3.11 | Supports CodeQL Action v3, but did not ship with CodeQL Action v3. 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/#users-of-github-enterprise-server-311)." |
|
|
||||||
|
|
||||||
CodeQL Action v2 will stop receiving updates when GHES 3.11 is deprecated.
|
CodeQL Action v2 has stopped receiving updates now that GHES 3.11 is deprecated.
|
||||||
|
|
||||||
See the full list of GHES release and deprecation dates at [GitHub Enterprise Server releases](https://docs.github.com/en/enterprise-server/admin/all-releases#releases-of-github-enterprise-server).
|
See the full list of GHES release and deprecation dates at [GitHub Enterprise Server releases](https://docs.github.com/en/enterprise-server/admin/all-releases#releases-of-github-enterprise-server).
|
||||||
|
|
||||||
|
|||||||
347
lib/actions-util.js
generated
347
lib/actions-util.js
generated
@@ -15,23 +15,31 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.restoreInputs = exports.persistInputs = exports.CommandInvocationError = exports.getFileType = exports.FileCmdNotFoundError = exports.decodeGitFilePath = exports.getGitDiffHunkHeaders = exports.getAllGitMergeBases = exports.gitFetch = exports.deepenGitHistory = exports.determineBaseBranchHeadCommitOid = exports.getCommitOid = exports.getOptionalInput = exports.getRequiredInput = void 0;
|
exports.restoreInputs = exports.persistInputs = exports.CommandInvocationError = exports.getFileType = exports.FileCmdNotFoundError = exports.getOptionalInput = exports.getRequiredInput = void 0;
|
||||||
exports.getTemporaryDirectory = getTemporaryDirectory;
|
exports.getTemporaryDirectory = getTemporaryDirectory;
|
||||||
exports.getRef = getRef;
|
|
||||||
exports.getActionVersion = getActionVersion;
|
exports.getActionVersion = getActionVersion;
|
||||||
exports.getWorkflowEventName = getWorkflowEventName;
|
exports.getWorkflowEventName = getWorkflowEventName;
|
||||||
exports.isRunningLocalAction = isRunningLocalAction;
|
exports.isRunningLocalAction = isRunningLocalAction;
|
||||||
exports.getRelativeScriptPath = getRelativeScriptPath;
|
exports.getRelativeScriptPath = getRelativeScriptPath;
|
||||||
exports.getWorkflowEvent = getWorkflowEvent;
|
exports.getWorkflowEvent = getWorkflowEvent;
|
||||||
exports.isAnalyzingDefaultBranch = isAnalyzingDefaultBranch;
|
|
||||||
exports.printDebugLogs = printDebugLogs;
|
exports.printDebugLogs = printDebugLogs;
|
||||||
exports.getUploadValue = getUploadValue;
|
exports.getUploadValue = getUploadValue;
|
||||||
exports.getWorkflowRunID = getWorkflowRunID;
|
exports.getWorkflowRunID = getWorkflowRunID;
|
||||||
@@ -45,7 +53,7 @@ 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"));
|
||||||
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
||||||
const safeWhich = __importStar(require("@chrisgavin/safe-which"));
|
const io = __importStar(require("@actions/io"));
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
// eslint-disable-next-line import/no-commonjs, @typescript-eslint/no-require-imports
|
// eslint-disable-next-line import/no-commonjs, @typescript-eslint/no-require-imports
|
||||||
const pkg = require("../package.json");
|
const pkg = require("../package.json");
|
||||||
@@ -80,297 +88,6 @@ function getTemporaryDirectory() {
|
|||||||
? value
|
? value
|
||||||
: (0, util_1.getRequiredEnvParam)("RUNNER_TEMP");
|
: (0, util_1.getRequiredEnvParam)("RUNNER_TEMP");
|
||||||
}
|
}
|
||||||
async function runGitCommand(checkoutPath, args, customErrorMessage) {
|
|
||||||
let stdout = "";
|
|
||||||
let stderr = "";
|
|
||||||
core.debug(`Running git command: git ${args.join(" ")}`);
|
|
||||||
try {
|
|
||||||
await new toolrunner.ToolRunner(await safeWhich.safeWhich("git"), args, {
|
|
||||||
silent: true,
|
|
||||||
listeners: {
|
|
||||||
stdout: (data) => {
|
|
||||||
stdout += data.toString();
|
|
||||||
},
|
|
||||||
stderr: (data) => {
|
|
||||||
stderr += data.toString();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
cwd: checkoutPath,
|
|
||||||
}).exec();
|
|
||||||
return stdout;
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
let reason = stderr;
|
|
||||||
if (stderr.includes("not a git repository")) {
|
|
||||||
reason =
|
|
||||||
"The checkout path provided to the action does not appear to be a git repository.";
|
|
||||||
}
|
|
||||||
core.info(`git call failed. ${customErrorMessage} Error: ${reason}`);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Gets the SHA of the commit that is currently checked out.
|
|
||||||
*/
|
|
||||||
const getCommitOid = async function (checkoutPath, ref = "HEAD") {
|
|
||||||
// Try to use git to get the current commit SHA. If that fails then
|
|
||||||
// log but otherwise silently fall back to using the SHA from the environment.
|
|
||||||
// The only time these two values will differ is during analysis of a PR when
|
|
||||||
// the workflow has changed the current commit to the head commit instead of
|
|
||||||
// the merge commit, which must mean that git is available.
|
|
||||||
// Even if this does go wrong, it's not a huge problem for the alerts to
|
|
||||||
// reported on the merge commit.
|
|
||||||
try {
|
|
||||||
const stdout = await runGitCommand(checkoutPath, ["rev-parse", ref], "Continuing with commit SHA from user input or environment.");
|
|
||||||
return stdout.trim();
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
return (0, exports.getOptionalInput)("sha") || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.getCommitOid = getCommitOid;
|
|
||||||
/**
|
|
||||||
* If the action was triggered by a pull request, determine the commit sha at
|
|
||||||
* the head of the base branch, using the merge commit that this workflow analyzes.
|
|
||||||
* Returns undefined if run by other triggers or the base branch commit cannot be
|
|
||||||
* determined.
|
|
||||||
*/
|
|
||||||
const determineBaseBranchHeadCommitOid = async function (checkoutPathOverride) {
|
|
||||||
if (getWorkflowEventName() !== "pull_request") {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
const mergeSha = (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
|
||||||
const checkoutPath = checkoutPathOverride ?? (0, exports.getOptionalInput)("checkout_path");
|
|
||||||
try {
|
|
||||||
let commitOid = "";
|
|
||||||
let baseOid = "";
|
|
||||||
let headOid = "";
|
|
||||||
const stdout = await runGitCommand(checkoutPath, ["show", "-s", "--format=raw", mergeSha], "Will calculate the base branch SHA on the server.");
|
|
||||||
for (const data of stdout.split("\n")) {
|
|
||||||
if (data.startsWith("commit ") && commitOid === "") {
|
|
||||||
commitOid = data.substring(7);
|
|
||||||
}
|
|
||||||
else if (data.startsWith("parent ")) {
|
|
||||||
if (baseOid === "") {
|
|
||||||
baseOid = data.substring(7);
|
|
||||||
}
|
|
||||||
else if (headOid === "") {
|
|
||||||
headOid = data.substring(7);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Let's confirm our assumptions: We had a merge commit and the parsed parent data looks correct
|
|
||||||
if (commitOid === mergeSha &&
|
|
||||||
headOid.length === 40 &&
|
|
||||||
baseOid.length === 40) {
|
|
||||||
return baseOid;
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.determineBaseBranchHeadCommitOid = determineBaseBranchHeadCommitOid;
|
|
||||||
/**
|
|
||||||
* Deepen the git history of the given ref by one level. Errors are logged.
|
|
||||||
*
|
|
||||||
* This function uses the `checkout_path` to determine the repository path and
|
|
||||||
* works only when called from `analyze` or `upload-sarif`.
|
|
||||||
*/
|
|
||||||
const deepenGitHistory = async function () {
|
|
||||||
try {
|
|
||||||
await runGitCommand((0, exports.getOptionalInput)("checkout_path"), ["fetch", "--no-tags", "--deepen=1"], "Cannot deepen the shallow repository.");
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
// Errors are already logged by runGitCommand()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.deepenGitHistory = deepenGitHistory;
|
|
||||||
/**
|
|
||||||
* Fetch the given remote branch. Errors are logged.
|
|
||||||
*
|
|
||||||
* This function uses the `checkout_path` to determine the repository path and
|
|
||||||
* works only when called from `analyze` or `upload-sarif`.
|
|
||||||
*/
|
|
||||||
const gitFetch = async function (branch, extraFlags) {
|
|
||||||
try {
|
|
||||||
await runGitCommand((0, exports.getOptionalInput)("checkout_path"), ["fetch", "--no-tags", ...extraFlags, "origin", `${branch}:${branch}`], `Cannot fetch ${branch}.`);
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
// Errors are already logged by runGitCommand()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.gitFetch = gitFetch;
|
|
||||||
/**
|
|
||||||
* Compute the all merge bases between the given refs. Returns an empty array
|
|
||||||
* if no merge base is found, or if there is an error.
|
|
||||||
*
|
|
||||||
* This function uses the `checkout_path` to determine the repository path and
|
|
||||||
* works only when called from `analyze` or `upload-sarif`.
|
|
||||||
*/
|
|
||||||
const getAllGitMergeBases = async function (refs) {
|
|
||||||
try {
|
|
||||||
const stdout = await runGitCommand((0, exports.getOptionalInput)("checkout_path"), ["merge-base", "--all", ...refs], `Cannot get merge base of ${refs}.`);
|
|
||||||
return stdout.trim().split("\n");
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.getAllGitMergeBases = getAllGitMergeBases;
|
|
||||||
/**
|
|
||||||
* Compute the diff hunk headers between the two given refs.
|
|
||||||
*
|
|
||||||
* This function uses the `checkout_path` to determine the repository path and
|
|
||||||
* works only when called from `analyze` or `upload-sarif`.
|
|
||||||
*
|
|
||||||
* @returns an array of diff hunk headers (one element per line), or undefined
|
|
||||||
* if the action was not triggered by a pull request, or if the diff could not
|
|
||||||
* be determined.
|
|
||||||
*/
|
|
||||||
const getGitDiffHunkHeaders = async function (fromRef, toRef) {
|
|
||||||
let stdout = "";
|
|
||||||
try {
|
|
||||||
stdout = await runGitCommand((0, exports.getOptionalInput)("checkout_path"), [
|
|
||||||
"-c",
|
|
||||||
"core.quotePath=false",
|
|
||||||
"diff",
|
|
||||||
"--no-renames",
|
|
||||||
"--irreversible-delete",
|
|
||||||
"-U0",
|
|
||||||
fromRef,
|
|
||||||
toRef,
|
|
||||||
], `Cannot get diff from ${fromRef} to ${toRef}.`);
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
const headers = [];
|
|
||||||
for (const line of stdout.split("\n")) {
|
|
||||||
if (line.startsWith("--- ") ||
|
|
||||||
line.startsWith("+++ ") ||
|
|
||||||
line.startsWith("@@ ")) {
|
|
||||||
headers.push(line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return headers;
|
|
||||||
};
|
|
||||||
exports.getGitDiffHunkHeaders = getGitDiffHunkHeaders;
|
|
||||||
/**
|
|
||||||
* Decode, if necessary, a file path produced by Git. See
|
|
||||||
* https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath
|
|
||||||
* for details on how Git encodes file paths with special characters.
|
|
||||||
*
|
|
||||||
* This function works only for Git output with `core.quotePath=false`.
|
|
||||||
*/
|
|
||||||
const decodeGitFilePath = function (filePath) {
|
|
||||||
if (filePath.startsWith('"') && filePath.endsWith('"')) {
|
|
||||||
filePath = filePath.substring(1, filePath.length - 1);
|
|
||||||
return filePath.replace(/\\([abfnrtv\\"]|[0-7]{1,3})/g, (_match, seq) => {
|
|
||||||
switch (seq[0]) {
|
|
||||||
case "a":
|
|
||||||
return "\x07";
|
|
||||||
case "b":
|
|
||||||
return "\b";
|
|
||||||
case "f":
|
|
||||||
return "\f";
|
|
||||||
case "n":
|
|
||||||
return "\n";
|
|
||||||
case "r":
|
|
||||||
return "\r";
|
|
||||||
case "t":
|
|
||||||
return "\t";
|
|
||||||
case "v":
|
|
||||||
return "\v";
|
|
||||||
case "\\":
|
|
||||||
return "\\";
|
|
||||||
case '"':
|
|
||||||
return '"';
|
|
||||||
default:
|
|
||||||
// Both String.fromCharCode() and String.fromCodePoint() works only
|
|
||||||
// for constructing an entire character at once. If a Unicode
|
|
||||||
// character is encoded as a sequence of escaped bytes, calling these
|
|
||||||
// methods sequentially on the individual byte values would *not*
|
|
||||||
// produce the original multi-byte Unicode character. As a result,
|
|
||||||
// this implementation works only with the Git option core.quotePath
|
|
||||||
// set to false.
|
|
||||||
return String.fromCharCode(parseInt(seq, 8));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return filePath;
|
|
||||||
};
|
|
||||||
exports.decodeGitFilePath = decodeGitFilePath;
|
|
||||||
/**
|
|
||||||
* Get the ref currently being analyzed.
|
|
||||||
*/
|
|
||||||
async function getRef() {
|
|
||||||
// Will be in the form "refs/heads/master" on a push event
|
|
||||||
// or in the form "refs/pull/N/merge" on a pull_request event
|
|
||||||
const refInput = (0, exports.getOptionalInput)("ref");
|
|
||||||
const shaInput = (0, exports.getOptionalInput)("sha");
|
|
||||||
const checkoutPath = (0, exports.getOptionalInput)("checkout_path") ||
|
|
||||||
(0, exports.getOptionalInput)("source-root") ||
|
|
||||||
(0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE");
|
|
||||||
const hasRefInput = !!refInput;
|
|
||||||
const hasShaInput = !!shaInput;
|
|
||||||
// If one of 'ref' or 'sha' are provided, both are required
|
|
||||||
if ((hasRefInput || hasShaInput) && !(hasRefInput && hasShaInput)) {
|
|
||||||
throw new util_1.ConfigurationError("Both 'ref' and 'sha' are required if one of them is provided.");
|
|
||||||
}
|
|
||||||
const ref = refInput || getRefFromEnv();
|
|
||||||
const sha = shaInput || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
|
||||||
// If the ref is a user-provided input, we have to skip logic
|
|
||||||
// and assume that it is really where they want to upload the results.
|
|
||||||
if (refInput) {
|
|
||||||
return refInput;
|
|
||||||
}
|
|
||||||
// For pull request refs we want to detect whether the workflow
|
|
||||||
// has run `git checkout HEAD^2` to analyze the 'head' ref rather
|
|
||||||
// than the 'merge' ref. If so, we want to convert the ref that
|
|
||||||
// we report back.
|
|
||||||
const pull_ref_regex = /refs\/pull\/(\d+)\/merge/;
|
|
||||||
if (!pull_ref_regex.test(ref)) {
|
|
||||||
return ref;
|
|
||||||
}
|
|
||||||
const head = await (0, exports.getCommitOid)(checkoutPath, "HEAD");
|
|
||||||
// in actions/checkout@v2+ we can check if git rev-parse HEAD == GITHUB_SHA
|
|
||||||
// in actions/checkout@v1 this may not be true as it checks out the repository
|
|
||||||
// using GITHUB_REF. There is a subtle race condition where
|
|
||||||
// git rev-parse GITHUB_REF != GITHUB_SHA, so we must check
|
|
||||||
// git rev-parse GITHUB_REF == git rev-parse HEAD instead.
|
|
||||||
const hasChangedRef = sha !== head &&
|
|
||||||
(await (0, exports.getCommitOid)(checkoutPath, ref.replace(/^refs\/pull\//, "refs/remotes/pull/"))) !== head;
|
|
||||||
if (hasChangedRef) {
|
|
||||||
const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head");
|
|
||||||
core.debug(`No longer on merge commit, rewriting ref from ${ref} to ${newRef}.`);
|
|
||||||
return newRef;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return ref;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function getRefFromEnv() {
|
|
||||||
// To workaround a limitation of Actions dynamic workflows not setting
|
|
||||||
// the GITHUB_REF in some cases, we accept also the ref within the
|
|
||||||
// CODE_SCANNING_REF variable. When possible, however, we prefer to use
|
|
||||||
// the GITHUB_REF as that is a protected variable and cannot be overwritten.
|
|
||||||
let refEnv;
|
|
||||||
try {
|
|
||||||
refEnv = (0, util_1.getRequiredEnvParam)("GITHUB_REF");
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
// If the GITHUB_REF is not set, we try to rescue by getting the
|
|
||||||
// CODE_SCANNING_REF.
|
|
||||||
const maybeRef = process.env["CODE_SCANNING_REF"];
|
|
||||||
if (maybeRef === undefined || maybeRef.length === 0) {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
refEnv = maybeRef;
|
|
||||||
}
|
|
||||||
return refEnv;
|
|
||||||
}
|
|
||||||
function getActionVersion() {
|
function getActionVersion() {
|
||||||
return pkg.version;
|
return pkg.version;
|
||||||
}
|
}
|
||||||
@@ -410,30 +127,6 @@ function getWorkflowEvent() {
|
|||||||
throw new Error(`Unable to read workflow event JSON from ${eventJsonFile}: ${e}`);
|
throw new Error(`Unable to read workflow event JSON from ${eventJsonFile}: ${e}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function removeRefsHeadsPrefix(ref) {
|
|
||||||
return ref.startsWith("refs/heads/") ? ref.slice("refs/heads/".length) : ref;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Returns whether we are analyzing the default branch for the repository.
|
|
||||||
*
|
|
||||||
* This first checks the environment variable `CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH`. This
|
|
||||||
* environment variable can be set in cases where repository information might not be available, for
|
|
||||||
* example dynamic workflows.
|
|
||||||
*/
|
|
||||||
async function isAnalyzingDefaultBranch() {
|
|
||||||
if (process.env.CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH === "true") {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// Get the current ref and trim and refs/heads/ prefix
|
|
||||||
let currentRef = await getRef();
|
|
||||||
currentRef = removeRefsHeadsPrefix(currentRef);
|
|
||||||
const event = getWorkflowEvent();
|
|
||||||
let defaultBranch = event?.repository?.default_branch;
|
|
||||||
if (getWorkflowEventName() === "schedule") {
|
|
||||||
defaultBranch = removeRefsHeadsPrefix(getRefFromEnv());
|
|
||||||
}
|
|
||||||
return currentRef === defaultBranch;
|
|
||||||
}
|
|
||||||
async function printDebugLogs(config) {
|
async function printDebugLogs(config) {
|
||||||
for (const language of config.languages) {
|
for (const language of config.languages) {
|
||||||
const databaseDirectory = (0, util_1.getCodeQLDatabasePath)(config, language);
|
const databaseDirectory = (0, util_1.getCodeQLDatabasePath)(config, language);
|
||||||
@@ -526,7 +219,7 @@ const getFileType = async (filePath) => {
|
|||||||
let stdout = "";
|
let stdout = "";
|
||||||
let fileCmdPath;
|
let fileCmdPath;
|
||||||
try {
|
try {
|
||||||
fileCmdPath = await safeWhich.safeWhich("file");
|
fileCmdPath = await io.which("file", true);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
throw new FileCmdNotFoundError(`The \`file\` program is required, but does not appear to be installed. Please install it: ${e}`);
|
throw new FileCmdNotFoundError(`The \`file\` program is required, but does not appear to be installed. Please install it: ${e}`);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
247
lib/actions-util.test.js
generated
247
lib/actions-util.test.js
generated
@@ -1,159 +1,14 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
||||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
||||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
||||||
}
|
|
||||||
Object.defineProperty(o, k2, desc);
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
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 });
|
||||||
const fs = __importStar(require("fs"));
|
|
||||||
const path = __importStar(require("path"));
|
|
||||||
const core = __importStar(require("@actions/core"));
|
|
||||||
const ava_1 = __importDefault(require("ava"));
|
const ava_1 = __importDefault(require("ava"));
|
||||||
const sinon = __importStar(require("sinon"));
|
|
||||||
const actionsUtil = __importStar(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 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);
|
||||||
(0, ava_1.default)("getRef() throws on the empty string", async (t) => {
|
|
||||||
process.env["GITHUB_REF"] = "";
|
|
||||||
await t.throwsAsync(actionsUtil.getRef);
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("getRef() returns merge PR ref if GITHUB_SHA still checked out", async (t) => {
|
|
||||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
|
||||||
const expectedRef = "refs/pull/1/merge";
|
|
||||||
const currentSha = "a".repeat(40);
|
|
||||||
process.env["GITHUB_REF"] = expectedRef;
|
|
||||||
process.env["GITHUB_SHA"] = currentSha;
|
|
||||||
const callback = sinon.stub(actionsUtil, "getCommitOid");
|
|
||||||
callback.withArgs("HEAD").resolves(currentSha);
|
|
||||||
const actualRef = await actionsUtil.getRef();
|
|
||||||
t.deepEqual(actualRef, expectedRef);
|
|
||||||
callback.restore();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("getRef() returns merge PR ref if GITHUB_REF still checked out but sha has changed (actions checkout@v1)", async (t) => {
|
|
||||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
|
||||||
const expectedRef = "refs/pull/1/merge";
|
|
||||||
process.env["GITHUB_REF"] = expectedRef;
|
|
||||||
process.env["GITHUB_SHA"] = "b".repeat(40);
|
|
||||||
const sha = "a".repeat(40);
|
|
||||||
const callback = sinon.stub(actionsUtil, "getCommitOid");
|
|
||||||
callback.withArgs("refs/remotes/pull/1/merge").resolves(sha);
|
|
||||||
callback.withArgs("HEAD").resolves(sha);
|
|
||||||
const actualRef = await actionsUtil.getRef();
|
|
||||||
t.deepEqual(actualRef, expectedRef);
|
|
||||||
callback.restore();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("getRef() returns head PR ref if GITHUB_REF no longer checked out", async (t) => {
|
|
||||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
|
||||||
process.env["GITHUB_REF"] = "refs/pull/1/merge";
|
|
||||||
process.env["GITHUB_SHA"] = "a".repeat(40);
|
|
||||||
const callback = sinon.stub(actionsUtil, "getCommitOid");
|
|
||||||
callback.withArgs(tmpDir, "refs/pull/1/merge").resolves("a".repeat(40));
|
|
||||||
callback.withArgs(tmpDir, "HEAD").resolves("b".repeat(40));
|
|
||||||
const actualRef = await actionsUtil.getRef();
|
|
||||||
t.deepEqual(actualRef, "refs/pull/1/head");
|
|
||||||
callback.restore();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("getRef() returns ref provided as an input and ignores current HEAD", async (t) => {
|
|
||||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
|
||||||
const getAdditionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
|
||||||
getAdditionalInputStub.withArgs("ref").resolves("refs/pull/2/merge");
|
|
||||||
getAdditionalInputStub.withArgs("sha").resolves("b".repeat(40));
|
|
||||||
// These values are be ignored
|
|
||||||
process.env["GITHUB_REF"] = "refs/pull/1/merge";
|
|
||||||
process.env["GITHUB_SHA"] = "a".repeat(40);
|
|
||||||
const callback = sinon.stub(actionsUtil, "getCommitOid");
|
|
||||||
callback.withArgs("refs/pull/1/merge").resolves("b".repeat(40));
|
|
||||||
callback.withArgs("HEAD").resolves("b".repeat(40));
|
|
||||||
const actualRef = await actionsUtil.getRef();
|
|
||||||
t.deepEqual(actualRef, "refs/pull/2/merge");
|
|
||||||
callback.restore();
|
|
||||||
getAdditionalInputStub.restore();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("getRef() returns CODE_SCANNING_REF as a fallback for GITHUB_REF", async (t) => {
|
|
||||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
|
||||||
const expectedRef = "refs/pull/1/HEAD";
|
|
||||||
const currentSha = "a".repeat(40);
|
|
||||||
process.env["CODE_SCANNING_REF"] = expectedRef;
|
|
||||||
process.env["GITHUB_REF"] = "";
|
|
||||||
process.env["GITHUB_SHA"] = currentSha;
|
|
||||||
const actualRef = await actionsUtil.getRef();
|
|
||||||
t.deepEqual(actualRef, expectedRef);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("getRef() returns GITHUB_REF over CODE_SCANNING_REF if both are provided", async (t) => {
|
|
||||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
|
||||||
const expectedRef = "refs/pull/1/merge";
|
|
||||||
const currentSha = "a".repeat(40);
|
|
||||||
process.env["CODE_SCANNING_REF"] = "refs/pull/1/HEAD";
|
|
||||||
process.env["GITHUB_REF"] = expectedRef;
|
|
||||||
process.env["GITHUB_SHA"] = currentSha;
|
|
||||||
const actualRef = await actionsUtil.getRef();
|
|
||||||
t.deepEqual(actualRef, expectedRef);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("getRef() throws an error if only `ref` is provided as an input", async (t) => {
|
|
||||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
|
||||||
const getAdditionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
|
||||||
getAdditionalInputStub.withArgs("ref").resolves("refs/pull/1/merge");
|
|
||||||
await t.throwsAsync(async () => {
|
|
||||||
await actionsUtil.getRef();
|
|
||||||
}, {
|
|
||||||
instanceOf: Error,
|
|
||||||
message: "Both 'ref' and 'sha' are required if one of them is provided.",
|
|
||||||
});
|
|
||||||
getAdditionalInputStub.restore();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("getRef() throws an error if only `sha` is provided as an input", async (t) => {
|
|
||||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
|
||||||
process.env["GITHUB_WORKSPACE"] = "/tmp";
|
|
||||||
const getAdditionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
|
||||||
getAdditionalInputStub.withArgs("sha").resolves("a".repeat(40));
|
|
||||||
await t.throwsAsync(async () => {
|
|
||||||
await actionsUtil.getRef();
|
|
||||||
}, {
|
|
||||||
instanceOf: Error,
|
|
||||||
message: "Both 'ref' and 'sha' are required if one of them is provided.",
|
|
||||||
});
|
|
||||||
getAdditionalInputStub.restore();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("computeAutomationID()", async (t) => {
|
(0, ava_1.default)("computeAutomationID()", async (t) => {
|
||||||
let actualAutomationID = (0, api_client_1.computeAutomationID)(".github/workflows/codeql-analysis.yml:analyze", '{"language": "javascript", "os": "linux"}');
|
let actualAutomationID = (0, api_client_1.computeAutomationID)(".github/workflows/codeql-analysis.yml:analyze", '{"language": "javascript", "os": "linux"}');
|
||||||
t.deepEqual(actualAutomationID, ".github/workflows/codeql-analysis.yml:analyze/language:javascript/os:linux/");
|
t.deepEqual(actualAutomationID, ".github/workflows/codeql-analysis.yml:analyze/language:javascript/os:linux/");
|
||||||
@@ -174,106 +29,4 @@ const util_1 = require("./util");
|
|||||||
(0, util_1.initializeEnvironment)("1.2.3");
|
(0, util_1.initializeEnvironment)("1.2.3");
|
||||||
t.deepEqual(process.env[environment_1.EnvVar.VERSION], "1.2.3");
|
t.deepEqual(process.env[environment_1.EnvVar.VERSION], "1.2.3");
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("isAnalyzingDefaultBranch()", async (t) => {
|
|
||||||
process.env["GITHUB_EVENT_NAME"] = "push";
|
|
||||||
process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "true";
|
|
||||||
t.deepEqual(await actionsUtil.isAnalyzingDefaultBranch(), true);
|
|
||||||
process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "false";
|
|
||||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
|
||||||
const envFile = path.join(tmpDir, "event.json");
|
|
||||||
fs.writeFileSync(envFile, JSON.stringify({
|
|
||||||
repository: {
|
|
||||||
default_branch: "main",
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
process.env["GITHUB_EVENT_PATH"] = envFile;
|
|
||||||
process.env["GITHUB_REF"] = "main";
|
|
||||||
process.env["GITHUB_SHA"] = "1234";
|
|
||||||
t.deepEqual(await actionsUtil.isAnalyzingDefaultBranch(), true);
|
|
||||||
process.env["GITHUB_REF"] = "refs/heads/main";
|
|
||||||
t.deepEqual(await actionsUtil.isAnalyzingDefaultBranch(), true);
|
|
||||||
process.env["GITHUB_REF"] = "feature";
|
|
||||||
t.deepEqual(await actionsUtil.isAnalyzingDefaultBranch(), false);
|
|
||||||
fs.writeFileSync(envFile, JSON.stringify({
|
|
||||||
schedule: "0 0 * * *",
|
|
||||||
}));
|
|
||||||
process.env["GITHUB_EVENT_NAME"] = "schedule";
|
|
||||||
process.env["GITHUB_REF"] = "refs/heads/main";
|
|
||||||
t.deepEqual(await actionsUtil.isAnalyzingDefaultBranch(), true);
|
|
||||||
const getAdditionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
|
||||||
getAdditionalInputStub
|
|
||||||
.withArgs("ref")
|
|
||||||
.resolves("refs/heads/something-else");
|
|
||||||
getAdditionalInputStub
|
|
||||||
.withArgs("sha")
|
|
||||||
.resolves("0000000000000000000000000000000000000000");
|
|
||||||
process.env["GITHUB_EVENT_NAME"] = "schedule";
|
|
||||||
process.env["GITHUB_REF"] = "refs/heads/main";
|
|
||||||
t.deepEqual(await actionsUtil.isAnalyzingDefaultBranch(), false);
|
|
||||||
getAdditionalInputStub.restore();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("determineBaseBranchHeadCommitOid non-pullrequest", async (t) => {
|
|
||||||
const infoStub = sinon.stub(core, "info");
|
|
||||||
process.env["GITHUB_EVENT_NAME"] = "hucairz";
|
|
||||||
process.env["GITHUB_SHA"] = "100912429fab4cb230e66ffb11e738ac5194e73a";
|
|
||||||
const result = await actionsUtil.determineBaseBranchHeadCommitOid(__dirname);
|
|
||||||
t.deepEqual(result, undefined);
|
|
||||||
t.deepEqual(0, infoStub.callCount);
|
|
||||||
infoStub.restore();
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("determineBaseBranchHeadCommitOid not git repository", async (t) => {
|
|
||||||
const infoStub = sinon.stub(core, "info");
|
|
||||||
process.env["GITHUB_EVENT_NAME"] = "pull_request";
|
|
||||||
process.env["GITHUB_SHA"] = "100912429fab4cb230e66ffb11e738ac5194e73a";
|
|
||||||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
|
||||||
await actionsUtil.determineBaseBranchHeadCommitOid(tmpDir);
|
|
||||||
});
|
|
||||||
t.deepEqual(1, infoStub.callCount);
|
|
||||||
t.deepEqual(infoStub.firstCall.args[0], "git call failed. Will calculate the base branch SHA on the server. Error: " +
|
|
||||||
"The checkout path provided to the action does not appear to be a git repository.");
|
|
||||||
infoStub.restore();
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("determineBaseBranchHeadCommitOid other error", async (t) => {
|
|
||||||
const infoStub = sinon.stub(core, "info");
|
|
||||||
process.env["GITHUB_EVENT_NAME"] = "pull_request";
|
|
||||||
process.env["GITHUB_SHA"] = "100912429fab4cb230e66ffb11e738ac5194e73a";
|
|
||||||
const result = await actionsUtil.determineBaseBranchHeadCommitOid(path.join(__dirname, "../../i-dont-exist"));
|
|
||||||
t.deepEqual(result, undefined);
|
|
||||||
t.deepEqual(1, infoStub.callCount);
|
|
||||||
t.assert(infoStub.firstCall.args[0].startsWith("git call failed. Will calculate the base branch SHA on the server. Error: "));
|
|
||||||
t.assert(!infoStub.firstCall.args[0].endsWith("The checkout path provided to the action does not appear to be a git repository."));
|
|
||||||
infoStub.restore();
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("decodeGitFilePath unquoted strings", async (t) => {
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("foo"), "foo");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("foo bar"), "foo bar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("foo\\\\bar"), "foo\\\\bar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('foo\\"bar'), 'foo\\"bar');
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("foo\\001bar"), "foo\\001bar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("foo\\abar"), "foo\\abar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("foo\\bbar"), "foo\\bbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("foo\\fbar"), "foo\\fbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("foo\\nbar"), "foo\\nbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("foo\\rbar"), "foo\\rbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("foo\\tbar"), "foo\\tbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("foo\\vbar"), "foo\\vbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath("\\a\\b\\f\\n\\r\\t\\v"), "\\a\\b\\f\\n\\r\\t\\v");
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("decodeGitFilePath quoted strings", async (t) => {
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo"'), "foo");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo bar"'), "foo bar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo\\\\bar"'), "foo\\bar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo\\"bar"'), 'foo"bar');
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo\\001bar"'), "foo\x01bar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo\\abar"'), "foo\x07bar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo\\bbar"'), "foo\bbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo\\fbar"'), "foo\fbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo\\nbar"'), "foo\nbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo\\rbar"'), "foo\rbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo\\tbar"'), "foo\tbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"foo\\vbar"'), "foo\vbar");
|
|
||||||
t.deepEqual(actionsUtil.decodeGitFilePath('"\\a\\b\\f\\n\\r\\t\\v"'), "\x07\b\f\n\r\t\v");
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=actions-util.test.js.map
|
//# sourceMappingURL=actions-util.test.js.map
|
||||||
File diff suppressed because one or more lines are too long
27
lib/analyze-action-env.test.js
generated
27
lib/analyze-action-env.test.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@@ -32,6 +42,7 @@ const actionsUtil = __importStar(require("./actions-util"));
|
|||||||
const analyze = __importStar(require("./analyze"));
|
const analyze = __importStar(require("./analyze"));
|
||||||
const api = __importStar(require("./api-client"));
|
const api = __importStar(require("./api-client"));
|
||||||
const configUtils = __importStar(require("./config-utils"));
|
const configUtils = __importStar(require("./config-utils"));
|
||||||
|
const gitUtils = __importStar(require("./git-utils"));
|
||||||
const statusReport = __importStar(require("./status-report"));
|
const statusReport = __importStar(require("./status-report"));
|
||||||
const testing_utils_1 = require("./testing-utils");
|
const testing_utils_1 = require("./testing-utils");
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
@@ -51,7 +62,7 @@ const util = __importStar(require("./util"));
|
|||||||
.stub(statusReport, "createStatusReportBase")
|
.stub(statusReport, "createStatusReportBase")
|
||||||
.resolves({});
|
.resolves({});
|
||||||
sinon.stub(statusReport, "sendStatusReport").resolves();
|
sinon.stub(statusReport, "sendStatusReport").resolves();
|
||||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
|
||||||
const gitHubVersion = {
|
const gitHubVersion = {
|
||||||
type: util.GitHubVariant.DOTCOM,
|
type: util.GitHubVariant.DOTCOM,
|
||||||
};
|
};
|
||||||
|
|||||||
@@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,CAAC;QAEpC,uEAAuE;QACvE,0EAA0E;QAC1E,iBAAiB;QACjB,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,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,iEAAiE;QACjE,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"}
|
||||||
27
lib/analyze-action-input.test.js
generated
27
lib/analyze-action-input.test.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@@ -32,6 +42,7 @@ const actionsUtil = __importStar(require("./actions-util"));
|
|||||||
const analyze = __importStar(require("./analyze"));
|
const analyze = __importStar(require("./analyze"));
|
||||||
const api = __importStar(require("./api-client"));
|
const api = __importStar(require("./api-client"));
|
||||||
const configUtils = __importStar(require("./config-utils"));
|
const configUtils = __importStar(require("./config-utils"));
|
||||||
|
const gitUtils = __importStar(require("./git-utils"));
|
||||||
const statusReport = __importStar(require("./status-report"));
|
const statusReport = __importStar(require("./status-report"));
|
||||||
const testing_utils_1 = require("./testing-utils");
|
const testing_utils_1 = require("./testing-utils");
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
@@ -67,7 +78,7 @@ const util = __importStar(require("./util"));
|
|||||||
optionalInputStub.withArgs("cleanup-level").returns("none");
|
optionalInputStub.withArgs("cleanup-level").returns("none");
|
||||||
optionalInputStub.withArgs("expect-error").returns("false");
|
optionalInputStub.withArgs("expect-error").returns("false");
|
||||||
sinon.stub(api, "getGitHubVersion").resolves(gitHubVersion);
|
sinon.stub(api, "getGitHubVersion").resolves(gitHubVersion);
|
||||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
|
||||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
(0, testing_utils_1.mockFeatureFlagApiEndpoint)(200, {});
|
(0, testing_utils_1.mockFeatureFlagApiEndpoint)(200, {});
|
||||||
process.env["CODEQL_THREADS"] = "1";
|
process.env["CODEQL_THREADS"] = "1";
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analyze-action-input.test.js","sourceRoot":"","sources":["../src/analyze-action-input.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,mDAAqC;AACrC,kDAAoC;AACpC,4DAA8C;AAC9C,8DAAgD;AAChD,mDAIyB;AACzB,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,iCAAiC;AAEjC,IAAA,aAAI,EAAC,sDAAsD,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACvE,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,sCAAsC,CAAC;QAC1E,OAAO,CAAC,GAAG,C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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"}
|
||||||
30
lib/analyze-action-post.js
generated
30
lib/analyze-action-post.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
/**
|
/**
|
||||||
* This file is the entry point for the `post:` hook of `analyze-action.yml`.
|
* This file is the entry point for the `post:` hook of `analyze-action.yml`.
|
||||||
@@ -34,9 +44,7 @@ const api_client_1 = require("./api-client");
|
|||||||
const config_utils_1 = require("./config-utils");
|
const config_utils_1 = require("./config-utils");
|
||||||
const debugArtifacts = __importStar(require("./debug-artifacts"));
|
const debugArtifacts = __importStar(require("./debug-artifacts"));
|
||||||
const environment_1 = require("./environment");
|
const environment_1 = require("./environment");
|
||||||
const feature_flags_1 = require("./feature-flags");
|
|
||||||
const logging_1 = require("./logging");
|
const logging_1 = require("./logging");
|
||||||
const repository_1 = require("./repository");
|
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
async function runWrapper() {
|
async function runWrapper() {
|
||||||
try {
|
try {
|
||||||
@@ -44,14 +52,12 @@ async function runWrapper() {
|
|||||||
const logger = (0, logging_1.getActionsLogger)();
|
const logger = (0, logging_1.getActionsLogger)();
|
||||||
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);
|
||||||
const repositoryNwo = (0, repository_1.parseRepositoryNwo)((0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY"));
|
|
||||||
const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, actionsUtil.getTemporaryDirectory(), logger);
|
|
||||||
// Upload SARIF artifacts if we determine that this is a first-party analysis run.
|
// Upload SARIF artifacts if we determine that this is a first-party analysis run.
|
||||||
// For third-party runs, this artifact will be uploaded in the `upload-sarif-post` step.
|
// For third-party runs, this artifact will be uploaded in the `upload-sarif-post` step.
|
||||||
if (process.env[environment_1.EnvVar.INIT_ACTION_HAS_RUN] === "true") {
|
if (process.env[environment_1.EnvVar.INIT_ACTION_HAS_RUN] === "true") {
|
||||||
const config = await (0, config_utils_1.getConfig)(actionsUtil.getTemporaryDirectory(), logger);
|
const config = await (0, config_utils_1.getConfig)(actionsUtil.getTemporaryDirectory(), logger);
|
||||||
if (config !== undefined) {
|
if (config !== undefined) {
|
||||||
await (0, logging_1.withGroup)("Uploading combined SARIF debug artifact", () => debugArtifacts.uploadCombinedSarifArtifacts(logger, config.gitHubVersion.type, features));
|
await (0, logging_1.withGroup)("Uploading combined SARIF debug artifact", () => debugArtifacts.uploadCombinedSarifArtifacts(logger, config.gitHubVersion.type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analyze-action-post.js","sourceRoot":"","sources":["../src/analyze-action-post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,oDAAsC;AAEtC,4DAA8C;AAC9C,6CAAgD;AAChD,iDAA2C;AAC3C,kEAAoD;AACpD,+CAAuC;AACvC,mDAA2C;AAC3C,uCAAwD;AACxD,6CAAkD;AAClD,iCAIgB;AAEhB,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,WAAW,CAAC,aAAa,EAAE,CAAC;QAC5B,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;QACjD,MAAM,aAAa,GAAG,IAAA,+BAAkB,EACtC,IAAA,0BAAmB,EAAC,mBAAmB,CAAC,CACzC,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,wBAAQ,CAC3B,aAAa,EACb,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GAAG,CAAC,oBAAM,CAAC,mBAAmB,CAAC,KAAK,MAAM,EAAE,CAAC;YACvD,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAC5B,WAAW,CAAC,qBAAqB,EAAE,EACnC,MAAM,CACP,CAAC;YACF,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,MAAM,IAAA,mBAAS,EAAC,yCAAyC,EAAE,GAAG,EAAE,CAC9D,cAAc,CAAC,4BAA4B,CACzC,MAAM,EACN,MAAM,CAAC,aAAa,CAAC,IAAI,CAC1B,CACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CACZ,oCAAoC,IAAA,sBAAe,EAAC,KAAK,CAAC,EAAE,CAC7D,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||||
24
lib/analyze-action.js
generated
24
lib/analyze-action.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
58
lib/analyze.js
generated
58
lib/analyze.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@@ -37,7 +47,7 @@ exports.runCleanup = runCleanup;
|
|||||||
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 safe_which_1 = require("@chrisgavin/safe-which");
|
const io = __importStar(require("@actions/io"));
|
||||||
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 actionsUtil = __importStar(require("./actions-util"));
|
const actionsUtil = __importStar(require("./actions-util"));
|
||||||
@@ -46,6 +56,7 @@ const codeql_1 = require("./codeql");
|
|||||||
const diagnostics_1 = require("./diagnostics");
|
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 gitUtils = __importStar(require("./git-utils"));
|
||||||
const languages_1 = require("./languages");
|
const languages_1 = require("./languages");
|
||||||
const logging_1 = require("./logging");
|
const logging_1 = require("./logging");
|
||||||
const tools_features_1 = require("./tools-features");
|
const tools_features_1 = require("./tools-features");
|
||||||
@@ -152,7 +163,7 @@ async function setupDiffInformedQueryRun(baseRef, headRef, codeql, logger, featu
|
|||||||
if (!(await features.getValue(feature_flags_1.Feature.DiffInformedQueries, codeql))) {
|
if (!(await features.getValue(feature_flags_1.Feature.DiffInformedQueries, codeql))) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
return await (0, logging_1.withGroup)("Generating diff range extension pack", async () => {
|
return await (0, logging_1.withGroupAsync)("Generating diff range extension pack", async () => {
|
||||||
const diffRanges = await getPullRequestEditedDiffRanges(baseRef, headRef, logger);
|
const diffRanges = await getPullRequestEditedDiffRanges(baseRef, headRef, logger);
|
||||||
return writeDiffRangeDataExtensionPack(logger, diffRanges);
|
return writeDiffRangeDataExtensionPack(logger, diffRanges);
|
||||||
});
|
});
|
||||||
@@ -175,39 +186,44 @@ async function getPullRequestEditedDiffRanges(baseRef, headRef, logger) {
|
|||||||
}
|
}
|
||||||
// To compute the merge bases between the base branch and the PR topic branch,
|
// To compute the merge bases between the base branch and the PR topic branch,
|
||||||
// we need to fetch the commit graph from the branch heads to those merge
|
// we need to fetch the commit graph from the branch heads to those merge
|
||||||
// babes. The following 4-step procedure does so while limiting the amount of
|
// babes. The following 6-step procedure does so while limiting the amount of
|
||||||
// history fetched.
|
// history fetched.
|
||||||
// Step 1: Deepen from the PR merge commit to the base branch head and the PR
|
// Step 1: Deepen from the PR merge commit to the base branch head and the PR
|
||||||
// topic branch head, so that the PR merge commit is no longer considered a
|
// topic branch head, so that the PR merge commit is no longer considered a
|
||||||
// grafted commit.
|
// grafted commit.
|
||||||
await actionsUtil.deepenGitHistory();
|
await gitUtils.deepenGitHistory();
|
||||||
// Step 2: Fetch the base branch shallow history. This step ensures that the
|
// Step 2: Fetch the base branch shallow history. This step ensures that the
|
||||||
// base branch name is present in the local repository. Normally the base
|
// base branch name is present in the local repository. Normally the base
|
||||||
// branch name would be added by Step 4. However, if the base branch head is
|
// branch name would be added by Step 4. However, if the base branch head is
|
||||||
// an ancestor of the PR topic branch head, Step 4 would fail without doing
|
// an ancestor of the PR topic branch head, Step 4 would fail without doing
|
||||||
// anything, so we need to fetch the base branch explicitly.
|
// anything, so we need to fetch the base branch explicitly.
|
||||||
await actionsUtil.gitFetch(baseRef, ["--depth=1"]);
|
await gitUtils.gitFetch(baseRef, ["--depth=1"]);
|
||||||
// Step 3: Fetch the PR topic branch history, stopping when we reach commits
|
// Step 3: Fetch the PR topic branch history, stopping when we reach commits
|
||||||
// that are reachable from the base branch head.
|
// that are reachable from the base branch head.
|
||||||
await actionsUtil.gitFetch(headRef, [`--shallow-exclude=${baseRef}`]);
|
await gitUtils.gitFetch(headRef, [`--shallow-exclude=${baseRef}`]);
|
||||||
// Step 4: Fetch the base branch history, stopping when we reach commits that
|
// Step 4: Fetch the base branch history, stopping when we reach commits that
|
||||||
// are reachable from the PR topic branch head.
|
// are reachable from the PR topic branch head.
|
||||||
await actionsUtil.gitFetch(baseRef, [`--shallow-exclude=${headRef}`]);
|
await gitUtils.gitFetch(baseRef, [`--shallow-exclude=${headRef}`]);
|
||||||
// Step 5: Deepen the history so that we have the merge bases between the base
|
// Step 5: Repack the history to remove the shallow grafts that were added by
|
||||||
|
// the previous fetches. This step works around a bug that causes subsequent
|
||||||
|
// deepening fetches to fail with "fatal: error in object: unshallow <SHA>".
|
||||||
|
// See https://stackoverflow.com/q/63878612
|
||||||
|
await gitUtils.gitRepack(["-d"]);
|
||||||
|
// Step 6: Deepen the history so that we have the merge bases between the base
|
||||||
// branch and the PR topic branch.
|
// branch and the PR topic branch.
|
||||||
await actionsUtil.deepenGitHistory();
|
await gitUtils.deepenGitHistory();
|
||||||
// To compute the exact same diff as GitHub would compute for the PR, we need
|
// To compute the exact same diff as GitHub would compute for the PR, we need
|
||||||
// to use the same merge base as GitHub. That is easy to do if there is only
|
// to use the same merge base as GitHub. That is easy to do if there is only
|
||||||
// one merge base, which is by far the most common case. If there are multiple
|
// one merge base, which is by far the most common case. If there are multiple
|
||||||
// merge bases, we stop without producing a diff range.
|
// merge bases, we stop without producing a diff range.
|
||||||
const mergeBases = await actionsUtil.getAllGitMergeBases([baseRef, headRef]);
|
const mergeBases = await gitUtils.getAllGitMergeBases([baseRef, headRef]);
|
||||||
logger.info(`Merge bases: ${mergeBases.join(", ")}`);
|
logger.info(`Merge bases: ${mergeBases.join(", ")}`);
|
||||||
if (mergeBases.length !== 1) {
|
if (mergeBases.length !== 1) {
|
||||||
logger.info("Cannot compute diff range because baseRef and headRef " +
|
logger.info("Cannot compute diff range because baseRef and headRef " +
|
||||||
`have ${mergeBases.length} merge bases (instead of exactly 1).`);
|
`have ${mergeBases.length} merge bases (instead of exactly 1).`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const diffHunkHeaders = await actionsUtil.getGitDiffHunkHeaders(mergeBases[0], headRef);
|
const diffHunkHeaders = await gitUtils.getGitDiffHunkHeaders(mergeBases[0], headRef);
|
||||||
if (diffHunkHeaders === undefined) {
|
if (diffHunkHeaders === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@@ -215,7 +231,7 @@ async function getPullRequestEditedDiffRanges(baseRef, headRef, logger) {
|
|||||||
let changedFile = "";
|
let changedFile = "";
|
||||||
for (const line of diffHunkHeaders) {
|
for (const line of diffHunkHeaders) {
|
||||||
if (line.startsWith("+++ ")) {
|
if (line.startsWith("+++ ")) {
|
||||||
const filePath = actionsUtil.decodeGitFilePath(line.substring(4));
|
const filePath = gitUtils.decodeGitFilePath(line.substring(4));
|
||||||
if (filePath.startsWith("b/")) {
|
if (filePath.startsWith("b/")) {
|
||||||
// The file was edited: track all hunks in the file
|
// The file was edited: track all hunks in the file
|
||||||
changedFile = filePath.substring(2);
|
changedFile = filePath.substring(2);
|
||||||
@@ -287,7 +303,7 @@ extensions:
|
|||||||
data:
|
data:
|
||||||
`;
|
`;
|
||||||
let data = ranges
|
let data = ranges
|
||||||
.map((range) => ` - ["${range[0]}", ${range[1]}, ${range[2]}]\n`)
|
.map((range) => ` - ["${range.path}", ${range.startLine}, ${range.endLine}]\n`)
|
||||||
.join("");
|
.join("");
|
||||||
if (!data) {
|
if (!data) {
|
||||||
// Ensure that the data extension is not empty, so that a pull request with
|
// Ensure that the data extension is not empty, so that a pull request with
|
||||||
@@ -421,7 +437,7 @@ async function warnIfGoInstalledAfterInit(config, logger) {
|
|||||||
const goInitPath = process.env[environment_1.EnvVar.GO_BINARY_LOCATION];
|
const goInitPath = process.env[environment_1.EnvVar.GO_BINARY_LOCATION];
|
||||||
if (process.env[environment_1.EnvVar.DID_AUTOBUILD_GOLANG] !== "true" &&
|
if (process.env[environment_1.EnvVar.DID_AUTOBUILD_GOLANG] !== "true" &&
|
||||||
goInitPath !== undefined) {
|
goInitPath !== undefined) {
|
||||||
const goBinaryPath = await (0, safe_which_1.safeWhich)("go");
|
const goBinaryPath = await io.which("go", true);
|
||||||
if (goInitPath !== goBinaryPath) {
|
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.`);
|
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", {
|
(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", {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
24
lib/analyze.test.js
generated
24
lib/analyze.test.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"analyze.test.js","sourceRoot":"","sources":["../src/analyze.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,8CAAuB;AACvB,6CAA+B;AAE/B,uCAAuC;AACvC,qCAAqC;AACrC,mDAA0C;AAC1C,2CAAuC;AACvC,uCAA4C;AAC5C,mDAKyB;AACzB,wDAA0C;AAC1C,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB;;;;;GAKG;AACH,IAAA,aAAI,EAAC,sBAAsB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACvC,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAC5C,IAAA,gCAAgB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAEjC,MAAM,UAAU,GAAG,EAAE,CAAC;QACtB,MAAM,eAAe,GAAG,EAAE,CAAC;QAC3B,MAAM,WAAW,GAAG,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;QAEjD,KAAK,MAAM,QAAQ,IAAI,MA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AAC;gBACrB,OAAO,EAAE,MAAM;gBACf,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,kBAAkB,CAAC;aACrD,CAAC,CAAC;YACH,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;gBACzD,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;YAEH,MAAM,YAAY,GAAG,MAAM,IAAA,oBAAU,EACnC,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,EACX,SAAS,EACT,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"}
|
||||||
24
lib/api-client.js
generated
24
lib/api-client.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
24
lib/api-client.test.js
generated
24
lib/api-client.test.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"api-client.test.js","sourceRoot":"","sources":["../src/api-client.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA0C;AAC1C,uEAAyD;AACzD,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,kDAAoC;AACpC,mDAA6C;AAC7C,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,UAAU,CAAC,GAAG,EAAE;IACnB,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAC7D,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,cAAc,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/B,MAAM,UAAU,GAAoB,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAoB,KAAK,CAAC,IAAI,EAAE,CAAC;IACjD,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAE/B,KAAK,CAAC,IAAI,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AC;AAEH,IAAA,aAAI,EAAC,iCAAiC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAClD,wBAAwB,CAAC,SAAS,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,uBAAuB,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE;QACtE,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,qBAAqB;QAC1B,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;IACH,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,EAAE,SAAS,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC"}
|
||||||
@@ -1 +1 @@
|
|||||||
{ "maximumVersion": "3.15", "minimumVersion": "3.11" }
|
{ "maximumVersion": "3.16", "minimumVersion": "3.11" }
|
||||||
|
|||||||
24
lib/autobuild-action.js
generated
24
lib/autobuild-action.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
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");
|
||||||
|
|||||||
@@ -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,qCAAqC;AACrC,iDAAmD;AACnD,+CAAuC;AAEvC,uCAAqD;AACrD,mDAMyB;AACzB,mDAAuD;AACvD,iCAOgB;AAShB,KAAK,UAAU,yBAAyB,CACtC,MAA0B,EAC1B,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,0BAAU,CAAC,SAAS,EACpB,MAAM,EACN,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,MAAM,EACN,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,KAAK,CACb,CAAC;IACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,YAAY,GAA0B;YAC1C,GAAG,gBAAgB;YACnB,mBAAmB,EAAE,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;YAC3C,iBAAiB,EAAE,eAAe;SACnC,CAAC;QACF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B,MAAM,IAAA,oCAAoB,EAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACrD,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,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,MAAM,EAAE,SAAS,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;AAC9E,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,sBAAe,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||||
27
lib/autobuild.js
generated
27
lib/autobuild.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.determineAutobuildLanguages = determineAutobuildLanguages;
|
exports.determineAutobuildLanguages = determineAutobuildLanguages;
|
||||||
exports.setupCppAutobuild = setupCppAutobuild;
|
exports.setupCppAutobuild = setupCppAutobuild;
|
||||||
@@ -41,7 +51,8 @@ async function determineAutobuildLanguages(codeql, config, logger) {
|
|||||||
if ((config.buildMode === util_1.BuildMode.None &&
|
if ((config.buildMode === util_1.BuildMode.None &&
|
||||||
(await codeql.supportsFeature(tools_features_1.ToolsFeature.TraceCommandUseBuildMode))) ||
|
(await codeql.supportsFeature(tools_features_1.ToolsFeature.TraceCommandUseBuildMode))) ||
|
||||||
config.buildMode === util_1.BuildMode.Manual) {
|
config.buildMode === util_1.BuildMode.Manual) {
|
||||||
logger.info(`Using ${config.buildMode} build mode, nothing to autobuild.`);
|
logger.info(`Using build mode "${config.buildMode}", nothing to autobuild. ` +
|
||||||
|
`See ${doc_url_1.DocUrl.CODEQL_BUILD_MODES} for more information.`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
// Attempt to find a language to autobuild
|
// Attempt to find a language to autobuild
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"autobuild.js","sourceRoot":"","sources":["../src/autobuild.ts"],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C,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,MAA0B,EAC1B,QAAkB,EAClB,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,IACE,MAAM,CAAC,SAAS;QAChB,CAAC,MAAM,MAAM,CAAC,eAAe,CAAC,6BAAY,CAAC,wBAAwB,CAAC,CAAC,EACrE,CAAC;QACD,MAAM,MAAM,CAAC,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACvD,CAAC;SAAM,CAAC;QACN,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IACD,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"}
|
||||||
29
lib/caching-utils.js
generated
29
lib/caching-utils.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.CachingKind = void 0;
|
exports.CachingKind = void 0;
|
||||||
exports.getTotalCacheSize = getTotalCacheSize;
|
exports.getTotalCacheSize = getTotalCacheSize;
|
||||||
@@ -37,10 +47,11 @@ const util_1 = require("./util");
|
|||||||
* Returns the total size of all the specified paths.
|
* Returns the total size of all the specified paths.
|
||||||
* @param paths The paths for which to calculate the total size.
|
* @param paths The paths for which to calculate the total size.
|
||||||
* @param logger A logger to record some informational messages to.
|
* @param logger A logger to record some informational messages to.
|
||||||
|
* @param quiet A value indicating whether to suppress logging warnings (default: false).
|
||||||
* @returns The total size of all specified paths.
|
* @returns The total size of all specified paths.
|
||||||
*/
|
*/
|
||||||
async function getTotalCacheSize(paths, logger) {
|
async function getTotalCacheSize(paths, logger, quiet = false) {
|
||||||
const sizes = await Promise.all(paths.map((cacheDir) => (0, util_1.tryGetFolderBytes)(cacheDir, logger)));
|
const sizes = await Promise.all(paths.map((cacheDir) => (0, util_1.tryGetFolderBytes)(cacheDir, logger, quiet)));
|
||||||
return sizes.map((a) => a || 0).reduce((a, b) => a + b, 0);
|
return sizes.map((a) => a || 0).reduce((a, b) => a + b, 0);
|
||||||
}
|
}
|
||||||
/* Enumerates caching modes. */
|
/* Enumerates caching modes. */
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"caching-utils.js","sourceRoot":"","sources":["../src/caching-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,8CAQC;AAeD,4CAEC;AAGD,gDAEC;AAKD,wCAqBC;AAGD,kEAgBC;AAxFD,oDAAsC;AAEtC,iDAAkE;AAClE,+CAAuC;AAEvC,iCAA2D;AAE3D;;;;;GAKG;AACI,KAAK,UAAU,iBAAiB,CACrC,KAAe,EACf,MAAc;IAEd,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAC7B,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAA,wBAAiB,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAC7D,CAAC;IACF,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,+BAA+B;AAC/B,IAAY,WASX;AATD,WAAY,WAAW;IACrB,0CAA0C;IAC1C,4BAAa,CAAA;IACb,0DAA0D;IAC1D,8BAAe,CAAA;IACf,8DAA8D;IAC9D,kCAAmB,CAAA;IACnB,mDAAmD;IACnD,4BAAa,CAAA;AACf,CAAC,EATW,WAAW,2BAAX,WAAW,QAStB;AAED,uFAAuF;AACvF,SAAgB,gBAAgB,CAAC,IAAiB;IAChD,OAAO,IAAI,KAAK,WAAW,CAAC,IAAI,IAAI,IAAI,KAAK,WAAW,CAAC,KAAK,CAAC;AACjE,CAAC;AAED,8FAA8F;AAC9F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AQ,KAAK,EAAE,CAAC;QACd,KAAK,SAAS,CAAC;QACf,KAAK,MAAM,CAAC;QACZ,KAAK,KAAK,CAAC;QACX,KAAK,OAAO;YACV,OAAO,WAAW,CAAC,IAAI,CAAC;QAC1B,KAAK,MAAM,CAAC;QACZ,KAAK,IAAI,CAAC;QACV,KAAK,MAAM;YACT,OAAO,WAAW,CAAC,IAAI,CAAC;QAC1B,KAAK,OAAO;YACV,OAAO,WAAW,CAAC,KAAK,CAAC;QAC3B,KAAK,SAAS;YACZ,OAAO,WAAW,CAAC,OAAO,CAAC;QAC7B;YACE,IAAI,CAAC,OAAO,CACV,4CAA4C,KAAK,yBAAyB,CAC3E,CAAC;YACF,OAAO,WAAW,CAAC,IAAI,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,wDAAwD;AACxD,SAAgB,2BAA2B;IACzC,0DAA0D;IAC1D,MAAM,iBAAiB,GACrB,IAAA,+BAAgB,EAAC,oBAAoB,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,oBAAM,CAAC,kBAAkB,CAAC,CAAC;IACzC,IAAI,iBAAiB,KAAK,SAAS;QAAE,OAAO,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAE9E,qGAAqG;IACrG,IAAI,CAAC,IAAA,qBAAc,GAAE;QAAE,OAAO,WAAW,CAAC,IAAI,CAAC;IAE/C,4CAA4C;IAC5C,IAAI,CAAC,IAAA,6BAAc,GAAE;QAAE,OAAO,WAAW,CAAC,IAAI,CAAC;IAE/C,4DAA4D;IAC5D,4DAA4D;IAC5D,OAAO,WAAW,CAAC,IAAI,CAAC;AAC1B,CAAC"}
|
||||||
41
lib/codeql.js
generated
41
lib/codeql.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE = exports.CODEQL_VERSION_ANALYSIS_SUMMARY_V2 = void 0;
|
exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE = exports.CODEQL_VERSION_ANALYSIS_SUMMARY_V2 = void 0;
|
||||||
exports.setupCodeQL = setupCodeQL;
|
exports.setupCodeQL = setupCodeQL;
|
||||||
@@ -45,6 +55,7 @@ const cli_errors_1 = require("./cli-errors");
|
|||||||
const doc_url_1 = require("./doc-url");
|
const doc_url_1 = require("./doc-url");
|
||||||
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 git_utils_1 = require("./git-utils");
|
||||||
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 tools_features_1 = require("./tools-features");
|
||||||
@@ -64,19 +75,19 @@ let cachedCodeQL = undefined;
|
|||||||
* The version flags below can be used to conditionally enable certain features
|
* The version flags below can be used to conditionally enable certain features
|
||||||
* on versions newer than this.
|
* on versions newer than this.
|
||||||
*/
|
*/
|
||||||
const CODEQL_MINIMUM_VERSION = "2.14.6";
|
const CODEQL_MINIMUM_VERSION = "2.15.5";
|
||||||
/**
|
/**
|
||||||
* This version will shortly become the oldest version of CodeQL that the Action will run with.
|
* This version will shortly become the oldest version of CodeQL that the Action will run with.
|
||||||
*/
|
*/
|
||||||
const CODEQL_NEXT_MINIMUM_VERSION = "2.14.6";
|
const CODEQL_NEXT_MINIMUM_VERSION = "2.15.5";
|
||||||
/**
|
/**
|
||||||
* This is the version of GHES that was most recently deprecated.
|
* This is the version of GHES that was most recently deprecated.
|
||||||
*/
|
*/
|
||||||
const GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.10";
|
const GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.11";
|
||||||
/**
|
/**
|
||||||
* This is the deprecation date for the version of GHES that was most recently deprecated.
|
* This is the deprecation date for the version of GHES that was most recently deprecated.
|
||||||
*/
|
*/
|
||||||
const GHES_MOST_RECENT_DEPRECATION_DATE = "2024-09-24";
|
const GHES_MOST_RECENT_DEPRECATION_DATE = "2024-12-19";
|
||||||
/** The CLI verbosity level to use for extraction in debug mode. */
|
/** The CLI verbosity level to use for extraction in debug mode. */
|
||||||
const EXTRACTION_DEBUG_MODE_VERBOSITY = "progress++";
|
const EXTRACTION_DEBUG_MODE_VERBOSITY = "progress++";
|
||||||
/*
|
/*
|
||||||
@@ -115,9 +126,9 @@ const CODEQL_VERSION_CACHE_CLEANUP = "2.17.1";
|
|||||||
* version requirement. Must be set to true outside tests.
|
* version requirement. Must be set to true outside tests.
|
||||||
* @returns a { CodeQL, toolsVersion } object.
|
* @returns a { CodeQL, toolsVersion } object.
|
||||||
*/
|
*/
|
||||||
async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger, checkVersion) {
|
async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger, features, checkVersion) {
|
||||||
try {
|
try {
|
||||||
const { codeqlFolder, toolsDownloadStatusReport, toolsSource, toolsVersion, zstdAvailability, } = await setupCodeql.setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger);
|
const { codeqlFolder, toolsDownloadStatusReport, toolsSource, toolsVersion, zstdAvailability, } = await setupCodeql.setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, features, defaultCliVersion, logger);
|
||||||
logger.debug(`Bundle download status report: ${JSON.stringify(toolsDownloadStatusReport)}`);
|
logger.debug(`Bundle download status report: ${JSON.stringify(toolsDownloadStatusReport)}`);
|
||||||
let codeqlCmd = path.join(codeqlFolder, "codeql", "codeql");
|
let codeqlCmd = path.join(codeqlFolder, "codeql", "codeql");
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
@@ -136,7 +147,7 @@ async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliV
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
throw new Error(`Unable to download and extract CodeQL CLI: ${(0, util_1.getErrorMessage)(e)}`);
|
throw new Error(`Unable to download and extract CodeQL CLI: ${(0, util_1.getErrorMessage)(e)}${e instanceof Error && e.stack ? `\n\nDetails: ${e.stack}` : ""}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -820,7 +831,7 @@ async function getTrapCachingExtractorConfigArgsForLang(config, language) {
|
|||||||
const cacheDir = config.trapCaches[language];
|
const cacheDir = config.trapCaches[language];
|
||||||
if (cacheDir === undefined)
|
if (cacheDir === undefined)
|
||||||
return [];
|
return [];
|
||||||
const write = await (0, actions_util_1.isAnalyzingDefaultBranch)();
|
const write = await (0, git_utils_1.isAnalyzingDefaultBranch)();
|
||||||
return [
|
return [
|
||||||
`-O=${language}.trap.cache.dir=${cacheDir}`,
|
`-O=${language}.trap.cache.dir=${cacheDir}`,
|
||||||
`-O=${language}.trap.cache.bound=${TRAP_CACHE_SIZE_MB}`,
|
`-O=${language}.trap.cache.bound=${TRAP_CACHE_SIZE_MB}`,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
82
lib/codeql.test.js
generated
82
lib/codeql.test.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@@ -29,8 +39,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
exports.stubToolRunnerConstructor = stubToolRunnerConstructor;
|
exports.stubToolRunnerConstructor = stubToolRunnerConstructor;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
||||||
|
const io = __importStar(require("@actions/io"));
|
||||||
const toolcache = __importStar(require("@actions/tool-cache"));
|
const toolcache = __importStar(require("@actions/tool-cache"));
|
||||||
const safeWhich = __importStar(require("@chrisgavin/safe-which"));
|
|
||||||
const ava_1 = __importDefault(require("ava"));
|
const ava_1 = __importDefault(require("ava"));
|
||||||
const del_1 = __importDefault(require("del"));
|
const del_1 = __importDefault(require("del"));
|
||||||
const yaml = __importStar(require("js-yaml"));
|
const yaml = __importStar(require("js-yaml"));
|
||||||
@@ -50,6 +60,7 @@ const util = __importStar(require("./util"));
|
|||||||
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);
|
||||||
let stubConfig;
|
let stubConfig;
|
||||||
|
const NO_FEATURES = (0, testing_utils_1.createFeatures)([]);
|
||||||
ava_1.default.beforeEach(() => {
|
ava_1.default.beforeEach(() => {
|
||||||
(0, util_1.initializeEnvironment)("1.2.3");
|
(0, util_1.initializeEnvironment)("1.2.3");
|
||||||
stubConfig = (0, testing_utils_1.createTestConfig)({
|
stubConfig = (0, testing_utils_1.createTestConfig)({
|
||||||
@@ -60,7 +71,7 @@ async function installIntoToolcache({ apiDetails = testing_utils_1.SAMPLE_DOTCOM
|
|||||||
const url = (0, testing_utils_1.mockBundleDownloadApi)({ apiDetails, isPinned, tagName });
|
const url = (0, testing_utils_1.mockBundleDownloadApi)({ apiDetails, isPinned, tagName });
|
||||||
await codeql.setupCodeQL(cliVersion !== undefined ? undefined : url, apiDetails, tmpDir, util.GitHubVariant.GHES, cliVersion !== undefined
|
await codeql.setupCodeQL(cliVersion !== undefined ? undefined : url, apiDetails, tmpDir, util.GitHubVariant.GHES, cliVersion !== undefined
|
||||||
? { cliVersion, tagName }
|
? { cliVersion, tagName }
|
||||||
: testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
: testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), NO_FEATURES, false);
|
||||||
}
|
}
|
||||||
function mockReleaseApi({ apiDetails = testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, assetNames, tagName, }) {
|
function mockReleaseApi({ apiDetails = testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, assetNames, tagName, }) {
|
||||||
return (0, nock_1.default)(apiDetails.apiURL)
|
return (0, nock_1.default)(apiDetails.apiURL)
|
||||||
@@ -81,11 +92,8 @@ function mockApiDetails(apiDetails) {
|
|||||||
.stub(actionsUtil, "getRequiredInput")
|
.stub(actionsUtil, "getRequiredInput")
|
||||||
.withArgs("token")
|
.withArgs("token")
|
||||||
.returns(apiDetails.auth);
|
.returns(apiDetails.auth);
|
||||||
const requiredEnvParamStub = sinon.stub(util, "getRequiredEnvParam");
|
process.env["GITHUB_SERVER_URL"] = apiDetails.url;
|
||||||
requiredEnvParamStub.withArgs("GITHUB_SERVER_URL").returns(apiDetails.url);
|
process.env["GITHUB_API_URL"] = apiDetails.apiURL || "";
|
||||||
requiredEnvParamStub
|
|
||||||
.withArgs("GITHUB_API_URL")
|
|
||||||
.returns(apiDetails.apiURL || "");
|
|
||||||
}
|
}
|
||||||
(0, ava_1.default)("downloads and caches explicitly requested bundles that aren't in the toolcache", async (t) => {
|
(0, ava_1.default)("downloads and caches explicitly requested bundles that aren't in the toolcache", async (t) => {
|
||||||
await util.withTmpDir(async (tmpDir) => {
|
await util.withTmpDir(async (tmpDir) => {
|
||||||
@@ -97,7 +105,7 @@ function mockApiDetails(apiDetails) {
|
|||||||
tagName: `codeql-bundle-${version}`,
|
tagName: `codeql-bundle-${version}`,
|
||||||
isPinned: false,
|
isPinned: false,
|
||||||
});
|
});
|
||||||
const result = await codeql.setupCodeQL(url, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
const result = await codeql.setupCodeQL(url, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), NO_FEATURES, false);
|
||||||
t.assert(toolcache.find("CodeQL", `0.0.0-${version}`));
|
t.assert(toolcache.find("CodeQL", `0.0.0-${version}`));
|
||||||
t.is(result.toolsVersion, `0.0.0-${version}`);
|
t.is(result.toolsVersion, `0.0.0-${version}`);
|
||||||
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
||||||
@@ -112,7 +120,7 @@ function mockApiDetails(apiDetails) {
|
|||||||
tagName: `codeql-bundle-v2.15.0`,
|
tagName: `codeql-bundle-v2.15.0`,
|
||||||
isPinned: false,
|
isPinned: false,
|
||||||
});
|
});
|
||||||
const result = await codeql.setupCodeQL(url, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
const result = await codeql.setupCodeQL(url, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), NO_FEATURES, false);
|
||||||
t.is(toolcache.findAllVersions("CodeQL").length, 1);
|
t.is(toolcache.findAllVersions("CodeQL").length, 1);
|
||||||
t.assert(toolcache.find("CodeQL", `2.15.0`));
|
t.assert(toolcache.find("CodeQL", `2.15.0`));
|
||||||
t.is(result.toolsVersion, `2.15.0`);
|
t.is(result.toolsVersion, `2.15.0`);
|
||||||
@@ -133,7 +141,7 @@ function mockApiDetails(apiDetails) {
|
|||||||
const url = (0, testing_utils_1.mockBundleDownloadApi)({
|
const url = (0, testing_utils_1.mockBundleDownloadApi)({
|
||||||
tagName: "codeql-bundle-20200610",
|
tagName: "codeql-bundle-20200610",
|
||||||
});
|
});
|
||||||
const result = await codeql.setupCodeQL(url, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
const result = await codeql.setupCodeQL(url, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), NO_FEATURES, false);
|
||||||
t.assert(toolcache.find("CodeQL", "0.0.0-20200610"));
|
t.assert(toolcache.find("CodeQL", "0.0.0-20200610"));
|
||||||
t.deepEqual(result.toolsVersion, "0.0.0-20200610");
|
t.deepEqual(result.toolsVersion, "0.0.0-20200610");
|
||||||
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
||||||
@@ -161,7 +169,7 @@ for (const { tagName, expectedToolcacheVersion, } of EXPLICITLY_REQUESTED_BUNDLE
|
|||||||
const url = (0, testing_utils_1.mockBundleDownloadApi)({
|
const url = (0, testing_utils_1.mockBundleDownloadApi)({
|
||||||
tagName,
|
tagName,
|
||||||
});
|
});
|
||||||
const result = await codeql.setupCodeQL(url, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
const result = await codeql.setupCodeQL(url, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), NO_FEATURES, false);
|
||||||
t.assert(toolcache.find("CodeQL", expectedToolcacheVersion));
|
t.assert(toolcache.find("CodeQL", expectedToolcacheVersion));
|
||||||
t.deepEqual(result.toolsVersion, expectedToolcacheVersion);
|
t.deepEqual(result.toolsVersion, expectedToolcacheVersion);
|
||||||
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
||||||
@@ -184,7 +192,7 @@ for (const toolcacheVersion of [
|
|||||||
.withArgs("CodeQL", toolcacheVersion)
|
.withArgs("CodeQL", toolcacheVersion)
|
||||||
.returns("path/to/cached/codeql");
|
.returns("path/to/cached/codeql");
|
||||||
sinon.stub(toolcache, "findAllVersions").returns([toolcacheVersion]);
|
sinon.stub(toolcache, "findAllVersions").returns([toolcacheVersion]);
|
||||||
const result = await codeql.setupCodeQL(undefined, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
const result = await codeql.setupCodeQL(undefined, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), NO_FEATURES, false);
|
||||||
t.is(result.toolsVersion, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION.cliVersion);
|
t.is(result.toolsVersion, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION.cliVersion);
|
||||||
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Toolcache);
|
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Toolcache);
|
||||||
t.is(result.toolsDownloadStatusReport?.combinedDurationMs, undefined);
|
t.is(result.toolsDownloadStatusReport?.combinedDurationMs, undefined);
|
||||||
@@ -204,7 +212,7 @@ for (const toolcacheVersion of [
|
|||||||
const result = await codeql.setupCodeQL(undefined, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.GHES, {
|
const result = await codeql.setupCodeQL(undefined, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.GHES, {
|
||||||
cliVersion: defaults.cliVersion,
|
cliVersion: defaults.cliVersion,
|
||||||
tagName: defaults.bundleVersion,
|
tagName: defaults.bundleVersion,
|
||||||
}, (0, logging_1.getRunnerLogger)(true), false);
|
}, (0, logging_1.getRunnerLogger)(true), NO_FEATURES, false);
|
||||||
t.deepEqual(result.toolsVersion, "0.0.0-20200601");
|
t.deepEqual(result.toolsVersion, "0.0.0-20200601");
|
||||||
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Toolcache);
|
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Toolcache);
|
||||||
t.is(result.toolsDownloadStatusReport?.combinedDurationMs, undefined);
|
t.is(result.toolsDownloadStatusReport?.combinedDurationMs, undefined);
|
||||||
@@ -228,7 +236,7 @@ for (const toolcacheVersion of [
|
|||||||
const result = await codeql.setupCodeQL(undefined, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.GHES, {
|
const result = await codeql.setupCodeQL(undefined, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.GHES, {
|
||||||
cliVersion: defaults.cliVersion,
|
cliVersion: defaults.cliVersion,
|
||||||
tagName: defaults.bundleVersion,
|
tagName: defaults.bundleVersion,
|
||||||
}, (0, logging_1.getRunnerLogger)(true), false);
|
}, (0, logging_1.getRunnerLogger)(true), NO_FEATURES, false);
|
||||||
t.deepEqual(result.toolsVersion, defaults.cliVersion);
|
t.deepEqual(result.toolsVersion, defaults.cliVersion);
|
||||||
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
||||||
if (result.toolsDownloadStatusReport) {
|
if (result.toolsDownloadStatusReport) {
|
||||||
@@ -249,7 +257,7 @@ for (const toolcacheVersion of [
|
|||||||
(0, testing_utils_1.mockBundleDownloadApi)({
|
(0, testing_utils_1.mockBundleDownloadApi)({
|
||||||
tagName: defaults.bundleVersion,
|
tagName: defaults.bundleVersion,
|
||||||
});
|
});
|
||||||
const result = await codeql.setupCodeQL("latest", testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
const result = await codeql.setupCodeQL("latest", testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), NO_FEATURES, false);
|
||||||
t.deepEqual(result.toolsVersion, defaults.cliVersion);
|
t.deepEqual(result.toolsVersion, defaults.cliVersion);
|
||||||
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
||||||
if (result.toolsDownloadStatusReport) {
|
if (result.toolsDownloadStatusReport) {
|
||||||
@@ -273,7 +281,7 @@ for (const toolcacheVersion of [
|
|||||||
platformSpecific: false,
|
platformSpecific: false,
|
||||||
tagName: "codeql-bundle-20230203",
|
tagName: "codeql-bundle-20230203",
|
||||||
});
|
});
|
||||||
const result = await codeql.setupCodeQL("https://github.com/codeql-testing/codeql-cli-nightlies/releases/download/codeql-bundle-20230203/codeql-bundle.tar.gz", testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
|
const result = await codeql.setupCodeQL("https://github.com/codeql-testing/codeql-cli-nightlies/releases/download/codeql-bundle-20230203/codeql-bundle.tar.gz", testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), NO_FEATURES, false);
|
||||||
t.is(result.toolsVersion, "0.0.0-20230203");
|
t.is(result.toolsVersion, "0.0.0-20230203");
|
||||||
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);
|
||||||
if (result.toolsDownloadStatusReport) {
|
if (result.toolsDownloadStatusReport) {
|
||||||
@@ -531,8 +539,8 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
|
|||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves(codeqlVersion);
|
sinon.stub(codeqlObject, "getVersion").resolves(codeqlVersion);
|
||||||
// safeWhich throws because of the test CodeQL object.
|
// io throws because of the test CodeQL object.
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
sinon.stub(io, "which").resolves("");
|
||||||
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", undefined, "", Object.assign({}, stubConfig, { gitHubVersion: githubVersion }), (0, testing_utils_1.createFeatures)([]));
|
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", undefined, "", Object.assign({}, stubConfig, { gitHubVersion: githubVersion }), (0, testing_utils_1.createFeatures)([]));
|
||||||
const actualArgs = runnerConstructorStub.firstCall.args[1];
|
const actualArgs = runnerConstructorStub.firstCall.args[1];
|
||||||
t.is(actualArgs.includes("--new-analysis-summary"), flagPassed, `--new-analysis-summary should${flagPassed ? "" : "n't"} be passed`);
|
t.is(actualArgs.includes("--new-analysis-summary"), flagPassed, `--new-analysis-summary should${flagPassed ? "" : "n't"} be passed`);
|
||||||
@@ -547,8 +555,8 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
|
|||||||
stubToolRunnerConstructor(32, cliStderr);
|
stubToolRunnerConstructor(32, cliStderr);
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
||||||
// safeWhich throws because of the test CodeQL object.
|
// io throws because of the test CodeQL object.
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
sinon.stub(io, "which").resolves("");
|
||||||
await t.throwsAsync(async () => await codeqlObject.finalizeDatabase("db", "--threads=2", "--ram=2048", false), {
|
await t.throwsAsync(async () => await codeqlObject.finalizeDatabase("db", "--threads=2", "--ram=2048", false), {
|
||||||
instanceOf: util.ConfigurationError,
|
instanceOf: util.ConfigurationError,
|
||||||
message: new RegExp('Encountered a fatal error while running \\"codeql-for-testing database finalize --finalize-dataset --threads=2 --ram=2048 db\\"\\. ' +
|
message: new RegExp('Encountered a fatal error while running \\"codeql-for-testing database finalize --finalize-dataset --threads=2 --ram=2048 db\\"\\. ' +
|
||||||
@@ -570,8 +578,8 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
|
|||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
||||||
sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
|
sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
|
||||||
// safeWhich throws because of the test CodeQL object.
|
// io throws because of the test CodeQL object.
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
sinon.stub(io, "which").resolves("");
|
||||||
await t.throwsAsync(async () => await codeqlObject.runAutobuild(stubConfig, languages_1.Language.java), {
|
await t.throwsAsync(async () => await codeqlObject.runAutobuild(stubConfig, languages_1.Language.java), {
|
||||||
instanceOf: util.ConfigurationError,
|
instanceOf: util.ConfigurationError,
|
||||||
message: "We were unable to automatically build your code. Please provide manual build steps. " +
|
message: "We were unable to automatically build your code. Please provide manual build steps. " +
|
||||||
@@ -588,8 +596,8 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
|
|||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
||||||
sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
|
sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
|
||||||
// safeWhich throws because of the test CodeQL object.
|
// io throws because of the test CodeQL object.
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
sinon.stub(io, "which").resolves("");
|
||||||
await t.throwsAsync(async () => await codeqlObject.runAutobuild(stubConfig, languages_1.Language.java), {
|
await t.throwsAsync(async () => await codeqlObject.runAutobuild(stubConfig, languages_1.Language.java), {
|
||||||
instanceOf: util.ConfigurationError,
|
instanceOf: util.ConfigurationError,
|
||||||
message: "We were unable to automatically build your code. Please provide manual build steps. " +
|
message: "We were unable to automatically build your code. Please provide manual build steps. " +
|
||||||
@@ -608,8 +616,8 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
|
|||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
||||||
sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
|
sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
|
||||||
// safeWhich throws because of the test CodeQL object.
|
// io throws because of the test CodeQL object.
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
sinon.stub(io, "which").resolves("");
|
||||||
await t.throwsAsync(async () => await codeqlObject.databaseRunQueries(stubConfig.dbLocation, []), {
|
await t.throwsAsync(async () => await codeqlObject.databaseRunQueries(stubConfig.dbLocation, []), {
|
||||||
instanceOf: cli_errors_1.CliError,
|
instanceOf: cli_errors_1.CliError,
|
||||||
message: `Encountered a fatal error while running "codeql-for-testing database run-queries --expect-discarded-cache --min-disk-free=1024 -v --intra-layer-parallelism". Exit code was 1 and error was: Oops! A fatal internal error occurred. Details:
|
message: `Encountered a fatal error while running "codeql-for-testing database run-queries --expect-discarded-cache --min-disk-free=1024 -v --intra-layer-parallelism". Exit code was 1 and error was: Oops! A fatal internal error occurred. Details:
|
||||||
@@ -622,8 +630,8 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
|
|||||||
stubToolRunnerConstructor(32, cliStderr);
|
stubToolRunnerConstructor(32, cliStderr);
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
||||||
// safeWhich throws because of the test CodeQL object.
|
// io throws because of the test CodeQL object.
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
sinon.stub(io, "which").resolves("");
|
||||||
await t.throwsAsync(async () => await codeqlObject.finalizeDatabase("db", "--threads=2", "--ram=2048", false), {
|
await t.throwsAsync(async () => await codeqlObject.finalizeDatabase("db", "--threads=2", "--ram=2048", false), {
|
||||||
instanceOf: util.ConfigurationError,
|
instanceOf: util.ConfigurationError,
|
||||||
message: new RegExp('Encountered a fatal error while running \\"codeql-for-testing database finalize --finalize-dataset --threads=2 --ram=2048 db\\"\\. ' +
|
message: new RegExp('Encountered a fatal error while running \\"codeql-for-testing database finalize --finalize-dataset --threads=2 --ram=2048 db\\"\\. ' +
|
||||||
@@ -634,8 +642,8 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
|
|||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
|
||||||
// safeWhich throws because of the test CodeQL object.
|
// io throws because of the test CodeQL object.
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
sinon.stub(io, "which").resolves("");
|
||||||
process.env["CODEQL_ACTION_EXTRA_OPTIONS"] =
|
process.env["CODEQL_ACTION_EXTRA_OPTIONS"] =
|
||||||
'{ "database": { "init": ["--overwrite"] } }';
|
'{ "database": { "init": ["--overwrite"] } }';
|
||||||
await codeqlObject.databaseInitCluster(stubConfig, "sourceRoot", undefined, undefined, (0, logging_1.getRunnerLogger)(false));
|
await codeqlObject.databaseInitCluster(stubConfig, "sourceRoot", undefined, undefined, (0, logging_1.getRunnerLogger)(false));
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
26
lib/config-utils.js
generated
26
lib/config-utils.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.defaultAugmentationProperties = void 0;
|
exports.defaultAugmentationProperties = void 0;
|
||||||
exports.getPacksStrInvalid = getPacksStrInvalid;
|
exports.getPacksStrInvalid = getPacksStrInvalid;
|
||||||
@@ -323,7 +333,7 @@ function parseQueriesFromInput(rawQueriesInput, queriesInputCombines) {
|
|||||||
}
|
}
|
||||||
const trimmedInput = queriesInputCombines
|
const trimmedInput = 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.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."));
|
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."));
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
24
lib/config-utils.test.js
generated
24
lib/config-utils.test.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
29
lib/database-upload.js
generated
29
lib/database-upload.js
generated
@@ -15,19 +15,30 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.uploadDatabases = uploadDatabases;
|
exports.uploadDatabases = uploadDatabases;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
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");
|
||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
|
const gitUtils = __importStar(require("./git-utils"));
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
||||||
@@ -45,7 +56,7 @@ async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
|||||||
logger.debug("Not running against github.com or GHEC-DR. Skipping upload.");
|
logger.debug("Not running against github.com or GHEC-DR. Skipping upload.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(await actionsUtil.isAnalyzingDefaultBranch())) {
|
if (!(await gitUtils.isAnalyzingDefaultBranch())) {
|
||||||
// We only want to upload a database if we are analyzing the default branch.
|
// We only want to upload a database if we are analyzing the default branch.
|
||||||
logger.debug("Not analyzing default branch. Skipping upload.");
|
logger.debug("Not analyzing default branch. Skipping upload.");
|
||||||
return;
|
return;
|
||||||
@@ -69,7 +80,7 @@ async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
|||||||
const bundledDb = await (0, util_1.bundleDb)(config, language, codeql, language);
|
const bundledDb = await (0, util_1.bundleDb)(config, language, codeql, language);
|
||||||
const bundledDbSize = fs.statSync(bundledDb).size;
|
const bundledDbSize = fs.statSync(bundledDb).size;
|
||||||
const bundledDbReadStream = fs.createReadStream(bundledDb);
|
const bundledDbReadStream = fs.createReadStream(bundledDb);
|
||||||
const commitOid = await actionsUtil.getCommitOid(actionsUtil.getRequiredInput("checkout_path"));
|
const commitOid = await gitUtils.getCommitOid(actionsUtil.getRequiredInput("checkout_path"));
|
||||||
try {
|
try {
|
||||||
await client.request(`POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, {
|
await client.request(`POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, {
|
||||||
baseUrl: uploadsBaseU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BACvB,KAAK,EAAE,aAAa,CAAC,KAAK;oBAC1B,IAAI,EAAE,aAAa,CAAC,IAAI;oBACxB,QAAQ;oBACR,IAAI,EAAE,GAAG,QAAQ,WAAW;oBAC5B,UAAU,EAAE,SAAS;oBACrB,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE;wBACP,aAAa,EAAE,SAAS,UAAU,CAAC,IAAI,EAAE;wBACzC,cAAc,EAAE,iBAAiB;wBACjC,gBAAgB,EAAE,aAAa;qBAChC;iBACF,CACF,CAAC;gBACF,MAAM,CAAC,KAAK,CAAC,sCAAsC,QAAQ,EAAE,CAAC,CAAC;YACjE,CAAC;oBAAS,CAAC;gBACT,mBAAmB,CAAC,KAAK,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,4CAA4C;YAC5C,MAAM,CAAC,OAAO,CAAC,iCAAiC,QAAQ,KAAK,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;AACH,CAAC"}
|
||||||
37
lib/database-upload.test.js
generated
37
lib/database-upload.test.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@@ -34,6 +44,7 @@ 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 database_upload_1 = require("./database-upload");
|
const database_upload_1 = require("./database-upload");
|
||||||
|
const gitUtils = __importStar(require("./git-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 util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
@@ -75,7 +86,7 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
|||||||
.stub(actionsUtil, "getRequiredInput")
|
.stub(actionsUtil, "getRequiredInput")
|
||||||
.withArgs("upload-database")
|
.withArgs("upload-database")
|
||||||
.returns("false");
|
.returns("false");
|
||||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
|
||||||
const loggedMessages = [];
|
const loggedMessages = [];
|
||||||
await (0, database_upload_1.uploadDatabases)(testRepoName, getTestConfig(tmpDir), testApiDetails, (0, testing_utils_1.getRecordingLogger)(loggedMessages));
|
await (0, database_upload_1.uploadDatabases)(testRepoName, getTestConfig(tmpDir), testApiDetails, (0, testing_utils_1.getRecordingLogger)(loggedMessages));
|
||||||
t.assert(loggedMessages.find((v) => v.type === "debug" &&
|
t.assert(loggedMessages.find((v) => v.type === "debug" &&
|
||||||
@@ -90,7 +101,7 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
|||||||
.stub(actionsUtil, "getRequiredInput")
|
.stub(actionsUtil, "getRequiredInput")
|
||||||
.withArgs("upload-database")
|
.withArgs("upload-database")
|
||||||
.returns("true");
|
.returns("true");
|
||||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
|
||||||
const config = getTestConfig(tmpDir);
|
const config = getTestConfig(tmpDir);
|
||||||
config.gitHubVersion = { type: util_1.GitHubVariant.GHES, version: "3.0" };
|
config.gitHubVersion = { type: util_1.GitHubVariant.GHES, version: "3.0" };
|
||||||
const loggedMessages = [];
|
const loggedMessages = [];
|
||||||
@@ -107,7 +118,7 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
|||||||
.stub(actionsUtil, "getRequiredInput")
|
.stub(actionsUtil, "getRequiredInput")
|
||||||
.withArgs("upload-database")
|
.withArgs("upload-database")
|
||||||
.returns("true");
|
.returns("true");
|
||||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(false);
|
sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(false);
|
||||||
const loggedMessages = [];
|
const loggedMessages = [];
|
||||||
await (0, database_upload_1.uploadDatabases)(testRepoName, getTestConfig(tmpDir), testApiDetails, (0, testing_utils_1.getRecordingLogger)(loggedMessages));
|
await (0, database_upload_1.uploadDatabases)(testRepoName, getTestConfig(tmpDir), testApiDetails, (0, testing_utils_1.getRecordingLogger)(loggedMessages));
|
||||||
t.assert(loggedMessages.find((v) => v.type === "debug" &&
|
t.assert(loggedMessages.find((v) => v.type === "debug" &&
|
||||||
@@ -121,7 +132,7 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
|||||||
.stub(actionsUtil, "getRequiredInput")
|
.stub(actionsUtil, "getRequiredInput")
|
||||||
.withArgs("upload-database")
|
.withArgs("upload-database")
|
||||||
.returns("true");
|
.returns("true");
|
||||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
|
||||||
await mockHttpRequests(500);
|
await mockHttpRequests(500);
|
||||||
(0, codeql_1.setCodeQL)({
|
(0, codeql_1.setCodeQL)({
|
||||||
async databaseBundle(_, outputFilePath) {
|
async databaseBundle(_, outputFilePath) {
|
||||||
@@ -142,7 +153,7 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
|||||||
.stub(actionsUtil, "getRequiredInput")
|
.stub(actionsUtil, "getRequiredInput")
|
||||||
.withArgs("upload-database")
|
.withArgs("upload-database")
|
||||||
.returns("true");
|
.returns("true");
|
||||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
|
||||||
await mockHttpRequests(201);
|
await mockHttpRequests(201);
|
||||||
(0, codeql_1.setCodeQL)({
|
(0, codeql_1.setCodeQL)({
|
||||||
async databaseBundle(_, outputFilePath) {
|
async databaseBundle(_, outputFilePath) {
|
||||||
@@ -162,7 +173,7 @@ async function mockHttpRequests(databaseUploadStatusCode) {
|
|||||||
.stub(actionsUtil, "getRequiredInput")
|
.stub(actionsUtil, "getRequiredInput")
|
||||||
.withArgs("upload-database")
|
.withArgs("upload-database")
|
||||||
.returns("true");
|
.returns("true");
|
||||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
|
||||||
const databaseUploadSpy = await mockHttpRequests(201);
|
const databaseUploadSpy = await mockHttpRequests(201);
|
||||||
(0, codeql_1.setCodeQL)({
|
(0, codeql_1.setCodeQL)({
|
||||||
async databaseBundle(_, outputFilePath) {
|
async databaseBundle(_, outputFilePath) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
43
lib/debug-artifacts.js
generated
43
lib/debug-artifacts.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@@ -42,7 +52,6 @@ const actions_util_1 = require("./actions-util");
|
|||||||
const analyze_1 = require("./analyze");
|
const analyze_1 = require("./analyze");
|
||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
const environment_1 = require("./environment");
|
const environment_1 = require("./environment");
|
||||||
const feature_flags_1 = require("./feature-flags");
|
|
||||||
const logging_1 = require("./logging");
|
const logging_1 = require("./logging");
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
function sanitizeArtifactName(name) {
|
function sanitizeArtifactName(name) {
|
||||||
@@ -52,7 +61,7 @@ function sanitizeArtifactName(name) {
|
|||||||
* Upload Actions SARIF artifacts for debugging when CODEQL_ACTION_DEBUG_COMBINED_SARIF
|
* Upload Actions SARIF artifacts for debugging when CODEQL_ACTION_DEBUG_COMBINED_SARIF
|
||||||
* environment variable is set
|
* environment variable is set
|
||||||
*/
|
*/
|
||||||
async function uploadCombinedSarifArtifacts(logger, gitHubVariant, features) {
|
async function uploadCombinedSarifArtifacts(logger, gitHubVariant) {
|
||||||
const tempDir = (0, actions_util_1.getTemporaryDirectory)();
|
const tempDir = (0, actions_util_1.getTemporaryDirectory)();
|
||||||
// Upload Actions SARIF artifacts for debugging when environment variable is set
|
// Upload Actions SARIF artifacts for debugging when environment variable is set
|
||||||
if (process.env["CODEQL_ACTION_DEBUG_COMBINED_SARIF"] === "true") {
|
if (process.env["CODEQL_ACTION_DEBUG_COMBINED_SARIF"] === "true") {
|
||||||
@@ -71,7 +80,7 @@ async function uploadCombinedSarifArtifacts(logger, gitHubVariant, features) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await uploadDebugArtifacts(logger, toUpload, baseTempDir, "combined-sarif-artifacts", gitHubVariant, features);
|
await uploadDebugArtifacts(logger, toUpload, baseTempDir, "combined-sarif-artifacts", gitHubVariant);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
logger.warning(`Failed to upload combined SARIF files as Actions debugging artifact. Reason: ${(0, util_1.getErrorMessage)(e)}`);
|
logger.warning(`Failed to upload combined SARIF files as Actions debugging artifact. Reason: ${(0, util_1.getErrorMessage)(e)}`);
|
||||||
@@ -131,7 +140,7 @@ async function tryBundleDatabase(config, language, logger) {
|
|||||||
*
|
*
|
||||||
* Logs and suppresses any errors that occur.
|
* Logs and suppresses any errors that occur.
|
||||||
*/
|
*/
|
||||||
async function tryUploadAllAvailableDebugArtifacts(config, logger, features) {
|
async function tryUploadAllAvailableDebugArtifacts(config, logger) {
|
||||||
const filesToUpload = [];
|
const filesToUpload = [];
|
||||||
try {
|
try {
|
||||||
for (const language of config.languages) {
|
for (const language of config.languages) {
|
||||||
@@ -171,13 +180,13 @@ async function tryUploadAllAvailableDebugArtifacts(config, logger, features) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await (0, logging_1.withGroup)("Uploading debug artifacts", async () => uploadDebugArtifacts(logger, filesToUpload, config.dbLocation, config.debugArtifactName, config.gitHubVersion.type, features));
|
await (0, logging_1.withGroup)("Uploading debug artifacts", async () => uploadDebugArtifacts(logger, filesToUpload, config.dbLocation, config.debugArtifactName, config.gitHubVersion.type));
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
logger.warning(`Failed to upload debug artifacts. Reason: ${(0, util_1.getErrorMessage)(e)}`);
|
logger.warning(`Failed to upload debug artifacts. Reason: ${(0, util_1.getErrorMessage)(e)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghVariant, features) {
|
async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghVariant) {
|
||||||
if (toUpload.length === 0) {
|
if (toUpload.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -192,7 +201,7 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV
|
|||||||
core.info("Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input.");
|
core.info("Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const artifactUploader = await getArtifactUploaderClient(logger, ghVariant, features);
|
const artifactUploader = await getArtifactUploaderClient(logger, ghVariant);
|
||||||
try {
|
try {
|
||||||
await artifactUploader.uploadArtifact(sanitizeArtifactName(`${artifactName}${suffix}`), toUpload.map((file) => path.normalize(file)), path.normalize(rootDir), {
|
await artifactUploader.uploadArtifact(sanitizeArtifactName(`${artifactName}${suffix}`), toUpload.map((file) => path.normalize(file)), path.normalize(rootDir), {
|
||||||
// ensure we don't keep the debug artifacts around for too long since they can be large.
|
// ensure we don't keep the debug artifacts around for too long since they can be large.
|
||||||
@@ -208,15 +217,11 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV
|
|||||||
// until it is supported. We also use the legacy version of the client if the feature flag is disabled.
|
// until it is supported. We also use the legacy version of the client if the feature flag is disabled.
|
||||||
// The feature flag is named `ArtifactV4Upgrade` to reduce customer confusion; customers are primarily affected by
|
// The feature flag is named `ArtifactV4Upgrade` to reduce customer confusion; customers are primarily affected by
|
||||||
// `actions/download-artifact`, whose upgrade to v4 must be accompanied by the `@actions/artifact@v2` upgrade.
|
// `actions/download-artifact`, whose upgrade to v4 must be accompanied by the `@actions/artifact@v2` upgrade.
|
||||||
async function getArtifactUploaderClient(logger, ghVariant, features) {
|
async function getArtifactUploaderClient(logger, ghVariant) {
|
||||||
if (ghVariant === util_1.GitHubVariant.GHES) {
|
if (ghVariant === util_1.GitHubVariant.GHES) {
|
||||||
logger.info("Debug artifacts can be consumed with `actions/download-artifact@v3` because the `v4` version is not yet compatible on GHES.");
|
logger.info("Debug artifacts can be consumed with `actions/download-artifact@v3` because the `v4` version is not yet compatible on GHES.");
|
||||||
return artifactLegacy.create();
|
return artifactLegacy.create();
|
||||||
}
|
}
|
||||||
else if (!(await features.getValue(feature_flags_1.Feature.ArtifactV4Upgrade))) {
|
|
||||||
logger.info("Debug artifacts can be consumed with `actions/download-artifact@v3`. To use the `actions/download-artifact@v4`, set the `CODEQL_ACTION_ARTIFACT_V4_UPGRADE` environment variable to true.");
|
|
||||||
return artifactLegacy.create();
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
logger.info("Debug artifacts can be consumed with `actions/download-artifact@v4`.");
|
logger.info("Debug artifacts can be consumed with `actions/download-artifact@v4`.");
|
||||||
return new artifact.DefaultArtifactClient();
|
return new artifact.DefaultArtifactClient();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
29
lib/debug-artifacts.test.js
generated
29
lib/debug-artifacts.test.js
generated
@@ -15,22 +15,30 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
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 });
|
||||||
const ava_1 = __importDefault(require("ava"));
|
const ava_1 = __importDefault(require("ava"));
|
||||||
const debugArtifacts = __importStar(require("./debug-artifacts"));
|
const debugArtifacts = __importStar(require("./debug-artifacts"));
|
||||||
const feature_flags_1 = require("./feature-flags");
|
|
||||||
const logging_1 = require("./logging");
|
const logging_1 = require("./logging");
|
||||||
const testing_utils_1 = require("./testing-utils");
|
|
||||||
const util_1 = require("./util");
|
const util_1 = require("./util");
|
||||||
(0, ava_1.default)("sanitizeArtifactName", (t) => {
|
(0, ava_1.default)("sanitizeArtifactName", (t) => {
|
||||||
t.deepEqual(debugArtifacts.sanitizeArtifactName("hello-world_"), "hello-world_");
|
t.deepEqual(debugArtifacts.sanitizeArtifactName("hello-world_"), "hello-world_");
|
||||||
@@ -41,7 +49,6 @@ const util_1 = require("./util");
|
|||||||
(0, ava_1.default)("uploadDebugArtifacts", async (t) => {
|
(0, ava_1.default)("uploadDebugArtifacts", async (t) => {
|
||||||
// Test that no error is thrown if artifacts list is empty.
|
// Test that no error is thrown if artifacts list is empty.
|
||||||
const logger = (0, logging_1.getActionsLogger)();
|
const logger = (0, logging_1.getActionsLogger)();
|
||||||
const mockFeature = (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.ArtifactV4Upgrade]);
|
await t.notThrowsAsync(debugArtifacts.uploadDebugArtifacts(logger, [], "rootDir", "artifactName", util_1.GitHubVariant.DOTCOM));
|
||||||
await t.notThrowsAsync(debugArtifacts.uploadDebugArtifacts(logger, [], "rootDir", "artifactName", util_1.GitHubVariant.DOTCOM, mockFeature));
|
|
||||||
});
|
});
|
||||||
//# sourceMappingURL=debug-artifacts.test.js.map
|
//# sourceMappingURL=debug-artifacts.test.js.map
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"debug-artifacts.test.js","sourceRoot":"","sources":["../src/debug-artifacts.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AAEvB,kEAAoD;AACpD,mDAA0C;AAC1C,uCA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F,CAAC,CAAC,SAAS,CACT,cAAc,CAAC,oBAAoB,CAAC,cAAc,CAAC,EACnD,YAAY,CACb,CAAC;IACF,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,oBAAoB,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,CAAC;IAC5E,CAAC,CAAC,SAAS,CACT,cAAc,CAAC,oBAAoB,CAAC,yBAAyB,CAAC,EAC9D,aAAa,CACd,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,sBAAsB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACvC,2DAA2D;IAC3D,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAClC,MAAM,CAAC,CAAC,cAAc,CACpB,cAAc,CAAC,oBAAoB,CACjC,MAAM,EACN,EAAE,EACF,SAAS,EACT,cAAc,EACd,oBAAa,CAAC,MAAM,CACrB,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"bundleVersion": "codeql-bundle-v2.19.3",
|
"bundleVersion": "codeql-bundle-v2.20.0",
|
||||||
"cliVersion": "2.19.3",
|
"cliVersion": "2.20.0",
|
||||||
"priorBundleVersion": "codeql-bundle-v2.19.2",
|
"priorBundleVersion": "codeql-bundle-v2.19.4",
|
||||||
"priorCliVersion": "2.19.2"
|
"priorCliVersion": "2.19.4"
|
||||||
}
|
}
|
||||||
|
|||||||
45
lib/dependency-caching.js
generated
45
lib/dependency-caching.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.downloadDependencyCaches = downloadDependencyCaches;
|
exports.downloadDependencyCaches = downloadDependencyCaches;
|
||||||
exports.uploadDependencyCaches = uploadDependencyCaches;
|
exports.uploadDependencyCaches = uploadDependencyCaches;
|
||||||
@@ -140,15 +150,30 @@ async function uploadDependencyCaches(config, logger) {
|
|||||||
// use the cache quota that we compete with. In that case, we do not wish to use up all of the quota
|
// use the cache quota that we compete with. In that case, we do not wish to use up all of the quota
|
||||||
// with the dependency caches. For this, we could use the Cache API to check whether other workflows
|
// with the dependency caches. For this, we could use the Cache API to check whether other workflows
|
||||||
// are using the quota and how full it is.
|
// are using the quota and how full it is.
|
||||||
const size = await (0, caching_utils_1.getTotalCacheSize)(cacheConfig.paths, logger);
|
const size = await (0, caching_utils_1.getTotalCacheSize)(cacheConfig.paths, logger, true);
|
||||||
// Skip uploading an empty cache.
|
// Skip uploading an empty cache.
|
||||||
if (size === 0) {
|
if (size === 0) {
|
||||||
logger.info(`Skipping upload of dependency cache for ${language} since it is empty.`);
|
logger.info(`Skipping upload of dependency cache for ${language} since it is empty.`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const key = await cacheKey(language, cacheConfig);
|
const key = await cacheKey(language, cacheConfig);
|
||||||
logger.info(`Uploading cache of size ${size} for ${language} with key ${key}`);
|
logger.info(`Uploading cache of size ${size} for ${language} with key ${key}...`);
|
||||||
await actionsCache.saveCache(cacheConfig.paths, key);
|
try {
|
||||||
|
await actionsCache.saveCache(cacheConfig.paths, key);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
// `ReserveCacheError` indicates that the cache key is already in use, which means that a
|
||||||
|
// cache with that key already exists or is in the process of being uploaded by another
|
||||||
|
// workflow. We can ignore this.
|
||||||
|
if (error instanceof actionsCache.ReserveCacheError) {
|
||||||
|
logger.info(`Not uploading cache for ${language}, because ${key} is already in use.`);
|
||||||
|
logger.debug(error.message);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Propagate other errors upwards.
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"dependency-caching.js","sourceRoot":"","sources":["../src/dependency-caching.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+EA,4DAmDC;AAQD,wDAkDC;AA5LD,uCAAyB;AACzB,+BAA4B;AAE5B,6DAA+C;AAC/C,oDAAsC;AAEtC,mDAAoD;AAEpD,+CAAuC;AAGvC,iCAA6C;AAgB7C,MAAM,8BAA8B,GAAG,qBAAqB,CAAC;AAC7D,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAE1C;;GAEG;AACH,MAAM,2BAA2B,GAAwC;IACvE,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,QAAQ;YACR,IAAA,WAAI,EAAC,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,CAAC;YACvC,SAAS;YACT,IAAA,WAAI,EAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,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,oBAAM,CAAC,yBAAyB,CAAC,CAAC;IACnE,IAAI,MAAM,GAAG,8BAA8B,CAAC;IAE5C,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1D,MAAM,GAAG,GAAG,MAAM,IAAI,YAAY,EAAE,CAAC;IACvC,CAAC;IAED,OAAO,GAAG,MAAM,IAAI,+BAA+B,IAAI,QAAQ,IAAI,QAAQ,GAAG,CAAC;AACjF,CAAC"}
|
||||||
1
lib/doc-url.js
generated
1
lib/doc-url.js
generated
@@ -12,5 +12,6 @@ var DocUrl;
|
|||||||
DocUrl["SCANNING_ON_PUSH"] = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push";
|
DocUrl["SCANNING_ON_PUSH"] = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push";
|
||||||
DocUrl["SPECIFY_BUILD_STEPS_MANUALLY"] = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#about-specifying-build-steps-manually";
|
DocUrl["SPECIFY_BUILD_STEPS_MANUALLY"] = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#about-specifying-build-steps-manually";
|
||||||
DocUrl["TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS"] = "https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs";
|
DocUrl["TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS"] = "https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs";
|
||||||
|
DocUrl["CODEQL_BUILD_MODES"] = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes";
|
||||||
})(DocUrl || (exports.DocUrl = DocUrl = {}));
|
})(DocUrl || (exports.DocUrl = DocUrl = {}));
|
||||||
//# sourceMappingURL=doc-url.js.map
|
//# sourceMappingURL=doc-url.js.map
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"doc-url.js","sourceRoot":"","sources":["../src/doc-url.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,IAAY,MAOX;AAPD,WAAY,MAAM;IAChB,uHAA6G,CAAA;IAC7G,gJAAsI,CAAA;IACtI,yJAA+I,CAAA;IAC/I,qMAA2L,CAAA;IAC3L,gOAAsN,CAAA;IACtN,2PAAiP,CAAA;AACnP,CAAC,EAPW,MAAM,sBAAN,MAAM,QAOjB"}
|
{"version":3,"file":"doc-url.js","sourceRoot":"","sources":["../src/doc-url.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,IAAY,MAQX;AARD,WAAY,MAAM;IAChB,uHAA6G,CAAA;IAC7G,gJAAsI,CAAA;IACtI,yJAA+I,CAAA;IAC/I,qMAA2L,CAAA;IAC3L,gOAAsN,CAAA;IACtN,2PAAiP,CAAA;IACjP,mMAAyL,CAAA;AAC3L,CAAC,EARW,MAAM,sBAAN,MAAM,QAQjB"}
|
||||||
42
lib/feature-flags.js
generated
42
lib/feature-flags.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.Features = exports.FEATURE_FLAGS_FILE_NAME = exports.featureConfig = exports.Feature = exports.CODEQL_VERSION_ZSTD_BUNDLE = exports.CODEQL_VERSION_FINE_GRAINED_PARALLELISM = void 0;
|
exports.Features = exports.FEATURE_FLAGS_FILE_NAME = exports.featureConfig = exports.Feature = exports.CODEQL_VERSION_ZSTD_BUNDLE = exports.CODEQL_VERSION_FINE_GRAINED_PARALLELISM = void 0;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
@@ -52,7 +62,6 @@ exports.CODEQL_VERSION_ZSTD_BUNDLE = "2.19.0";
|
|||||||
*/
|
*/
|
||||||
var Feature;
|
var Feature;
|
||||||
(function (Feature) {
|
(function (Feature) {
|
||||||
Feature["ArtifactV4Upgrade"] = "artifact_v4_upgrade";
|
|
||||||
Feature["CleanupTrapCaches"] = "cleanup_trap_caches";
|
Feature["CleanupTrapCaches"] = "cleanup_trap_caches";
|
||||||
Feature["CppBuildModeNone"] = "cpp_build_mode_none";
|
Feature["CppBuildModeNone"] = "cpp_build_mode_none";
|
||||||
Feature["CppDependencyInstallation"] = "cpp_dependency_installation_enabled";
|
Feature["CppDependencyInstallation"] = "cpp_dependency_installation_enabled";
|
||||||
@@ -61,15 +70,12 @@ var Feature;
|
|||||||
Feature["DisableJavaBuildlessEnabled"] = "disable_java_buildless_enabled";
|
Feature["DisableJavaBuildlessEnabled"] = "disable_java_buildless_enabled";
|
||||||
Feature["DisableKotlinAnalysisEnabled"] = "disable_kotlin_analysis_enabled";
|
Feature["DisableKotlinAnalysisEnabled"] = "disable_kotlin_analysis_enabled";
|
||||||
Feature["ExportDiagnosticsEnabled"] = "export_diagnostics_enabled";
|
Feature["ExportDiagnosticsEnabled"] = "export_diagnostics_enabled";
|
||||||
|
Feature["ExtractToToolcache"] = "extract_to_toolcache";
|
||||||
Feature["PythonDefaultIsToNotExtractStdlib"] = "python_default_is_to_not_extract_stdlib";
|
Feature["PythonDefaultIsToNotExtractStdlib"] = "python_default_is_to_not_extract_stdlib";
|
||||||
Feature["QaTelemetryEnabled"] = "qa_telemetry_enabled";
|
Feature["QaTelemetryEnabled"] = "qa_telemetry_enabled";
|
||||||
|
Feature["ZstdBundleStreamingExtraction"] = "zstd_bundle_streaming_extraction";
|
||||||
})(Feature || (exports.Feature = Feature = {}));
|
})(Feature || (exports.Feature = Feature = {}));
|
||||||
exports.featureConfig = {
|
exports.featureConfig = {
|
||||||
[Feature.ArtifactV4Upgrade]: {
|
|
||||||
defaultValue: false,
|
|
||||||
envVar: "CODEQL_ACTION_ARTIFACT_V4_UPGRADE",
|
|
||||||
minimumVersion: undefined,
|
|
||||||
},
|
|
||||||
[Feature.CleanupTrapCaches]: {
|
[Feature.CleanupTrapCaches]: {
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
|
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
|
||||||
@@ -80,6 +86,11 @@ exports.featureConfig = {
|
|||||||
envVar: "CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE",
|
envVar: "CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE",
|
||||||
minimumVersion: undefined,
|
minimumVersion: undefined,
|
||||||
},
|
},
|
||||||
|
[Feature.ZstdBundleStreamingExtraction]: {
|
||||||
|
defaultValue: false,
|
||||||
|
envVar: "CODEQL_ACTION_ZSTD_BUNDLE_STREAMING_EXTRACTION",
|
||||||
|
minimumVersion: undefined,
|
||||||
|
},
|
||||||
[Feature.CppDependencyInstallation]: {
|
[Feature.CppDependencyInstallation]: {
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
|
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
|
||||||
@@ -115,6 +126,11 @@ exports.featureConfig = {
|
|||||||
legacyApi: true,
|
legacyApi: true,
|
||||||
minimumVersion: undefined,
|
minimumVersion: undefined,
|
||||||
},
|
},
|
||||||
|
[Feature.ExtractToToolcache]: {
|
||||||
|
defaultValue: false,
|
||||||
|
envVar: "CODEQL_ACTION_EXTRACT_TOOLCACHE",
|
||||||
|
minimumVersion: undefined,
|
||||||
|
},
|
||||||
[Feature.PythonDefaultIsToNotExtractStdlib]: {
|
[Feature.PythonDefaultIsToNotExtractStdlib]: {
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
|
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
25
lib/feature-flags.test.js
generated
25
lib/feature-flags.test.js
generated
@@ -15,17 +15,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
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.initializeFeatures = initializeFeatures;
|
||||||
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"));
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
24
lib/fingerprints.js
generated
24
lib/fingerprints.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
24
lib/fingerprints.test.js
generated
24
lib/fingerprints.test.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
381
lib/git-utils.js
generated
Normal file
381
lib/git-utils.js
generated
Normal file
@@ -0,0 +1,381 @@
|
|||||||
|
"use strict";
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
|
var ownKeys = function(o) {
|
||||||
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
|
var ar = [];
|
||||||
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
|
return ar;
|
||||||
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.decodeGitFilePath = exports.getGitDiffHunkHeaders = exports.getAllGitMergeBases = exports.gitRepack = exports.gitFetch = exports.deepenGitHistory = exports.determineBaseBranchHeadCommitOid = exports.getCommitOid = void 0;
|
||||||
|
exports.getRef = getRef;
|
||||||
|
exports.isAnalyzingDefaultBranch = isAnalyzingDefaultBranch;
|
||||||
|
const core = __importStar(require("@actions/core"));
|
||||||
|
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
||||||
|
const io = __importStar(require("@actions/io"));
|
||||||
|
const actions_util_1 = require("./actions-util");
|
||||||
|
const util_1 = require("./util");
|
||||||
|
async function runGitCommand(checkoutPath, args, customErrorMessage) {
|
||||||
|
let stdout = "";
|
||||||
|
let stderr = "";
|
||||||
|
core.debug(`Running git command: git ${args.join(" ")}`);
|
||||||
|
try {
|
||||||
|
await new toolrunner.ToolRunner(await io.which("git", true), args, {
|
||||||
|
silent: true,
|
||||||
|
listeners: {
|
||||||
|
stdout: (data) => {
|
||||||
|
stdout += data.toString();
|
||||||
|
},
|
||||||
|
stderr: (data) => {
|
||||||
|
stderr += data.toString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
cwd: checkoutPath,
|
||||||
|
}).exec();
|
||||||
|
return stdout;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
let reason = stderr;
|
||||||
|
if (stderr.includes("not a git repository")) {
|
||||||
|
reason =
|
||||||
|
"The checkout path provided to the action does not appear to be a git repository.";
|
||||||
|
}
|
||||||
|
core.info(`git call failed. ${customErrorMessage} Error: ${reason}`);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets the SHA of the commit that is currently checked out.
|
||||||
|
*/
|
||||||
|
const getCommitOid = async function (checkoutPath, ref = "HEAD") {
|
||||||
|
// Try to use git to get the current commit SHA. If that fails then
|
||||||
|
// log but otherwise silently fall back to using the SHA from the environment.
|
||||||
|
// The only time these two values will differ is during analysis of a PR when
|
||||||
|
// the workflow has changed the current commit to the head commit instead of
|
||||||
|
// the merge commit, which must mean that git is available.
|
||||||
|
// Even if this does go wrong, it's not a huge problem for the alerts to
|
||||||
|
// reported on the merge commit.
|
||||||
|
try {
|
||||||
|
const stdout = await runGitCommand(checkoutPath, ["rev-parse", ref], "Continuing with commit SHA from user input or environment.");
|
||||||
|
return stdout.trim();
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return (0, actions_util_1.getOptionalInput)("sha") || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.getCommitOid = getCommitOid;
|
||||||
|
/**
|
||||||
|
* If the action was triggered by a pull request, determine the commit sha at
|
||||||
|
* the head of the base branch, using the merge commit that this workflow analyzes.
|
||||||
|
* Returns undefined if run by other triggers or the base branch commit cannot be
|
||||||
|
* determined.
|
||||||
|
*/
|
||||||
|
const determineBaseBranchHeadCommitOid = async function (checkoutPathOverride) {
|
||||||
|
if ((0, actions_util_1.getWorkflowEventName)() !== "pull_request") {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const mergeSha = (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
||||||
|
const checkoutPath = checkoutPathOverride ?? (0, actions_util_1.getOptionalInput)("checkout_path");
|
||||||
|
try {
|
||||||
|
let commitOid = "";
|
||||||
|
let baseOid = "";
|
||||||
|
let headOid = "";
|
||||||
|
const stdout = await runGitCommand(checkoutPath, ["show", "-s", "--format=raw", mergeSha], "Will calculate the base branch SHA on the server.");
|
||||||
|
for (const data of stdout.split("\n")) {
|
||||||
|
if (data.startsWith("commit ") && commitOid === "") {
|
||||||
|
commitOid = data.substring(7);
|
||||||
|
}
|
||||||
|
else if (data.startsWith("parent ")) {
|
||||||
|
if (baseOid === "") {
|
||||||
|
baseOid = data.substring(7);
|
||||||
|
}
|
||||||
|
else if (headOid === "") {
|
||||||
|
headOid = data.substring(7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Let's confirm our assumptions: We had a merge commit and the parsed parent data looks correct
|
||||||
|
if (commitOid === mergeSha &&
|
||||||
|
headOid.length === 40 &&
|
||||||
|
baseOid.length === 40) {
|
||||||
|
return baseOid;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.determineBaseBranchHeadCommitOid = determineBaseBranchHeadCommitOid;
|
||||||
|
/**
|
||||||
|
* Deepen the git history of HEAD by one level. Errors are logged.
|
||||||
|
*
|
||||||
|
* This function uses the `checkout_path` to determine the repository path and
|
||||||
|
* works only when called from `analyze` or `upload-sarif`.
|
||||||
|
*/
|
||||||
|
const deepenGitHistory = async function () {
|
||||||
|
try {
|
||||||
|
await runGitCommand((0, actions_util_1.getOptionalInput)("checkout_path"), [
|
||||||
|
"fetch",
|
||||||
|
"origin",
|
||||||
|
"HEAD",
|
||||||
|
"--no-tags",
|
||||||
|
"--no-recurse-submodules",
|
||||||
|
"--deepen=1",
|
||||||
|
], "Cannot deepen the shallow repository.");
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
// Errors are already logged by runGitCommand()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.deepenGitHistory = deepenGitHistory;
|
||||||
|
/**
|
||||||
|
* Fetch the given remote branch. Errors are logged.
|
||||||
|
*
|
||||||
|
* This function uses the `checkout_path` to determine the repository path and
|
||||||
|
* works only when called from `analyze` or `upload-sarif`.
|
||||||
|
*/
|
||||||
|
const gitFetch = async function (branch, extraFlags) {
|
||||||
|
try {
|
||||||
|
await runGitCommand((0, actions_util_1.getOptionalInput)("checkout_path"), ["fetch", "--no-tags", ...extraFlags, "origin", `${branch}:${branch}`], `Cannot fetch ${branch}.`);
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
// Errors are already logged by runGitCommand()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.gitFetch = gitFetch;
|
||||||
|
/**
|
||||||
|
* Repack the git repository, using with the given flags. Errors are logged.
|
||||||
|
*
|
||||||
|
* This function uses the `checkout_path` to determine the repository path and
|
||||||
|
* works only when called from `analyze` or `upload-sarif`.
|
||||||
|
*/
|
||||||
|
const gitRepack = async function (flags) {
|
||||||
|
try {
|
||||||
|
await runGitCommand((0, actions_util_1.getOptionalInput)("checkout_path"), ["repack", ...flags], "Cannot repack the repository.");
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
// Errors are already logged by runGitCommand()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.gitRepack = gitRepack;
|
||||||
|
/**
|
||||||
|
* Compute the all merge bases between the given refs. Returns an empty array
|
||||||
|
* if no merge base is found, or if there is an error.
|
||||||
|
*
|
||||||
|
* This function uses the `checkout_path` to determine the repository path and
|
||||||
|
* works only when called from `analyze` or `upload-sarif`.
|
||||||
|
*/
|
||||||
|
const getAllGitMergeBases = async function (refs) {
|
||||||
|
try {
|
||||||
|
const stdout = await runGitCommand((0, actions_util_1.getOptionalInput)("checkout_path"), ["merge-base", "--all", ...refs], `Cannot get merge base of ${refs}.`);
|
||||||
|
return stdout.trim().split("\n");
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.getAllGitMergeBases = getAllGitMergeBases;
|
||||||
|
/**
|
||||||
|
* Compute the diff hunk headers between the two given refs.
|
||||||
|
*
|
||||||
|
* This function uses the `checkout_path` to determine the repository path and
|
||||||
|
* works only when called from `analyze` or `upload-sarif`.
|
||||||
|
*
|
||||||
|
* @returns an array of diff hunk headers (one element per line), or undefined
|
||||||
|
* if the action was not triggered by a pull request, or if the diff could not
|
||||||
|
* be determined.
|
||||||
|
*/
|
||||||
|
const getGitDiffHunkHeaders = async function (fromRef, toRef) {
|
||||||
|
let stdout = "";
|
||||||
|
try {
|
||||||
|
stdout = await runGitCommand((0, actions_util_1.getOptionalInput)("checkout_path"), [
|
||||||
|
"-c",
|
||||||
|
"core.quotePath=false",
|
||||||
|
"diff",
|
||||||
|
"--no-renames",
|
||||||
|
"--irreversible-delete",
|
||||||
|
"-U0",
|
||||||
|
fromRef,
|
||||||
|
toRef,
|
||||||
|
], `Cannot get diff from ${fromRef} to ${toRef}.`);
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const headers = [];
|
||||||
|
for (const line of stdout.split("\n")) {
|
||||||
|
if (line.startsWith("--- ") ||
|
||||||
|
line.startsWith("+++ ") ||
|
||||||
|
line.startsWith("@@ ")) {
|
||||||
|
headers.push(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return headers;
|
||||||
|
};
|
||||||
|
exports.getGitDiffHunkHeaders = getGitDiffHunkHeaders;
|
||||||
|
/**
|
||||||
|
* Decode, if necessary, a file path produced by Git. See
|
||||||
|
* https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath
|
||||||
|
* for details on how Git encodes file paths with special characters.
|
||||||
|
*
|
||||||
|
* This function works only for Git output with `core.quotePath=false`.
|
||||||
|
*/
|
||||||
|
const decodeGitFilePath = function (filePath) {
|
||||||
|
if (filePath.startsWith('"') && filePath.endsWith('"')) {
|
||||||
|
filePath = filePath.substring(1, filePath.length - 1);
|
||||||
|
return filePath.replace(/\\([abfnrtv\\"]|[0-7]{1,3})/g, (_match, seq) => {
|
||||||
|
switch (seq[0]) {
|
||||||
|
case "a":
|
||||||
|
return "\x07";
|
||||||
|
case "b":
|
||||||
|
return "\b";
|
||||||
|
case "f":
|
||||||
|
return "\f";
|
||||||
|
case "n":
|
||||||
|
return "\n";
|
||||||
|
case "r":
|
||||||
|
return "\r";
|
||||||
|
case "t":
|
||||||
|
return "\t";
|
||||||
|
case "v":
|
||||||
|
return "\v";
|
||||||
|
case "\\":
|
||||||
|
return "\\";
|
||||||
|
case '"':
|
||||||
|
return '"';
|
||||||
|
default:
|
||||||
|
// Both String.fromCharCode() and String.fromCodePoint() works only
|
||||||
|
// for constructing an entire character at once. If a Unicode
|
||||||
|
// character is encoded as a sequence of escaped bytes, calling these
|
||||||
|
// methods sequentially on the individual byte values would *not*
|
||||||
|
// produce the original multi-byte Unicode character. As a result,
|
||||||
|
// this implementation works only with the Git option core.quotePath
|
||||||
|
// set to false.
|
||||||
|
return String.fromCharCode(parseInt(seq, 8));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return filePath;
|
||||||
|
};
|
||||||
|
exports.decodeGitFilePath = decodeGitFilePath;
|
||||||
|
function getRefFromEnv() {
|
||||||
|
// To workaround a limitation of Actions dynamic workflows not setting
|
||||||
|
// the GITHUB_REF in some cases, we accept also the ref within the
|
||||||
|
// CODE_SCANNING_REF variable. When possible, however, we prefer to use
|
||||||
|
// the GITHUB_REF as that is a protected variable and cannot be overwritten.
|
||||||
|
let refEnv;
|
||||||
|
try {
|
||||||
|
refEnv = (0, util_1.getRequiredEnvParam)("GITHUB_REF");
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
// If the GITHUB_REF is not set, we try to rescue by getting the
|
||||||
|
// CODE_SCANNING_REF.
|
||||||
|
const maybeRef = process.env["CODE_SCANNING_REF"];
|
||||||
|
if (maybeRef === undefined || maybeRef.length === 0) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
refEnv = maybeRef;
|
||||||
|
}
|
||||||
|
return refEnv;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Get the ref currently being analyzed.
|
||||||
|
*/
|
||||||
|
async function getRef() {
|
||||||
|
// Will be in the form "refs/heads/master" on a push event
|
||||||
|
// or in the form "refs/pull/N/merge" on a pull_request event
|
||||||
|
const refInput = (0, actions_util_1.getOptionalInput)("ref");
|
||||||
|
const shaInput = (0, actions_util_1.getOptionalInput)("sha");
|
||||||
|
const checkoutPath = (0, actions_util_1.getOptionalInput)("checkout_path") ||
|
||||||
|
(0, actions_util_1.getOptionalInput)("source-root") ||
|
||||||
|
(0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE");
|
||||||
|
const hasRefInput = !!refInput;
|
||||||
|
const hasShaInput = !!shaInput;
|
||||||
|
// If one of 'ref' or 'sha' are provided, both are required
|
||||||
|
if ((hasRefInput || hasShaInput) && !(hasRefInput && hasShaInput)) {
|
||||||
|
throw new util_1.ConfigurationError("Both 'ref' and 'sha' are required if one of them is provided.");
|
||||||
|
}
|
||||||
|
const ref = refInput || getRefFromEnv();
|
||||||
|
const sha = shaInput || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
||||||
|
// If the ref is a user-provided input, we have to skip logic
|
||||||
|
// and assume that it is really where they want to upload the results.
|
||||||
|
if (refInput) {
|
||||||
|
return refInput;
|
||||||
|
}
|
||||||
|
// For pull request refs we want to detect whether the workflow
|
||||||
|
// has run `git checkout HEAD^2` to analyze the 'head' ref rather
|
||||||
|
// than the 'merge' ref. If so, we want to convert the ref that
|
||||||
|
// we report back.
|
||||||
|
const pull_ref_regex = /refs\/pull\/(\d+)\/merge/;
|
||||||
|
if (!pull_ref_regex.test(ref)) {
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
const head = await (0, exports.getCommitOid)(checkoutPath, "HEAD");
|
||||||
|
// in actions/checkout@v2+ we can check if git rev-parse HEAD == GITHUB_SHA
|
||||||
|
// in actions/checkout@v1 this may not be true as it checks out the repository
|
||||||
|
// using GITHUB_REF. There is a subtle race condition where
|
||||||
|
// git rev-parse GITHUB_REF != GITHUB_SHA, so we must check
|
||||||
|
// git rev-parse GITHUB_REF == git rev-parse HEAD instead.
|
||||||
|
const hasChangedRef = sha !== head &&
|
||||||
|
(await (0, exports.getCommitOid)(checkoutPath, ref.replace(/^refs\/pull\//, "refs/remotes/pull/"))) !== head;
|
||||||
|
if (hasChangedRef) {
|
||||||
|
const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head");
|
||||||
|
core.debug(`No longer on merge commit, rewriting ref from ${ref} to ${newRef}.`);
|
||||||
|
return newRef;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function removeRefsHeadsPrefix(ref) {
|
||||||
|
return ref.startsWith("refs/heads/") ? ref.slice("refs/heads/".length) : ref;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns whether we are analyzing the default branch for the repository.
|
||||||
|
*
|
||||||
|
* This first checks the environment variable `CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH`. This
|
||||||
|
* environment variable can be set in cases where repository information might not be available, for
|
||||||
|
* example dynamic workflows.
|
||||||
|
*/
|
||||||
|
async function isAnalyzingDefaultBranch() {
|
||||||
|
if (process.env.CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH === "true") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Get the current ref and trim and refs/heads/ prefix
|
||||||
|
let currentRef = await getRef();
|
||||||
|
currentRef = removeRefsHeadsPrefix(currentRef);
|
||||||
|
const event = (0, actions_util_1.getWorkflowEvent)();
|
||||||
|
let defaultBranch = event?.repository?.default_branch;
|
||||||
|
if ((0, actions_util_1.getWorkflowEventName)() === "schedule") {
|
||||||
|
defaultBranch = removeRefsHeadsPrefix(getRefFromEnv());
|
||||||
|
}
|
||||||
|
return currentRef === defaultBranch;
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=git-utils.js.map
|
||||||
1
lib/git-utils.js.map
Normal file
1
lib/git-utils.js.map
Normal file
File diff suppressed because one or more lines are too long
268
lib/git-utils.test.js
generated
Normal file
268
lib/git-utils.test.js
generated
Normal file
@@ -0,0 +1,268 @@
|
|||||||
|
"use strict";
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
|
var ownKeys = function(o) {
|
||||||
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
|
var ar = [];
|
||||||
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
|
return ar;
|
||||||
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const fs = __importStar(require("fs"));
|
||||||
|
const path = __importStar(require("path"));
|
||||||
|
const core = __importStar(require("@actions/core"));
|
||||||
|
const ava_1 = __importDefault(require("ava"));
|
||||||
|
const sinon = __importStar(require("sinon"));
|
||||||
|
const actionsUtil = __importStar(require("./actions-util"));
|
||||||
|
const gitUtils = __importStar(require("./git-utils"));
|
||||||
|
const testing_utils_1 = require("./testing-utils");
|
||||||
|
const util_1 = require("./util");
|
||||||
|
(0, testing_utils_1.setupTests)(ava_1.default);
|
||||||
|
(0, ava_1.default)("getRef() throws on the empty string", async (t) => {
|
||||||
|
process.env["GITHUB_REF"] = "";
|
||||||
|
await t.throwsAsync(gitUtils.getRef);
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("getRef() returns merge PR ref if GITHUB_SHA still checked out", async (t) => {
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
const expectedRef = "refs/pull/1/merge";
|
||||||
|
const currentSha = "a".repeat(40);
|
||||||
|
process.env["GITHUB_REF"] = expectedRef;
|
||||||
|
process.env["GITHUB_SHA"] = currentSha;
|
||||||
|
const callback = sinon.stub(gitUtils, "getCommitOid");
|
||||||
|
callback.withArgs("HEAD").resolves(currentSha);
|
||||||
|
const actualRef = await gitUtils.getRef();
|
||||||
|
t.deepEqual(actualRef, expectedRef);
|
||||||
|
callback.restore();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("getRef() returns merge PR ref if GITHUB_REF still checked out but sha has changed (actions checkout@v1)", async (t) => {
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
const expectedRef = "refs/pull/1/merge";
|
||||||
|
process.env["GITHUB_REF"] = expectedRef;
|
||||||
|
process.env["GITHUB_SHA"] = "b".repeat(40);
|
||||||
|
const sha = "a".repeat(40);
|
||||||
|
const callback = sinon.stub(gitUtils, "getCommitOid");
|
||||||
|
callback.withArgs("refs/remotes/pull/1/merge").resolves(sha);
|
||||||
|
callback.withArgs("HEAD").resolves(sha);
|
||||||
|
const actualRef = await gitUtils.getRef();
|
||||||
|
t.deepEqual(actualRef, expectedRef);
|
||||||
|
callback.restore();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("getRef() returns head PR ref if GITHUB_REF no longer checked out", async (t) => {
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
process.env["GITHUB_REF"] = "refs/pull/1/merge";
|
||||||
|
process.env["GITHUB_SHA"] = "a".repeat(40);
|
||||||
|
const callback = sinon.stub(gitUtils, "getCommitOid");
|
||||||
|
callback.withArgs(tmpDir, "refs/pull/1/merge").resolves("a".repeat(40));
|
||||||
|
callback.withArgs(tmpDir, "HEAD").resolves("b".repeat(40));
|
||||||
|
const actualRef = await gitUtils.getRef();
|
||||||
|
t.deepEqual(actualRef, "refs/pull/1/head");
|
||||||
|
callback.restore();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("getRef() returns ref provided as an input and ignores current HEAD", async (t) => {
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
const getAdditionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
||||||
|
getAdditionalInputStub.withArgs("ref").resolves("refs/pull/2/merge");
|
||||||
|
getAdditionalInputStub.withArgs("sha").resolves("b".repeat(40));
|
||||||
|
// These values are be ignored
|
||||||
|
process.env["GITHUB_REF"] = "refs/pull/1/merge";
|
||||||
|
process.env["GITHUB_SHA"] = "a".repeat(40);
|
||||||
|
const callback = sinon.stub(gitUtils, "getCommitOid");
|
||||||
|
callback.withArgs("refs/pull/1/merge").resolves("b".repeat(40));
|
||||||
|
callback.withArgs("HEAD").resolves("b".repeat(40));
|
||||||
|
const actualRef = await gitUtils.getRef();
|
||||||
|
t.deepEqual(actualRef, "refs/pull/2/merge");
|
||||||
|
callback.restore();
|
||||||
|
getAdditionalInputStub.restore();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("getRef() returns CODE_SCANNING_REF as a fallback for GITHUB_REF", async (t) => {
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
const expectedRef = "refs/pull/1/HEAD";
|
||||||
|
const currentSha = "a".repeat(40);
|
||||||
|
process.env["CODE_SCANNING_REF"] = expectedRef;
|
||||||
|
process.env["GITHUB_REF"] = "";
|
||||||
|
process.env["GITHUB_SHA"] = currentSha;
|
||||||
|
const actualRef = await gitUtils.getRef();
|
||||||
|
t.deepEqual(actualRef, expectedRef);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("getRef() returns GITHUB_REF over CODE_SCANNING_REF if both are provided", async (t) => {
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
const expectedRef = "refs/pull/1/merge";
|
||||||
|
const currentSha = "a".repeat(40);
|
||||||
|
process.env["CODE_SCANNING_REF"] = "refs/pull/1/HEAD";
|
||||||
|
process.env["GITHUB_REF"] = expectedRef;
|
||||||
|
process.env["GITHUB_SHA"] = currentSha;
|
||||||
|
const actualRef = await gitUtils.getRef();
|
||||||
|
t.deepEqual(actualRef, expectedRef);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("getRef() throws an error if only `ref` is provided as an input", async (t) => {
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
const getAdditionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
||||||
|
getAdditionalInputStub.withArgs("ref").resolves("refs/pull/1/merge");
|
||||||
|
await t.throwsAsync(async () => {
|
||||||
|
await gitUtils.getRef();
|
||||||
|
}, {
|
||||||
|
instanceOf: Error,
|
||||||
|
message: "Both 'ref' and 'sha' are required if one of them is provided.",
|
||||||
|
});
|
||||||
|
getAdditionalInputStub.restore();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("getRef() throws an error if only `sha` is provided as an input", async (t) => {
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
process.env["GITHUB_WORKSPACE"] = "/tmp";
|
||||||
|
const getAdditionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
||||||
|
getAdditionalInputStub.withArgs("sha").resolves("a".repeat(40));
|
||||||
|
await t.throwsAsync(async () => {
|
||||||
|
await gitUtils.getRef();
|
||||||
|
}, {
|
||||||
|
instanceOf: Error,
|
||||||
|
message: "Both 'ref' and 'sha' are required if one of them is provided.",
|
||||||
|
});
|
||||||
|
getAdditionalInputStub.restore();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("isAnalyzingDefaultBranch()", async (t) => {
|
||||||
|
process.env["GITHUB_EVENT_NAME"] = "push";
|
||||||
|
process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "true";
|
||||||
|
t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), true);
|
||||||
|
process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "false";
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||||
|
const envFile = path.join(tmpDir, "event.json");
|
||||||
|
fs.writeFileSync(envFile, JSON.stringify({
|
||||||
|
repository: {
|
||||||
|
default_branch: "main",
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
process.env["GITHUB_EVENT_PATH"] = envFile;
|
||||||
|
process.env["GITHUB_REF"] = "main";
|
||||||
|
process.env["GITHUB_SHA"] = "1234";
|
||||||
|
t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), true);
|
||||||
|
process.env["GITHUB_REF"] = "refs/heads/main";
|
||||||
|
t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), true);
|
||||||
|
process.env["GITHUB_REF"] = "feature";
|
||||||
|
t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), false);
|
||||||
|
fs.writeFileSync(envFile, JSON.stringify({
|
||||||
|
schedule: "0 0 * * *",
|
||||||
|
}));
|
||||||
|
process.env["GITHUB_EVENT_NAME"] = "schedule";
|
||||||
|
process.env["GITHUB_REF"] = "refs/heads/main";
|
||||||
|
t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), true);
|
||||||
|
const getAdditionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
||||||
|
getAdditionalInputStub
|
||||||
|
.withArgs("ref")
|
||||||
|
.resolves("refs/heads/something-else");
|
||||||
|
getAdditionalInputStub
|
||||||
|
.withArgs("sha")
|
||||||
|
.resolves("0000000000000000000000000000000000000000");
|
||||||
|
process.env["GITHUB_EVENT_NAME"] = "schedule";
|
||||||
|
process.env["GITHUB_REF"] = "refs/heads/main";
|
||||||
|
t.deepEqual(await gitUtils.isAnalyzingDefaultBranch(), false);
|
||||||
|
getAdditionalInputStub.restore();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("determineBaseBranchHeadCommitOid non-pullrequest", async (t) => {
|
||||||
|
const infoStub = sinon.stub(core, "info");
|
||||||
|
process.env["GITHUB_EVENT_NAME"] = "hucairz";
|
||||||
|
process.env["GITHUB_SHA"] = "100912429fab4cb230e66ffb11e738ac5194e73a";
|
||||||
|
const result = await gitUtils.determineBaseBranchHeadCommitOid(__dirname);
|
||||||
|
t.deepEqual(result, undefined);
|
||||||
|
t.deepEqual(0, infoStub.callCount);
|
||||||
|
infoStub.restore();
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("determineBaseBranchHeadCommitOid not git repository", async (t) => {
|
||||||
|
const infoStub = sinon.stub(core, "info");
|
||||||
|
process.env["GITHUB_EVENT_NAME"] = "pull_request";
|
||||||
|
process.env["GITHUB_SHA"] = "100912429fab4cb230e66ffb11e738ac5194e73a";
|
||||||
|
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||||
|
await gitUtils.determineBaseBranchHeadCommitOid(tmpDir);
|
||||||
|
});
|
||||||
|
t.deepEqual(1, infoStub.callCount);
|
||||||
|
t.deepEqual(infoStub.firstCall.args[0], "git call failed. Will calculate the base branch SHA on the server. Error: " +
|
||||||
|
"The checkout path provided to the action does not appear to be a git repository.");
|
||||||
|
infoStub.restore();
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("determineBaseBranchHeadCommitOid other error", async (t) => {
|
||||||
|
const infoStub = sinon.stub(core, "info");
|
||||||
|
process.env["GITHUB_EVENT_NAME"] = "pull_request";
|
||||||
|
process.env["GITHUB_SHA"] = "100912429fab4cb230e66ffb11e738ac5194e73a";
|
||||||
|
const result = await gitUtils.determineBaseBranchHeadCommitOid(path.join(__dirname, "../../i-dont-exist"));
|
||||||
|
t.deepEqual(result, undefined);
|
||||||
|
t.deepEqual(1, infoStub.callCount);
|
||||||
|
t.assert(infoStub.firstCall.args[0].startsWith("git call failed. Will calculate the base branch SHA on the server. Error: "));
|
||||||
|
t.assert(!infoStub.firstCall.args[0].endsWith("The checkout path provided to the action does not appear to be a git repository."));
|
||||||
|
infoStub.restore();
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("decodeGitFilePath unquoted strings", async (t) => {
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("foo"), "foo");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("foo bar"), "foo bar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("foo\\\\bar"), "foo\\\\bar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('foo\\"bar'), 'foo\\"bar');
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("foo\\001bar"), "foo\\001bar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("foo\\abar"), "foo\\abar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("foo\\bbar"), "foo\\bbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("foo\\fbar"), "foo\\fbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("foo\\nbar"), "foo\\nbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("foo\\rbar"), "foo\\rbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("foo\\tbar"), "foo\\tbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("foo\\vbar"), "foo\\vbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath("\\a\\b\\f\\n\\r\\t\\v"), "\\a\\b\\f\\n\\r\\t\\v");
|
||||||
|
});
|
||||||
|
(0, ava_1.default)("decodeGitFilePath quoted strings", async (t) => {
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo"'), "foo");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo bar"'), "foo bar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo\\\\bar"'), "foo\\bar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo\\"bar"'), 'foo"bar');
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo\\001bar"'), "foo\x01bar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo\\abar"'), "foo\x07bar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo\\bbar"'), "foo\bbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo\\fbar"'), "foo\fbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo\\nbar"'), "foo\nbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo\\rbar"'), "foo\rbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo\\tbar"'), "foo\tbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"foo\\vbar"'), "foo\vbar");
|
||||||
|
t.deepEqual(gitUtils.decodeGitFilePath('"\\a\\b\\f\\n\\r\\t\\v"'), "\x07\b\f\n\r\t\v");
|
||||||
|
});
|
||||||
|
//# sourceMappingURL=git-utils.test.js.map
|
||||||
1
lib/git-utils.test.js.map
Normal file
1
lib/git-utils.test.js.map
Normal file
File diff suppressed because one or more lines are too long
24
lib/init-action-post-helper.js
generated
24
lib/init-action-post-helper.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.tryUploadSarifIfRunFailed = tryUploadSarifIfRunFailed;
|
exports.tryUploadSarifIfRunFailed = tryUploadSarifIfRunFailed;
|
||||||
exports.run = run;
|
exports.run = run;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
24
lib/init-action-post-helper.test.js
generated
24
lib/init-action-post-helper.test.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
24
lib/init-action-post.js
generated
24
lib/init-action-post.js
generated
@@ -20,13 +20,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
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");
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"init-action-post.js","sourceRoot":"","sources":["../src/init-action-post.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oDAAsC;AAEtC,iDAIwB;AACxB,6CAAgD;AAChD,iDAAmD;AACnD,kEAAoD;AACpD,mDAA2C;AAC3C,gFAAkE;AAClE,uC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AAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,IAAA,gCAAgB,EAAC,gBAAgB,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO;IACT,CAAC;IACD,MAAM,SAAS,GAAG,oBAAoB,CAAC,iBAAiB,EAAE,CAAC;IAC3D,MAAM,CAAC,IAAI,CAAC,yBAAyB,IAAA,uCAAuB,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAE5E,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,0BAAU,CAAC,QAAQ,EACnB,SAAS,EACT,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,MAAM,CACP,CAAC;IACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,YAAY,GAAyB;YACzC,GAAG,gBAAgB;YACnB,GAAG,uBAAuB;YAC1B,UAAU,EAAE,oBAAoB,CAAC,iBAAiB,EAAE;SACrD,CAAC;QACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;IACvC,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||||
36
lib/init-action.js
generated
36
lib/init-action.js
generated
@@ -15,18 +15,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
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 core = __importStar(require("@actions/core"));
|
const core = __importStar(require("@actions/core"));
|
||||||
const safe_which_1 = require("@chrisgavin/safe-which");
|
const io = __importStar(require("@actions/io"));
|
||||||
const uuid_1 = require("uuid");
|
const uuid_1 = require("uuid");
|
||||||
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");
|
||||||
@@ -162,16 +172,20 @@ async function run() {
|
|||||||
}
|
}
|
||||||
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, features, logger);
|
||||||
codeql = initCodeQLResult.codeql;
|
codeql = initCodeQLResult.codeql;
|
||||||
toolsDownloadStatusReport = initCodeQLResult.toolsDownloadStatusReport;
|
toolsDownloadStatusReport = initCodeQLResult.toolsDownloadStatusReport;
|
||||||
toolsVersion = initCodeQLResult.toolsVersion;
|
toolsVersion = initCodeQLResult.toolsVersion;
|
||||||
toolsSource = initCodeQLResult.toolsSource;
|
toolsSource = initCodeQLResult.toolsSource;
|
||||||
zstdAvailability = initCodeQLResult.zstdAvailability;
|
zstdAvailability = initCodeQLResult.zstdAvailability;
|
||||||
core.startGroup("Validating workflow");
|
core.startGroup("Validating workflow");
|
||||||
if ((await (0, workflow_1.validateWorkflow)(codeql, logger)) === undefined) {
|
const validateWorkflowResult = await (0, workflow_1.validateWorkflow)(codeql, logger);
|
||||||
|
if (validateWorkflowResult === undefined) {
|
||||||
logger.info("Detected no issues with the code scanning workflow.");
|
logger.info("Detected no issues with the code scanning workflow.");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
logger.warning(`Unable to validate code scanning workflow: ${validateWorkflowResult}`);
|
||||||
|
}
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
config = await (0, init_1.initConfig)({
|
config = await (0, init_1.initConfig)({
|
||||||
languagesInput: (0, actions_util_1.getOptionalInput)("languages"),
|
languagesInput: (0, actions_util_1.getOptionalInput)("languages"),
|
||||||
@@ -244,7 +258,7 @@ async function run() {
|
|||||||
if (config.languages.includes(languages_1.Language.go) &&
|
if (config.languages.includes(languages_1.Language.go) &&
|
||||||
process.platform === "linux") {
|
process.platform === "linux") {
|
||||||
try {
|
try {
|
||||||
const goBinaryPath = await (0, safe_which_1.safeWhich)("go");
|
const goBinaryPath = await io.which("go", true);
|
||||||
const fileOutput = await (0, actions_util_1.getFileType)(goBinaryPath);
|
const fileOutput = await (0, actions_util_1.getFileType)(goBinaryPath);
|
||||||
// Go 1.21 and above ships with statically linked binaries on Linux. CodeQL cannot currently trace custom builds
|
// Go 1.21 and above ships with statically linked binaries on Linux. CodeQL cannot currently trace custom builds
|
||||||
// where the entry point is a statically linked binary. Until that is fixed, we work around the problem by
|
// where the entry point is a statically linked binary. Until that is fixed, we work around the problem by
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
32
lib/init.js
generated
32
lib/init.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.initCodeQL = initCodeQL;
|
exports.initCodeQL = initCodeQL;
|
||||||
exports.initConfig = initConfig;
|
exports.initConfig = initConfig;
|
||||||
@@ -32,7 +42,7 @@ exports.cleanupDatabaseClusterDirectory = cleanupDatabaseClusterDirectory;
|
|||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
|
||||||
const safeWhich = __importStar(require("@chrisgavin/safe-which"));
|
const io = __importStar(require("@actions/io"));
|
||||||
const actions_util_1 = require("./actions-util");
|
const actions_util_1 = require("./actions-util");
|
||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
const configUtils = __importStar(require("./config-utils"));
|
const configUtils = __importStar(require("./config-utils"));
|
||||||
@@ -40,9 +50,9 @@ const languages_1 = require("./languages");
|
|||||||
const tools_features_1 = require("./tools-features");
|
const tools_features_1 = require("./tools-features");
|
||||||
const tracer_config_1 = require("./tracer-config");
|
const tracer_config_1 = require("./tracer-config");
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger) {
|
async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) {
|
||||||
logger.startGroup("Setup CodeQL tools");
|
logger.startGroup("Setup CodeQL tools");
|
||||||
const { codeql, toolsDownloadStatusReport, toolsSource, toolsVersion, zstdAvailability, } = await (0, codeql_1.setupCodeQL)(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger, true);
|
const { codeql, toolsDownloadStatusReport, toolsSource, toolsVersion, zstdAvailability, } = await (0, codeql_1.setupCodeQL)(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger, features, true);
|
||||||
await codeql.printVersion();
|
await codeql.printVersion();
|
||||||
logger.endGroup();
|
logger.endGroup();
|
||||||
return {
|
return {
|
||||||
@@ -92,7 +102,7 @@ async function checkInstallPython311(languages, codeql) {
|
|||||||
process.platform === "win32" &&
|
process.platform === "win32" &&
|
||||||
!(await codeql.getVersion()).features?.supportsPython312) {
|
!(await codeql.getVersion()).features?.supportsPython312) {
|
||||||
const script = path.resolve(__dirname, "../python-setup", "check_python12.ps1");
|
const script = path.resolve(__dirname, "../python-setup", "check_python12.ps1");
|
||||||
await new toolrunner.ToolRunner(await safeWhich.safeWhich("powershell"), [
|
await new toolrunner.ToolRunner(await io.which("powershell", true), [
|
||||||
script,
|
script,
|
||||||
]).exec();
|
]).exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,gCAuCC;AAED,gCAgBC;AAED,0BAkCC;AAED,0DAeC;AAMD,sDAkBC;AAED,0EAkDC;AA9MD,uCAAyB;AACzB,2CAA6B;AAE7B,yEAA2D;AAC3D,kEAAoD;AAEpD,iDAAsE;AAEtE,qCAA+C;AAC/C,4DAA8C;AAE9C,2CAA0D;AAK1D,qDAAgD;AAChD,mDAAwE;AACxE,6CAA+B;AAExB,KAAK,UAAU,UAAU,CAC9B,UAA8B,EAC9B,UAA4B,EAC5B,OAAe,EACf,OAA2B,EAC3B,iBAA2C,EAC3C,MAAc;IAQd,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACxC,MAAM,EACJ,MAAM,EACN,yBAAyB,EACzB,WAAW,EACX,YAAY,EACZ,gBAAgB,GACjB,GAAG,MAAM,IAAA,oBAAW,EACnB,UAAU,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,IAAI,CACL,CAAC;IACF,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO;QACL,MAAM;QACN,yBAAyB;QACzB,WAAW;QACX,YAAY;QACZ,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,UAAU,CAC9B,MAAoC,EACpC,MAAc;IAEd,MAAM,MAAM,GAAG,MAAM,CAAC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ated
24
lib/init.test.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"init.test.js","sourceRoot":"","sources":["../src/init.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AAExB,8CAAuB;AAGvB,iCAGgB;AAChB,2CAAuC;AACvC,mDAKyB;AACzB,iCAAwD;AAExD,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,IAA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,CAAC,UAAU,CAAC,aAAa,WAAW,EAAE;aAC1D,CACF,CAAC;YAEF,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACzB,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YAClC,CAAC,CAAC,EAAE,CACF,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EACnB,kCAAkC,UAAU,4CAA4C,CACzF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||||
34
lib/logging.js
generated
34
lib/logging.js
generated
@@ -15,17 +15,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getActionsLogger = getActionsLogger;
|
exports.getActionsLogger = getActionsLogger;
|
||||||
exports.getRunnerLogger = getRunnerLogger;
|
exports.getRunnerLogger = getRunnerLogger;
|
||||||
exports.withGroup = withGroup;
|
exports.withGroup = withGroup;
|
||||||
|
exports.withGroupAsync = withGroupAsync;
|
||||||
exports.formatDuration = formatDuration;
|
exports.formatDuration = formatDuration;
|
||||||
const core = __importStar(require("@actions/core"));
|
const core = __importStar(require("@actions/core"));
|
||||||
function getActionsLogger() {
|
function getActionsLogger() {
|
||||||
@@ -55,6 +66,15 @@ function withGroup(groupName, f) {
|
|||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
async function withGroupAsync(groupName, f) {
|
||||||
|
core.startGroup(groupName);
|
||||||
|
try {
|
||||||
|
return await f();
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
core.endGroup();
|
||||||
|
}
|
||||||
|
}
|
||||||
/** Format a duration for use in logs. */
|
/** Format a duration for use in logs. */
|
||||||
function formatDuration(durationMs) {
|
function formatDuration(durationMs) {
|
||||||
if (durationMs < 1000) {
|
if (durationMs < 1000) {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAcA,4CAEC;AAED,0CAcC;AAED,8BAOC;AAGD,wCAWC;AAvDD,oDAAsC;AActC,SAAgB,gBAAgB;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,eAAe,CAAC,SAAkB;IAChD,OAAO;QACL,sCAAsC;QACtC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS;QAClD,sCAAsC;QACtC,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,sCAAsC;QACtC,OAAO,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C,GAAG,CAAC;IAC9C,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC9D,OAAO,GAAG,OAAO,IAAI,OAAO,GAAG,CAAC;AAClC,CAAC"}
|
||||||
24
lib/resolve-environment-action.js
generated
24
lib/resolve-environment-action.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
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");
|
||||||
|
|||||||
@@ -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,6CAAwC;AACxC,iDAAmD;AACnD,uCAA6C;AAC7C,+DAAmE;AACnE,mDAKyB;AACzB,iCAOgB;AAEhB,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAE9C,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAElC,IAAI,MAA0B,CAAC;IAE/B,IAAI,CAAC;QACH,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,0BAAU,CAAC,kBAAkB,EAC7B,UAAU,EACV,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,MAAM,CACP,CAAC;QACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,IAAA,gCAAgB,EAAC,gBAAgB,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAgB,GAAE,CAAC;QAC/C,IAAA,gCAAyB,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACjD,IAAA,yBAAkB,EAAC,IAAA,+BAAgB,GAAE,EAAE,aAAa,CAAC,CAAC;QAEtD,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,IAAA,oCAAqB,GAAE,EAAE,MAAM,CAAC,CAAC;QAC1D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,yFAAyF,CAC1F,CAAC;QACJ,CAAC;QAED,MAA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M,CAAC,EAC5B,MAAM,CACP,CAAC;IACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,IAAA,gCAAgB,EAAC,gBAAgB,CAAC,CAAC;IAC3C,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,GAAG,0BAAU,CAAC,kBAAkB,mBAAmB,IAAA,sBAAe,EAChE,KAAK,CACN,EAAE,CACJ,CAAC;IACJ,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,6CAAwC;AACxC,iDAAmD;AACnD,uCAA6C;AAC7C,+DAAmE;AACnE,mDAKyB;AACzB,iCAOgB;AAEhB,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAE9C,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAElC,IAAI,MAA0B,CAAC;IAE/B,IAAI,CAAC;QACH,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,0BAAU,CAAC,kBAAkB,EAC7B,UAAU,EACV,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,MAAM,CACP,CAAC;QACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,IAAA,gCAAgB,EAAC,gBAAgB,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,aAAa,GAA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AAM,CAAC,EAC5B,MAAM,EACN,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,KAAK,CACZ,CAAC;YACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;gBACnC,MAAM,IAAA,gCAAgB,EAAC,gBAAgB,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QAED,OAAO;IACT,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,0BAAU,CAAC,kBAAkB,EAC7B,SAAS,EACT,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,MAAM,CACP,CAAC;IACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,IAAA,gCAAgB,EAAC,gBAAgB,CAAC,CAAC;IAC3C,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,GAAG,0BAAU,CAAC,kBAAkB,mBAAmB,IAAA,sBAAe,EAChE,KAAK,CACN,EAAE,CACJ,CAAC;IACJ,CAAC;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||||
89
lib/setup-codeql.js
generated
89
lib/setup-codeql.js
generated
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@@ -41,6 +51,7 @@ const perf_hooks_1 = require("perf_hooks");
|
|||||||
const toolcache = __importStar(require("@actions/tool-cache"));
|
const toolcache = __importStar(require("@actions/tool-cache"));
|
||||||
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
||||||
const semver = __importStar(require("semver"));
|
const semver = __importStar(require("semver"));
|
||||||
|
const uuid_1 = require("uuid");
|
||||||
const actions_util_1 = require("./actions-util");
|
const actions_util_1 = require("./actions-util");
|
||||||
const api = __importStar(require("./api-client"));
|
const api = __importStar(require("./api-client"));
|
||||||
const defaults = __importStar(require("./defaults.json"));
|
const defaults = __importStar(require("./defaults.json"));
|
||||||
@@ -379,7 +390,7 @@ async function tryGetFallbackToolcacheVersion(cliVersion, tagName, logger) {
|
|||||||
}
|
}
|
||||||
// Exported using `export const` for testing purposes. Specifically, we want to
|
// Exported using `export const` for testing purposes. Specifically, we want to
|
||||||
// be able to stub this function and have other functions in this file use that stub.
|
// be able to stub this function and have other functions in this file use that stub.
|
||||||
const downloadCodeQL = async function (codeqlURL, maybeBundleVersion, maybeCliVersion, apiDetails, tarVersion, tempDir, logger) {
|
const downloadCodeQL = async function (codeqlURL, maybeBundleVersion, maybeCliVersion, apiDetails, tarVersion, tempDir, features, logger) {
|
||||||
const parsedCodeQLURL = new URL(codeqlURL);
|
const parsedCodeQLURL = new URL(codeqlURL);
|
||||||
const searchParams = new URLSearchParams(parsedCodeQLURL.search);
|
const searchParams = new URLSearchParams(parsedCodeQLURL.search);
|
||||||
const headers = {
|
const headers = {
|
||||||
@@ -401,9 +412,13 @@ const downloadCodeQL = async function (codeqlURL, maybeBundleVersion, maybeCliVe
|
|||||||
else {
|
else {
|
||||||
logger.debug("Downloading CodeQL tools without an authorization token.");
|
logger.debug("Downloading CodeQL tools without an authorization token.");
|
||||||
}
|
}
|
||||||
const { extractedBundlePath, statusReport } = await (0, tools_download_1.downloadAndExtract)(codeqlURL, authorization, { "User-Agent": "CodeQL Action", ...headers }, tarVersion, tempDir, logger);
|
const toolcacheInfo = getToolcacheDestinationInfo(maybeBundleVersion, maybeCliVersion, logger);
|
||||||
const bundleVersion = maybeBundleVersion ?? tryGetBundleVersionFromUrl(codeqlURL, logger);
|
const extractToToolcache = !!toolcacheInfo && !!(await features.getValue(feature_flags_1.Feature.ExtractToToolcache));
|
||||||
if (bundleVersion === undefined) {
|
const extractedBundlePath = extractToToolcache
|
||||||
|
? toolcacheInfo.path
|
||||||
|
: getTempExtractionDir(tempDir);
|
||||||
|
let statusReport = await (0, tools_download_1.downloadAndExtract)(codeqlURL, extractedBundlePath, authorization, { "User-Agent": "CodeQL Action", ...headers }, tarVersion, logger);
|
||||||
|
if (!toolcacheInfo) {
|
||||||
logger.debug("Could not cache CodeQL tools because we could not determine the bundle version from the " +
|
logger.debug("Could not cache CodeQL tools because we could not determine the bundle version from the " +
|
||||||
`URL ${codeqlURL}.`);
|
`URL ${codeqlURL}.`);
|
||||||
return {
|
return {
|
||||||
@@ -412,22 +427,42 @@ const downloadCodeQL = async function (codeqlURL, maybeBundleVersion, maybeCliVe
|
|||||||
toolsVersion: maybeCliVersion ?? "unknown",
|
toolsVersion: maybeCliVersion ?? "unknown",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
logger.debug("Caching CodeQL bundle.");
|
let codeqlFolder = extractedBundlePath;
|
||||||
const toolcacheVersion = getCanonicalToolcacheVersion(maybeCliVersion, bundleVersion, logger);
|
if (extractToToolcache) {
|
||||||
const toolcacheStart = perf_hooks_1.performance.now();
|
(0, tools_download_1.writeToolcacheMarkerFile)(toolcacheInfo.path, logger);
|
||||||
const toolcachedBundlePath = await toolcache.cacheDir(extractedBundlePath, "CodeQL", toolcacheVersion);
|
}
|
||||||
logger.info(`Added CodeQL bundle to the tool cache (${(0, logging_1.formatDuration)(perf_hooks_1.performance.now() - toolcacheStart)}).`);
|
else {
|
||||||
// Defensive check: we expect `cacheDir` to copy the bundle to a new location.
|
logger.debug("Caching CodeQL bundle.");
|
||||||
if (toolcachedBundlePath !== extractedBundlePath) {
|
const toolcacheStart = perf_hooks_1.performance.now();
|
||||||
await (0, util_1.cleanUpGlob)(extractedBundlePath, "CodeQL bundle from temporary directory", logger);
|
codeqlFolder = await toolcache.cacheDir(extractedBundlePath, "CodeQL", toolcacheInfo.version);
|
||||||
|
const cacheDurationMs = perf_hooks_1.performance.now() - toolcacheStart;
|
||||||
|
logger.info(`Added CodeQL bundle to the tool cache (${(0, logging_1.formatDuration)(cacheDurationMs)}).`);
|
||||||
|
statusReport = {
|
||||||
|
...statusReport,
|
||||||
|
cacheDurationMs,
|
||||||
|
};
|
||||||
|
// Defensive check: we expect `cacheDir` to copy the bundle to a new location.
|
||||||
|
if (codeqlFolder !== extractedBundlePath) {
|
||||||
|
await (0, util_1.cleanUpGlob)(extractedBundlePath, "CodeQL bundle from temporary directory", logger);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
codeqlFolder: toolcachedBundlePath,
|
codeqlFolder,
|
||||||
statusReport,
|
statusReport,
|
||||||
toolsVersion: maybeCliVersion ?? toolcacheVersion,
|
toolsVersion: maybeCliVersion ?? toolcacheInfo.version,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
exports.downloadCodeQL = downloadCodeQL;
|
exports.downloadCodeQL = downloadCodeQL;
|
||||||
|
function getToolcacheDestinationInfo(maybeBundleVersion, maybeCliVersion, logger) {
|
||||||
|
if (maybeBundleVersion) {
|
||||||
|
const version = getCanonicalToolcacheVersion(maybeCliVersion, maybeBundleVersion, logger);
|
||||||
|
return {
|
||||||
|
path: (0, tools_download_1.getToolcacheDirectory)(version),
|
||||||
|
version,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
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) {
|
||||||
@@ -462,7 +497,10 @@ function getCanonicalToolcacheVersion(cliVersion, bundleVersion, logger) {
|
|||||||
*
|
*
|
||||||
* @returns the path to the extracted bundle, and the version of the tools
|
* @returns the path to the extracted bundle, and the version of the tools
|
||||||
*/
|
*/
|
||||||
async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger) {
|
async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, features, defaultCliVersion, logger) {
|
||||||
|
if (!(await util.isBinaryAccessible("tar", logger))) {
|
||||||
|
throw new util.ConfigurationError("Could not find tar in PATH, so unable to extract CodeQL bundle.");
|
||||||
|
}
|
||||||
const zstdAvailability = await tar.isZstdAvailable(logger);
|
const zstdAvailability = await tar.isZstdAvailable(logger);
|
||||||
const source = await getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, variant, zstdAvailability.available, logger);
|
const source = await getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, variant, zstdAvailability.available, logger);
|
||||||
let codeqlFolder;
|
let codeqlFolder;
|
||||||
@@ -472,7 +510,7 @@ async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defau
|
|||||||
switch (source.sourceType) {
|
switch (source.sourceType) {
|
||||||
case "local": {
|
case "local": {
|
||||||
const compressionMethod = tar.inferCompressionMethod(source.codeqlTarPath);
|
const compressionMethod = tar.inferCompressionMethod(source.codeqlTarPath);
|
||||||
codeqlFolder = await tar.extract(source.codeqlTarPath, compressionMethod, zstdAvailability.version, logger);
|
codeqlFolder = await tar.extract(source.codeqlTarPath, getTempExtractionDir(tempDir), compressionMethod, zstdAvailability.version, logger);
|
||||||
toolsSource = ToolsSource.Local;
|
toolsSource = ToolsSource.Local;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -482,7 +520,7 @@ async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defau
|
|||||||
toolsSource = ToolsSource.Toolcache;
|
toolsSource = ToolsSource.Toolcache;
|
||||||
break;
|
break;
|
||||||
case "download": {
|
case "download": {
|
||||||
const result = await (0, exports.downloadCodeQL)(source.codeqlURL, source.bundleVersion, source.cliVersion, apiDetails, zstdAvailability.version, tempDir, logger);
|
const result = await (0, exports.downloadCodeQL)(source.codeqlURL, source.bundleVersion, source.cliVersion, apiDetails, zstdAvailability.version, tempDir, features, logger);
|
||||||
toolsVersion = result.toolsVersion;
|
toolsVersion = result.toolsVersion;
|
||||||
codeqlFolder = result.codeqlFolder;
|
codeqlFolder = result.codeqlFolder;
|
||||||
toolsDownloadStatusReport = result.statusReport;
|
toolsDownloadStatusReport = result.statusReport;
|
||||||
@@ -507,4 +545,7 @@ async function useZstdBundle(cliVersion, tarSupportsZstd) {
|
|||||||
tarSupportsZstd &&
|
tarSupportsZstd &&
|
||||||
semver.gte(cliVersion, feature_flags_1.CODEQL_VERSION_ZSTD_BUNDLE));
|
semver.gte(cliVersion, feature_flags_1.CODEQL_VERSION_ZSTD_BUNDLE));
|
||||||
}
|
}
|
||||||
|
function getTempExtractionDir(tempDir) {
|
||||||
|
return path.join(tempDir, (0, uuid_1.v4)());
|
||||||
|
}
|
||||||
//# sourceMappingURL=setup-codeql.js.map
|
//# sourceMappingURL=setup-codeql.js.map
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user