mirror of
https://github.com/github/codeql-action
synced 2026-10-29 15:08:14 +03:00
Compare commits
141
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8e636781a | ||
|
|
4b0f575f5a | ||
|
|
2d85855366 | ||
|
|
354d3a23c0 | ||
|
|
166cc10f7e | ||
|
|
2dc8ba8ac0 | ||
|
|
16555031e0 | ||
|
|
5fc537340c | ||
|
|
9be075c646 | ||
|
|
844a4fa9f9 | ||
|
|
0a3c5e5f2e | ||
|
|
18f7f5c848 | ||
|
|
c9d42955da | ||
|
|
89dbac699b | ||
|
|
8a992c68e8 | ||
|
|
c9ae8b94e1 | ||
|
|
9ff762d747 | ||
|
|
d59d891623 | ||
|
|
d1617c5ce4 | ||
|
|
05650bc71b | ||
|
|
2d923f7a7e | ||
|
|
179d51bf56 | ||
|
|
1108171143 | ||
|
|
483db645df | ||
|
|
edc50a623c | ||
|
|
bc9bb20aed | ||
|
|
2908c78a82 | ||
|
|
bcc1fbe153 | ||
|
|
0b8f4560ec | ||
|
|
8fb8b475a9 | ||
|
|
4a890e46e0 | ||
|
|
bfac910f06 | ||
|
|
63b184d4bc | ||
|
|
34b4917832 | ||
|
|
171607b66f | ||
|
|
ab743b6301 | ||
|
|
eac0005d0c | ||
|
|
dd68f130c6 | ||
|
|
ce7d3f7738 | ||
|
|
515fac0ed0 | ||
|
|
39119659f3 | ||
|
|
b913bf6353 | ||
|
|
b63386c3d8 | ||
|
|
516bd7cc48 | ||
|
|
49de08391c | ||
|
|
fc9487df66 | ||
|
|
49bbf2b590 | ||
|
|
6d448e0c5f | ||
|
|
3306ba4df7 | ||
|
|
7cd2203aed | ||
|
|
d7e4421be7 | ||
|
|
5a097f3eea | ||
|
|
562acf5a94 | ||
|
|
37a5faff25 | ||
|
|
2d3b6d4530 | ||
|
|
fbf3125415 | ||
|
|
54b2801f20 | ||
|
|
0c057be418 | ||
|
|
040890448b | ||
|
|
c1ab1b4065 | ||
|
|
c2293b32da | ||
|
|
7a0df8fe5b | ||
|
|
5a546846a4 | ||
|
|
00d7ef8570 | ||
|
|
bc1b5da783 | ||
|
|
1b037def00 | ||
|
|
0acb923c1d | ||
|
|
7e3e4f23b1 | ||
|
|
5196baec01 | ||
|
|
bdadc0358c | ||
|
|
87da5f37e5 | ||
|
|
6aa7e65207 | ||
|
|
f033e23010 | ||
|
|
0171a2b52f | ||
|
|
626d8b9364 | ||
|
|
922e2ff061 | ||
|
|
ac509b698f | ||
|
|
b484113f11 | ||
|
|
2d0d1c1dcd | ||
|
|
e0b72fe71a | ||
|
|
b79966a8ee | ||
|
|
54af742a29 | ||
|
|
a50b39a27f | ||
|
|
d04fe60a48 | ||
|
|
308d941317 | ||
|
|
26f5c5e4e0 | ||
|
|
347d5ce5d5 | ||
|
|
c758339759 | ||
|
|
0a00d0c14f | ||
|
|
6b344309f7 | ||
|
|
34f75b50e7 | ||
|
|
487ba2e156 | ||
|
|
fb5d8688b9 | ||
|
|
ec3f8658b6 | ||
|
|
d1db36d302 | ||
|
|
4e7f1a8de7 | ||
|
|
0fcd0abe85 | ||
|
|
0b9cddc4ff | ||
|
|
16aecb7bc0 | ||
|
|
4cf3224289 | ||
|
|
33f58aa90d | ||
|
|
9b32540854 | ||
|
|
b5e1ed9574 | ||
|
|
c3f2a34e23 | ||
|
|
20f5ec3910 | ||
|
|
a83f6f50cd | ||
|
|
67cd8c12d4 | ||
|
|
961c8405b4 | ||
|
|
4707994e6e | ||
|
|
98b8e51380 | ||
|
|
d7bad7d923 | ||
|
|
8357829c18 | ||
|
|
b963054f39 | ||
|
|
ba569ac626 | ||
|
|
581a0e148e | ||
|
|
64723df932 | ||
|
|
67f25913cb | ||
|
|
f422d8a874 | ||
|
|
56e0d42f68 | ||
|
|
596ae5c8cf | ||
|
|
d0ab717e67 | ||
|
|
57804e978e | ||
|
|
24408cc688 | ||
|
|
297dec926f | ||
|
|
8bb7f8f14a | ||
|
|
734778abbe | ||
|
|
912708411b | ||
|
|
6cf1931c04 | ||
|
|
ba6f82195b | ||
|
|
6d82d4f441 | ||
|
|
0e72543776 | ||
|
|
9b5d335b99 | ||
|
|
2d68850214 | ||
|
|
1a7b87e3d1 | ||
|
|
9bf78d13c9 | ||
|
|
64e5c6243a | ||
|
|
2b128fe612 | ||
|
|
7d7a550898 | ||
|
|
23d418cf2e | ||
|
|
924990a9c7 | ||
|
|
4a2ca5c068 |
No files matched your search
@@ -6,11 +6,11 @@ inputs:
|
||||
required: true
|
||||
use-all-platform-bundle:
|
||||
description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL"
|
||||
default: 'false'
|
||||
default: "false"
|
||||
required: false
|
||||
setup-kotlin:
|
||||
description: "If true, we setup kotlin"
|
||||
default: 'true'
|
||||
default: "true"
|
||||
required: true
|
||||
outputs:
|
||||
tools-url:
|
||||
@@ -73,7 +73,10 @@ runs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- uses: fwilhe2/setup-kotlin@9c245a6425255f5e98ba1ce6c15d31fce7eca9da
|
||||
- uses: fwilhe2/setup-kotlin@b325539ca8f6e1d9ee04efed06f49bdbf5426dbb # v2.1
|
||||
if: ${{ inputs.setup-kotlin == 'true' }}
|
||||
with:
|
||||
version: 1.8.21
|
||||
# Kotlin is installed on the runners by default, but the version that is pre-installed is too new
|
||||
# to be supported by CodeQL. This Kotlin version is selected to be compatible with both the default Java
|
||||
# version on the `ubuntu-latest` runners and CodeQL.
|
||||
version: 2.1.20
|
||||
@@ -16,7 +16,7 @@ runs:
|
||||
shell: bash
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: 24
|
||||
cache: 'npm'
|
||||
|
||||
@@ -16,6 +16,14 @@ updates:
|
||||
# This might be fixed when we move to eslint v9.
|
||||
- dependency-name: "eslint-plugin-import"
|
||||
versions: [">=2.30.0"]
|
||||
|
||||
# Some of our dependencies are lagging behind with support for new versions of
|
||||
# `undici` which is why we have to override it in `package.json`. Dependabot
|
||||
# workflows fail when they try to update a dependency that is explicitly
|
||||
# overriden. Since this happens somewhat routinely at the moment, we are
|
||||
# excluding `undici` here and have to manually update it when needed.
|
||||
- dependency-name: "undici"
|
||||
versions: [">=7.30.1"]
|
||||
groups:
|
||||
npm-minor:
|
||||
patterns:
|
||||
@@ -26,7 +34,7 @@ updates:
|
||||
- package-ecosystem: github-actions
|
||||
directories:
|
||||
- "/.github/workflows"
|
||||
- "/.github/actions"
|
||||
- "/.github/actions/*/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
cooldown:
|
||||
|
||||
+2
-2
@@ -54,11 +54,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
- os: macos-latest-xlarge
|
||||
version: nightly-latest
|
||||
- os: windows-latest
|
||||
- os: windows-2025
|
||||
version: nightly-latest
|
||||
name: All-platform bundle
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+8
-8
@@ -34,28 +34,28 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
analysis-kinds: code-scanning
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
analysis-kinds: code-quality
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
analysis-kinds: code-scanning,code-quality
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
analysis-kinds: risk-assessment
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
analysis-kinds: code-scanning
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
analysis-kinds: code-quality
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
analysis-kinds: code-scanning,code-quality
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
analysis-kinds: risk-assessment
|
||||
name: Analysis kinds
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
name: "Analyze: 'ref' and 'sha' from inputs"
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+3
-3
@@ -44,11 +44,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: linked
|
||||
- os: windows-latest
|
||||
- os: windows-2025
|
||||
version: linked
|
||||
name: autobuild-action
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
@@ -44,13 +44,13 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: windows-latest
|
||||
- os: windows-2025
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
- os: windows-latest
|
||||
- os: windows-2025
|
||||
version: nightly-latest
|
||||
name: Autobuild direct tracing (custom working directory)
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install Java
|
||||
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
|
||||
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
|
||||
with:
|
||||
java-version: ${{ inputs.java-version || '17' }}
|
||||
distribution: temurin
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
name: Autobuild working directory
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+5
-5
@@ -44,13 +44,13 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: windows-latest
|
||||
- os: windows-2025
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
- os: windows-latest
|
||||
- os: windows-2025
|
||||
version: nightly-latest
|
||||
name: Build mode autobuild
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install Java
|
||||
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
|
||||
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
|
||||
with:
|
||||
java-version: ${{ inputs.java-version || '17' }}
|
||||
distribution: temurin
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Build mode manual
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+2
-2
@@ -34,9 +34,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Build mode none
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Build mode rollback
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
name: 'Bundle: From nightly'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+18
-20
@@ -34,7 +34,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: toolcache
|
||||
name: 'Bundle: From toolcache'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
@@ -46,6 +46,15 @@ jobs:
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: npm
|
||||
- name: Install newer npm
|
||||
run: npm install -g npm@11.19.1
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Prepare test
|
||||
id: prepare-test
|
||||
uses: ./.github/actions/prepare-test
|
||||
@@ -53,31 +62,20 @@ jobs:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
setup-kotlin: 'true'
|
||||
- name: Install @actions/tool-cache
|
||||
run: npm install @actions/tool-cache@3
|
||||
- name: Check toolcache contains CodeQL
|
||||
continue-on-error: true
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
const toolcache = require('@actions/tool-cache');
|
||||
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
|
||||
if (allCodeqlVersions.length === 0) {
|
||||
throw new Error(`CodeQL could not be found in the toolcache`);
|
||||
}
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts installed
|
||||
|
||||
- id: setup-codeql
|
||||
uses: ./../action/setup-codeql
|
||||
with:
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
|
||||
- name: Check CodeQL is installed within the toolcache
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
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');
|
||||
}
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts installed
|
||||
env:
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
Generated
+25
-33
@@ -34,11 +34,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: linked
|
||||
- os: windows-latest
|
||||
- os: windows-2025
|
||||
version: linked
|
||||
name: 'Bundle: Caching checks'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
@@ -50,6 +50,15 @@ jobs:
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: npm
|
||||
- name: Install newer npm
|
||||
run: npm install -g npm@11.19.1
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Prepare test
|
||||
id: prepare-test
|
||||
uses: ./.github/actions/prepare-test
|
||||
@@ -58,47 +67,30 @@ jobs:
|
||||
use-all-platform-bundle: 'false'
|
||||
setup-kotlin: 'true'
|
||||
- name: Remove CodeQL from toolcache
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
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@3
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts clear
|
||||
|
||||
- name: Check toolcache does not contain CodeQL
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
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');
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts absent
|
||||
|
||||
- id: init
|
||||
uses: ./../action/init
|
||||
with:
|
||||
# Request multiple languages so this check uses the combined bundle.
|
||||
languages: javascript,python
|
||||
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@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
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');
|
||||
}
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts installed -n 1
|
||||
env:
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
+1
-1
@@ -34,7 +34,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
name: Clean up database cluster directory
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+2
-2
@@ -34,9 +34,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Config export
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+1
-1
@@ -34,7 +34,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
name: Config input
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+3
-3
@@ -34,11 +34,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: 'C/C++: disabling autoinstalling dependencies (Linux)'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+2
-2
@@ -34,9 +34,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: linked
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: nightly-latest
|
||||
name: 'C/C++: autoinstalling dependencies is skipped (macOS)'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+3
-3
@@ -34,11 +34,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: 'C/C++: autoinstalling dependencies (Linux)'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+2
-2
@@ -34,9 +34,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Diagnostic export
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
# Warning: This file is generated automatically, and should not be modified.
|
||||
# Instead, please modify the template in the pr-checks directory and run:
|
||||
# pr-checks/sync.sh
|
||||
# to regenerate this file.
|
||||
|
||||
name: PR Check - Diagnostic export without database
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GO111MODULE: auto
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- releases/v*
|
||||
pull_request: {}
|
||||
merge_group:
|
||||
types:
|
||||
- checks_requested
|
||||
schedule:
|
||||
- cron: '0 5 * * *'
|
||||
workflow_dispatch:
|
||||
inputs: {}
|
||||
workflow_call:
|
||||
inputs: {}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
concurrency:
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' || false }}
|
||||
group: diagnostics-without-db-${{github.ref}}
|
||||
jobs:
|
||||
diagnostics-without-db:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
name: Diagnostic export without database
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: read
|
||||
timeout-minutes: 45
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
# We deliberately need to make this step fail before the database is initialised, but after
|
||||
# some diagnostic has been produced. The simplest way to do that right now is to:
|
||||
#
|
||||
# - Produce a diagnostic before the db is initialised by forcing the use of a nightly release
|
||||
# with the `CODEQL_ACTION_FORCE_NIGHTLY` feature flag.
|
||||
# - Cause `init` to abort because we are attempting to analyse Swift on a non-macOS runner.
|
||||
#
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: npm
|
||||
- name: Install newer npm
|
||||
run: npm install -g npm@11.19.1
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Prepare test
|
||||
id: prepare-test
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
setup-kotlin: 'true'
|
||||
- name: Initialise failing analysis
|
||||
id: init
|
||||
uses: ./../action/init
|
||||
continue-on-error: true
|
||||
env:
|
||||
CODEQL_ACTION_FORCE_NIGHTLY: true
|
||||
with:
|
||||
languages: swift
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
|
||||
- name: Analyze
|
||||
uses: ./analyze
|
||||
# In a real workflow, this step wouldn't run. Since we used `continue-on-error`
|
||||
# above, we manually disable it with an `if` condition. Having this step is required
|
||||
# for the init post-action because it checks the workflow definition for e.g. the
|
||||
# `category` input. Without this step, that part of the init post-action would fail.
|
||||
if: false
|
||||
with:
|
||||
category: '/test-codeql-version:${{ matrix.version }}'
|
||||
|
||||
- name: Check diagnostics appear on disk
|
||||
env:
|
||||
DIAGNOSTICS_DIR: '${{ runner.temp }}/codeql-action-temp-diagnostics/'
|
||||
run: |
|
||||
cd ../action
|
||||
npx tsx ./pr-checks/diagnostics-without-db.ts
|
||||
env:
|
||||
CODEQL_ACTION_SKIP_GENERATE_FAILED_SARIF: false
|
||||
CODEQL_ACTION_SKIP_SARIF_UPLOAD: true
|
||||
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
diagnostics-without-db-validation:
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
needs:
|
||||
- diagnostics-without-db
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: read
|
||||
timeout-minutes: 5
|
||||
runs-on: ubuntu-26.04
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: npm
|
||||
- name: Install newer npm
|
||||
run: npm install -g npm@11.19.1
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Download workflow artifact
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
pattern: test-mode-sarif-*
|
||||
path: sarif
|
||||
|
||||
- name: List artifact contents
|
||||
run: ls -laR ./sarif
|
||||
|
||||
- name: Check diagnostics appear in SARIF
|
||||
env:
|
||||
SARIF_PATH: "./sarif/codeql-failed-run.sarif"
|
||||
DIAGNOSTIC_ID: "codeql-action/forced-nightly-cli"
|
||||
DIAGNOSTIC_NAME: "A nightly release of CodeQL was used"
|
||||
EXPECTED_LOCATIONS: "0"
|
||||
EXPECTED_MESSAGE: |
|
||||
GitHub configured this analysis to use a nightly release of CodeQL to allow you to preview changes from an upcoming release.
|
||||
run: npx tsx ./pr-checks/check-diagnostics.ts
|
||||
env:
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
+8
-4
@@ -54,11 +54,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: nightly-latest
|
||||
- os: windows-latest
|
||||
- os: windows-2025
|
||||
version: nightly-latest
|
||||
name: Export file baseline information
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
@@ -91,6 +91,11 @@ jobs:
|
||||
with:
|
||||
languages: javascript
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
# To balance speed and coverage, analyze only JavaScript but use the combined bundle so
|
||||
# baseline information is reported for every language in the multi-language repository. A
|
||||
# custom configuration prevents per-language bundles from being used.
|
||||
config: |
|
||||
paths-ignore: []
|
||||
- name: Build code
|
||||
run: ./build.sh
|
||||
- uses: ./../action/analyze
|
||||
@@ -124,5 +129,4 @@ jobs:
|
||||
env:
|
||||
CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS: false
|
||||
CODEQL_ACTION_SUBLANGUAGE_FILE_COVERAGE: true
|
||||
CODEQL_ACTION_PER_LANGUAGE_BUNDLES: false
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
+1
-1
@@ -34,7 +34,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
name: Extractor ram and threads options test
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+2
-2
@@ -34,9 +34,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Proxy test
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+2
-2
@@ -54,9 +54,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: 'Go: Custom queries'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
name: 'Go: diagnostic when Go is changed after init step'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
name: 'Go: diagnostic when `file` is not installed'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
name: 'Go: workaround for indirect tracing'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+11
-11
@@ -44,27 +44,27 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-24.04
|
||||
version: stable-v2.20.7
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.21.4
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.22.4
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.23.9
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.24.3
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.25.6
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: nightly-latest
|
||||
name: 'Go: tracing with autobuilder step'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+11
-11
@@ -44,27 +44,27 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-24.04
|
||||
version: stable-v2.20.7
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.21.4
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.22.4
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.23.9
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.24.3
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.25.6
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: nightly-latest
|
||||
name: 'Go: tracing with custom build steps'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+11
-11
@@ -44,27 +44,27 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-24.04
|
||||
version: stable-v2.20.7
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.21.4
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.22.4
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.23.9
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.24.3
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.25.6
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: nightly-latest
|
||||
name: 'Go: tracing with legacy workflow'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+3
-3
@@ -34,11 +34,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: 'Packaging: Download using registries'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+3
-3
@@ -34,11 +34,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Custom source root
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Job run UUID added to SARIF
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+1
-1
@@ -34,7 +34,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
name: Language aliases
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+1
-1
@@ -54,7 +54,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
name: Local CodeQL bundle
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+9
-9
@@ -54,39 +54,39 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-24.04
|
||||
version: stable-v2.20.7
|
||||
- os: macos-15-xlarge
|
||||
version: stable-v2.20.7
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.21.4
|
||||
- os: macos-15-xlarge
|
||||
version: stable-v2.21.4
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.22.4
|
||||
- os: macos-15-xlarge
|
||||
version: stable-v2.22.4
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.23.9
|
||||
- os: macos-latest-xlarge
|
||||
version: stable-v2.23.9
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.24.3
|
||||
- os: macos-latest-xlarge
|
||||
version: stable-v2.24.3
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.25.6
|
||||
- os: macos-latest-xlarge
|
||||
version: stable-v2.25.6
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: macos-latest-xlarge
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: macos-latest-xlarge
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
- os: macos-latest-xlarge
|
||||
version: nightly-latest
|
||||
|
||||
+2
-2
@@ -34,9 +34,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Overlay database init fallback
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
@@ -54,11 +54,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: 'Packaging: Config and input passed to the CLI'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+3
-3
@@ -54,11 +54,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: 'Packaging: Config and input'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+3
-3
@@ -54,11 +54,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: 'Packaging: Config file'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+3
-3
@@ -54,11 +54,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: 'Packaging: Action input'
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+25
-14
@@ -36,40 +36,40 @@ jobs:
|
||||
include:
|
||||
- language: actions
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
expected-extractors: actions javascript
|
||||
- language: cpp
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
build-mode: manual
|
||||
build-command: gcc -o main main.c
|
||||
- language: csharp
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
build-mode: none
|
||||
- language: go
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
build-mode: autobuild
|
||||
- language: java
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
build-mode: none
|
||||
- language: javascript
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
- language: python
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
- language: ruby
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
- language: rust
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
- language: swift
|
||||
os: macos-latest-xlarge
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
build-mode: autobuild
|
||||
name: Per-language bundles
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
@@ -81,6 +81,15 @@ jobs:
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: npm
|
||||
- name: Install newer npm
|
||||
run: npm install -g npm@11.19.1
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Prepare test
|
||||
id: prepare-test
|
||||
uses: ./.github/actions/prepare-test
|
||||
@@ -88,6 +97,10 @@ jobs:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
setup-kotlin: 'true'
|
||||
- name: Remove CodeQL from toolcache
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts clear
|
||||
- uses: ./../action/init
|
||||
id: init
|
||||
with:
|
||||
@@ -128,9 +141,8 @@ jobs:
|
||||
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
|
||||
run: |
|
||||
# A bundle that is missing most of its extractors must never be left in the toolcache,
|
||||
# where a later job analyzing a different language could pick it up. The runner image
|
||||
# ships with its own CodeQL in the toolcache, so check where this bundle was extracted to
|
||||
# rather than whether the toolcache contains CodeQL at all.
|
||||
# where a later job analyzing a different language could pick it up. Per-language bundles
|
||||
# must instead be extracted under the runner's temporary directory.
|
||||
echo "CodeQL is at $CODEQL_PATH"
|
||||
if [[ "$CODEQL_PATH" == "$RUNNER_TOOL_CACHE"/* ]]; then
|
||||
echo "::error::The per-language bundle was added to the toolcache at $CODEQL_PATH."
|
||||
@@ -160,5 +172,4 @@ jobs:
|
||||
fi
|
||||
echo "Created a ${LANGUAGE} database at ${database}."
|
||||
env:
|
||||
CODEQL_ACTION_PER_LANGUAGE_BUNDLES: true
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
Generated
+2
-2
@@ -54,9 +54,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Remote config file
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+3
-3
@@ -34,11 +34,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Resolve environment
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
-74
@@ -1,74 +0,0 @@
|
||||
# Warning: This file is generated automatically, and should not be modified.
|
||||
# Instead, please modify the template in the pr-checks directory and run:
|
||||
# pr-checks/sync.sh
|
||||
# to regenerate this file.
|
||||
|
||||
name: PR Check - RuboCop multi-language
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GO111MODULE: auto
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- releases/v*
|
||||
pull_request: {}
|
||||
merge_group:
|
||||
types:
|
||||
- checks_requested
|
||||
schedule:
|
||||
- cron: '0 5 * * *'
|
||||
workflow_dispatch:
|
||||
inputs: {}
|
||||
workflow_call:
|
||||
inputs: {}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
concurrency:
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' || false }}
|
||||
group: rubocop-multi-language-${{github.ref}}
|
||||
jobs:
|
||||
rubocop-multi-language:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
name: RuboCop multi-language
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: read
|
||||
timeout-minutes: 45
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Prepare test
|
||||
id: prepare-test
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
setup-kotlin: 'true'
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
- name: Install Code Scanning integration
|
||||
run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install
|
||||
- name: Install dependencies
|
||||
run: bundle install
|
||||
- name: RuboCop run
|
||||
run: |
|
||||
bash -c "
|
||||
bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
|
||||
[[ $? -ne 2 ]]
|
||||
"
|
||||
- uses: ./../action/upload-sarif
|
||||
with:
|
||||
sarif_file: rubocop.sarif
|
||||
env:
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
Generated
+6
-6
@@ -34,17 +34,17 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: nightly-latest
|
||||
name: Ruby analysis
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+5
-5
@@ -34,15 +34,15 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-24.04
|
||||
version: stable-v2.20.7
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: stable-v2.22.1
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Rust analysis
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+6
-6
@@ -54,17 +54,17 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: nightly-latest
|
||||
name: Split workflow
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+3
-3
@@ -34,11 +34,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: macos-latest
|
||||
- os: macos-26
|
||||
version: linked
|
||||
- os: windows-latest
|
||||
- os: windows-2025
|
||||
version: linked
|
||||
name: Start proxy
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+6
-4
@@ -34,11 +34,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Submit SARIF after failure
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
@@ -71,7 +71,9 @@ jobs:
|
||||
run: exit 1
|
||||
- uses: ./analyze
|
||||
# In a real workflow, this step wouldn't run. Since we used `continue-on-error`
|
||||
# above, we manually disable it with an `if` condition.
|
||||
# above, we manually disable it with an `if` condition. Having this step is required
|
||||
# for the init post-action because it checks the workflow definition for e.g. the
|
||||
# `category` input. Without this step, that part of the init post-action would fail.
|
||||
if: false
|
||||
with:
|
||||
category: '/test-codeql-version:${{ matrix.version }}'
|
||||
|
||||
+2
-2
@@ -54,9 +54,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: nightly-latest
|
||||
name: Test unsetting environment variables
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
name: "Upload-sarif: 'ref' and 'sha' from inputs"
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
Generated
+3
-3
@@ -54,13 +54,13 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
analysis-kinds: code-scanning
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
analysis-kinds: code-quality
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: default
|
||||
analysis-kinds: code-scanning,code-quality
|
||||
name: Test different uses of `upload-sarif`
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
- os: ubuntu-26.04
|
||||
version: linked
|
||||
name: Use a custom `checkout_path`
|
||||
if: github.triggering_actor != 'dependabot[bot]'
|
||||
|
||||
@@ -6,13 +6,13 @@ env:
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- releases/v*
|
||||
- main
|
||||
- releases/v*
|
||||
pull_request:
|
||||
merge_group:
|
||||
types: [checks_requested]
|
||||
schedule:
|
||||
- cron: '0 5 * * *'
|
||||
- cron: "0 5 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -30,10 +30,10 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- stable-v2.20.7
|
||||
- default
|
||||
- linked
|
||||
- nightly-latest
|
||||
- stable-v2.20.7
|
||||
- default
|
||||
- linked
|
||||
- nightly-latest
|
||||
name: Upload debug artifacts after failure in analyze
|
||||
continue-on-error: true
|
||||
env:
|
||||
@@ -43,7 +43,12 @@ jobs:
|
||||
# We currently need `security-events: read` to access feature flags.
|
||||
security-events: read
|
||||
timeout-minutes: 45
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# stable-v2.20.7 requires an older version of Java than the default on `ubuntu-latest` (`ubuntu-26.04`).
|
||||
# We could install that older version on the newer runners, or use the older runner.
|
||||
# We do the latter here. This can be removed once we stop supporting `v2.20.7`.
|
||||
runs-on: ${{ case(matrix.version == 'stable-v2.20.7', 'ubuntu-24.04', 'ubuntu-latest') }}
|
||||
|
||||
steps:
|
||||
- name: Dump GitHub event
|
||||
run: cat "${GITHUB_EVENT_PATH}"
|
||||
@@ -60,7 +65,7 @@ jobs:
|
||||
- name: Install .NET
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
with:
|
||||
dotnet-version: '9.x'
|
||||
dotnet-version: "9.x"
|
||||
- name: Assert best-effort artifact scan completed
|
||||
uses: ./../action/.github/actions/verify-debug-artifact-scan-completed
|
||||
- uses: ./../action/init
|
||||
@@ -92,6 +97,7 @@ jobs:
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
- name: Check expected artifacts exist
|
||||
run: |
|
||||
VERSIONS="stable-v2.20.7 default linked nightly-latest"
|
||||
LANGUAGES="cpp csharp go java javascript python"
|
||||
for version in $VERSIONS; do
|
||||
echo "Artifacts from version $version:"
|
||||
|
||||
@@ -5,13 +5,13 @@ env:
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- releases/v*
|
||||
- main
|
||||
- releases/v*
|
||||
pull_request:
|
||||
merge_group:
|
||||
types: [checks_requested]
|
||||
schedule:
|
||||
- cron: '0 5 * * *'
|
||||
- cron: "0 5 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@@ -29,10 +29,10 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- stable-v2.20.7
|
||||
- default
|
||||
- linked
|
||||
- nightly-latest
|
||||
- stable-v2.20.7
|
||||
- default
|
||||
- linked
|
||||
- nightly-latest
|
||||
name: Upload debug artifacts
|
||||
env:
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
@@ -41,7 +41,12 @@ jobs:
|
||||
contents: read
|
||||
# We currently need `security-events: read` to access feature flags.
|
||||
security-events: read
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# stable-v2.20.7 requires an older version of Java than the default on `ubuntu-latest` (`ubuntu-26.04`).
|
||||
# We could install that older version on the newer runners, or use the older runner.
|
||||
# We do the latter here. This can be removed once we stop supporting `v2.20.7`.
|
||||
runs-on: ${{ case(matrix.version == 'stable-v2.20.7', 'ubuntu-24.04', 'ubuntu-latest') }}
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
@@ -56,7 +61,7 @@ jobs:
|
||||
- name: Install .NET
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
with:
|
||||
dotnet-version: '9.x'
|
||||
dotnet-version: "9.x"
|
||||
- name: Assert best-effort artifact scan completed
|
||||
uses: ./../action/.github/actions/verify-debug-artifact-scan-completed
|
||||
- uses: ./../action/init
|
||||
|
||||
@@ -60,7 +60,6 @@ on:
|
||||
- "PR Check - Proxy test"
|
||||
- "PR Check - Remote config file"
|
||||
- "PR Check - Resolve environment"
|
||||
- "PR Check - RuboCop multi-language"
|
||||
- "PR Check - Ruby analysis"
|
||||
- "PR Check - Rust analysis"
|
||||
- "PR Check - Split workflow"
|
||||
|
||||
@@ -134,7 +134,7 @@ jobs:
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Generate token
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ vars.AUTOMATION_APP_ID }}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
name: PR dequeued
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- dequeued
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
name: Notify
|
||||
runs-on: ubuntu-slim
|
||||
|
||||
if: github.event.pull_request.merged != true
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Notify that the PR was removed from the merge queue
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
REASON: ${{ github.event.reason }}
|
||||
run: |
|
||||
# Mention whoever added the PR to the merge queue rather than the PR author, who may be a
|
||||
# bot such as Dependabot. The `dequeued` event payload doesn't identify the enqueuer, so
|
||||
# look them up in the most recent `AddedToMergeQueueEvent` on the PR's timeline.
|
||||
enqueuer=$(gh api graphql \
|
||||
-F number="$PR_NUMBER" \
|
||||
-f query='
|
||||
query($number: Int!) {
|
||||
repository(owner: "github", name: "codeql-action") {
|
||||
pullRequest(number: $number) {
|
||||
timelineItems(itemTypes: [ADDED_TO_MERGE_QUEUE_EVENT], last: 1) {
|
||||
nodes { ... on AddedToMergeQueueEvent { enqueuer { login } } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}' \
|
||||
--jq '.data.repository.pullRequest.timelineItems.nodes[0].enqueuer.login')
|
||||
echo "@$enqueuer The pull request was removed from the merge queue (\`$REASON\`)." \
|
||||
"Please resolve any issues if required and enqueue the PR again." |
|
||||
gh pr comment --body-file - --repo github/codeql-action "$PR_NUMBER"
|
||||
@@ -139,7 +139,7 @@ jobs:
|
||||
|
||||
- name: Generate token
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ vars.AUTOMATION_APP_ID }}
|
||||
|
||||
@@ -95,7 +95,7 @@ jobs:
|
||||
pull-requests: write # needed to create pull request
|
||||
steps:
|
||||
- name: Generate token
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ vars.AUTOMATION_APP_ID }}
|
||||
|
||||
@@ -4,6 +4,10 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
|
||||
|
||||
## [UNRELEASED]
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 4.39.1 - 21 Oct 2026
|
||||
|
||||
- Update default CodeQL bundle version to [2.27.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.3). [#4256](https://github.com/github/codeql-action/pull/4256)
|
||||
|
||||
## 4.39.0 - 15 Oct 2026
|
||||
|
||||
@@ -76,7 +76,6 @@ We typically release new minor versions of the CodeQL Action and Bundle when a n
|
||||
| `v4.33.0` | `2.24.3` | Enterprise Server 3.21 | |
|
||||
| `v4.31.10` | `2.23.9` | Enterprise Server 3.20 | |
|
||||
| `v3.29.11` | `2.22.4` | Enterprise Server 3.19 | |
|
||||
| `v3.28.21` | `2.21.3` | Enterprise Server 3.18 | |
|
||||
|
||||
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).
|
||||
|
||||
|
||||
Generated
+14675
-6911
File diff suppressed because it is too large.
Load diff
Generated
+101
-82
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "codeql",
|
||||
"version": "4.39.1",
|
||||
"version": "4.39.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "codeql",
|
||||
"version": "4.39.1",
|
||||
"version": "4.39.2",
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
"pr-checks"
|
||||
@@ -30,13 +30,13 @@
|
||||
"follow-redirects": "^1.16.1",
|
||||
"get-folder-size": "^5.0.0",
|
||||
"https-proxy-agent": "^7.0.6",
|
||||
"js-yaml": "^5.4.3",
|
||||
"js-yaml": "^5.5.0",
|
||||
"jsonschema": "1.5.0",
|
||||
"long": "^5.3.2",
|
||||
"node-forge": "^1.4.0",
|
||||
"semver": "^7.8.5",
|
||||
"undici": "^6.28.0",
|
||||
"uuid": "^14.0.2"
|
||||
"undici": "^7.30.1",
|
||||
"uuid": "^14.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ava/typescript": "6.0.0",
|
||||
@@ -57,14 +57,14 @@
|
||||
"eslint-import-resolver-typescript": "^4.4.5",
|
||||
"eslint-plugin-github": "^6.1.2",
|
||||
"eslint-plugin-import-x": "^4.17.1",
|
||||
"eslint-plugin-jsdoc": "^65.2.0",
|
||||
"eslint-plugin-jsdoc": "^65.3.15",
|
||||
"eslint-plugin-no-async-foreach": "^0.1.1",
|
||||
"glob": "^13.0.6",
|
||||
"globals": "^17.13.0",
|
||||
"nock": "^14.0.17",
|
||||
"sinon": "^22.1.0",
|
||||
"typescript": "^6.0.3",
|
||||
"typescript-eslint": "^8.71.1"
|
||||
"typescript-eslint": "^8.72.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@aashutoshrathi/word-wrap": {
|
||||
@@ -2702,17 +2702,17 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.71.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.71.1.tgz",
|
||||
"integrity": "sha512-nNlBf6HuotqMgZvSkWD5hNdemiBIxQ2NmrlgfcUIeZRs+BbakjscCQRq/Hb74EFVnFiSWWdL12JruqwBy3ERDw==",
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.0.tgz",
|
||||
"integrity": "sha512-aysKgysPX9XOv/dk95UkvUDe++Q3n3dJPG9CEWT3RUccxfkPJ+Qn6nhKPDhZXU6Ofo9kgwGWwKyQCnZIXTgngg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.12.2",
|
||||
"@typescript-eslint/scope-manager": "8.71.1",
|
||||
"@typescript-eslint/type-utils": "8.71.1",
|
||||
"@typescript-eslint/utils": "8.71.1",
|
||||
"@typescript-eslint/visitor-keys": "8.71.1",
|
||||
"@typescript-eslint/scope-manager": "8.72.0",
|
||||
"@typescript-eslint/type-utils": "8.72.0",
|
||||
"@typescript-eslint/utils": "8.72.0",
|
||||
"@typescript-eslint/visitor-keys": "8.72.0",
|
||||
"ignore": "^7.0.5",
|
||||
"natural-compare": "^1.4.0",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
@@ -2725,7 +2725,7 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/parser": "^8.71.1",
|
||||
"@typescript-eslint/parser": "^8.72.0",
|
||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
@@ -2741,16 +2741,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "8.71.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.71.1.tgz",
|
||||
"integrity": "sha512-oM/5sAqz/l1v/zYK1qTOPrn2+JIrBGC1V6uNYucRO5gh6eT9vWJ/RhPbGE59byvZEUQ4VP6XkLBaS5Jti5jpvw==",
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.0.tgz",
|
||||
"integrity": "sha512-0O+x3ynciD6zuXb1CKSu165haQV6ey53DKhHHUnujP7U+XlltJG+/keT0Xhd1HXCze+IHf7Tvt39ovyepX/LNw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.71.1",
|
||||
"@typescript-eslint/types": "8.71.1",
|
||||
"@typescript-eslint/typescript-estree": "8.71.1",
|
||||
"@typescript-eslint/visitor-keys": "8.71.1",
|
||||
"@typescript-eslint/scope-manager": "8.72.0",
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"@typescript-eslint/typescript-estree": "8.72.0",
|
||||
"@typescript-eslint/visitor-keys": "8.72.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -2784,14 +2784,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.71.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.71.1.tgz",
|
||||
"integrity": "sha512-Oijc9RUsohHjncg6iGi7gCtjnEjYt9FWv9u6ygK8uKcHK5eLjLAkqERQ9BaytbpceOFdk6kifPCS/zAZE+A99g==",
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.0.tgz",
|
||||
"integrity": "sha512-bzHngBbmIgzj6TsTjVUCntGx6FFLgE7mPjpO0PzHycOaZHXqS43XnrkFIHRS16LLr/xO6FHSXG3GJFo/F4bSBQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.71.1",
|
||||
"@typescript-eslint/types": "^8.71.1",
|
||||
"@typescript-eslint/tsconfig-utils": "^8.72.0",
|
||||
"@typescript-eslint/types": "^8.72.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -2824,14 +2824,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "8.71.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.71.1.tgz",
|
||||
"integrity": "sha512-1YUDZXdTnXLlob03SFHBipdyMBsDVm7zoSz0ytTJ39dk5J1TgsTK03VlR/dLXG/RLLUrPcYbD4rp23BmHxHP0w==",
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.0.tgz",
|
||||
"integrity": "sha512-JewPyJOYcXBSAS7PIgufscHOwZqhTGyBRiQJhhuDln66tMchxvvt7nJ90JKKIoOelmdHA3kAQbm9cEUHc4JSEA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.71.1",
|
||||
"@typescript-eslint/visitor-keys": "8.71.1"
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"@typescript-eslint/visitor-keys": "8.72.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -2842,9 +2842,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/tsconfig-utils": {
|
||||
"version": "8.71.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.71.1.tgz",
|
||||
"integrity": "sha512-oTvkml5SxXhgg+WWKhod5qWQICDXtOB+/Hi9VdPKFAANJ2b7YOgMffgvzXuqog7R6A/JtrzRf128dsxummyWhg==",
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.0.tgz",
|
||||
"integrity": "sha512-0vbxCf7xLVPSjcOdm6eQbgViH8EDJ8xnl1laLT9yoqSz2YmcSfSg5Vdl0JUvZf6rcuJ0ZivJIuMD4edTg8obaA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -2859,15 +2859,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "8.71.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.71.1.tgz",
|
||||
"integrity": "sha512-kH3t3jZCYv2PZSBEWPKTariLrCaoF1CLoPitYFBJOhAGEwWnSRAtGEifrfrpBa4K9JlwWNZotgA5w3/wLSk/FQ==",
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.0.tgz",
|
||||
"integrity": "sha512-gEXxmmbSTSOVTC37IYYvremOM31v+UN2W772bJxmVYPhAOPSUxtacyb7wkm1EhkYKU6KzFJsdU44DCV4to0LWw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.71.1",
|
||||
"@typescript-eslint/typescript-estree": "8.71.1",
|
||||
"@typescript-eslint/utils": "8.71.1",
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"@typescript-eslint/typescript-estree": "8.72.0",
|
||||
"@typescript-eslint/utils": "8.72.0",
|
||||
"debug": "^4.4.3",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
@@ -2902,9 +2902,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "8.71.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.71.1.tgz",
|
||||
"integrity": "sha512-ybYnPTUwg3VQQOFEiBPLs8Jxl1ry2vXdn1kVKguomBbvxpetdu3MKTNDqFNUrlG8ylP9MpZosmXMFYlGQHk1oQ==",
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.0.tgz",
|
||||
"integrity": "sha512-Adfoy59kxNEjT5E5fnyrp7GpHYuWs8ONbdohu4ez6IU46qDq8LltG90tLmkucZB2uhYL8mqBjtXqGd8yhfjXqQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -2916,16 +2916,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.71.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.71.1.tgz",
|
||||
"integrity": "sha512-pSKSEK1JJpHs6KiKVtABCE4iJK5d7FLFzDXQNBQ2oRY7LEd3UwOt3TZemTgu9syTIf56dJWlTn/pdmrO9oKUXQ==",
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.0.tgz",
|
||||
"integrity": "sha512-gwLfFgWcw15tN2KXDCJvxEOQjPn+P3j/n3eSqkZ5sX4VpW9Cosodr+tWwBZRvJT3TcKx6HnPRGZMCNAiP1Xhug==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/project-service": "8.71.1",
|
||||
"@typescript-eslint/tsconfig-utils": "8.71.1",
|
||||
"@typescript-eslint/types": "8.71.1",
|
||||
"@typescript-eslint/visitor-keys": "8.71.1",
|
||||
"@typescript-eslint/project-service": "8.72.0",
|
||||
"@typescript-eslint/tsconfig-utils": "8.72.0",
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"@typescript-eslint/visitor-keys": "8.72.0",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^10.2.2",
|
||||
"semver": "^7.7.3",
|
||||
@@ -3001,16 +3001,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "8.71.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.71.1.tgz",
|
||||
"integrity": "sha512-CBjT6gfAz3DW2j9Q4moFnqt208Aq+506sVGXfpRcyAeqn0EpayL0mjdWoCO2t3RC7GewNrFxdeehuEaPg6DMzQ==",
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.0.tgz",
|
||||
"integrity": "sha512-0up3oArJZBYnzOaEXKo8DmI43QvMZyPoFEt9LWzRJcyl/RcJjfKKPebknN1VbTgXBf3M/KggUh5uUMdURLnseg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.9.1",
|
||||
"@typescript-eslint/scope-manager": "8.71.1",
|
||||
"@typescript-eslint/types": "8.71.1",
|
||||
"@typescript-eslint/typescript-estree": "8.71.1"
|
||||
"@typescript-eslint/scope-manager": "8.72.0",
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"@typescript-eslint/typescript-estree": "8.72.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -3025,13 +3025,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "8.71.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.71.1.tgz",
|
||||
"integrity": "sha512-0GxiUGqMU0qXJt58cBsiG3DP8lUmBaFo2vChtUX+CT7PnR3v/VGLLrzVP4K9r1lNiZXjHYefMBbPunplr09v6w==",
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.0.tgz",
|
||||
"integrity": "sha512-E2mroviasaWecDzTGiGMtuEguuLVOeRggnrIn93CJuxYJzQBHbyymlT08aVQydbBal5538o+JkBKXh2sRuCyIA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.71.1",
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"eslint-visitor-keys": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -3576,6 +3576,7 @@
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "2.0.1",
|
||||
"dev": true,
|
||||
"license": "Python-2.0"
|
||||
},
|
||||
"node_modules/aria-query": {
|
||||
@@ -5365,9 +5366,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jsdoc": {
|
||||
"version": "65.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-65.2.0.tgz",
|
||||
"integrity": "sha512-IMZaNwdDa5otUQYGWN1pzywZLsGKswitvFFNhcO8IOsBfaWpWIDXYuZh2sYhe9MNyKN9hz0YryOFaKdpbTP5Bw==",
|
||||
"version": "65.3.15",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-65.3.15.tgz",
|
||||
"integrity": "sha512-cpU66X+daaX2X6cndE0grdLAIlodysI3KuUEdrJd6FvQHuuYOOvMRAdy8ToYjyJrsoUv0fXkMclA5RM5kaipMw==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
@@ -7121,9 +7122,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "5.4.3",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.4.3.tgz",
|
||||
"integrity": "sha512-yzzNtgczwgoVHNigCyKTXcQJU4Y8t/ikU4UxXW0BvrLfHTGWZhsNcOT2s/a7vn81/4KqVnNmHjaUEPlvWnNwVw==",
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.5.0.tgz",
|
||||
"integrity": "sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
@@ -7136,12 +7137,28 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1"
|
||||
"argparse": "^3.0.3"
|
||||
},
|
||||
"bin": {
|
||||
"js-yaml": "bin/js-yaml.mjs"
|
||||
}
|
||||
},
|
||||
"node_modules/js-yaml/node_modules/argparse": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.3.tgz",
|
||||
"integrity": "sha512-Sn98ftV3KfsO8xfLPHG6oT8y+b0yvbrLgZjgPDXsharNY15tTAjqIsIju4S32nl6/iEUNNE4v+yL2Zhm8ooP3w==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/puzrin"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nodeca"
|
||||
}
|
||||
],
|
||||
"license": "PSF-2.0"
|
||||
},
|
||||
"node_modules/jschardet": {
|
||||
"version": "3.1.4",
|
||||
"resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz",
|
||||
@@ -9981,16 +9998,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript-eslint": {
|
||||
"version": "8.71.1",
|
||||
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.71.1.tgz",
|
||||
"integrity": "sha512-oiNVPC3/NbV1FpaHU07l8O6ynqG9v4PAiW2WvTrAmZdR0f2HI/gE668ElMLCK7Xbsu5k2fK5C4fXNiq05j7/nQ==",
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.72.0.tgz",
|
||||
"integrity": "sha512-r26Fkc8As+mZvqp7SLsMmNFyYUup/6CjK7/eHBHmhOw6GH6n6YFxHVFrG0jN1c5CMpDzelLPxvgeCOzx7BjN+A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "8.71.1",
|
||||
"@typescript-eslint/parser": "8.71.1",
|
||||
"@typescript-eslint/typescript-estree": "8.71.1",
|
||||
"@typescript-eslint/utils": "8.71.1"
|
||||
"@typescript-eslint/eslint-plugin": "8.72.0",
|
||||
"@typescript-eslint/parser": "8.72.0",
|
||||
"@typescript-eslint/typescript-estree": "8.72.0",
|
||||
"@typescript-eslint/utils": "8.72.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -10024,12 +10041,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "6.28.0",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz",
|
||||
"integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==",
|
||||
"version": "7.30.1",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz",
|
||||
"integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.17"
|
||||
"node": ">=20.18.1"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
@@ -10167,9 +10184,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "14.0.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.2.tgz",
|
||||
"integrity": "sha512-xZe/16rV4aa+HGSOCiY2YeLT1OybRLrrkL/Rqaq7p7GMVXjFh+6wN4oMYgjFmnSnhY8t6Xpdl2l9qmnHYuMHwQ==",
|
||||
"version": "14.0.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.3.tgz",
|
||||
"integrity": "sha512-Sc5u1VVln93y1Xnz4R+CunOZc7R9LUcTmhj7Rc7Eg3HVcf7rVn2FOoa812fe0W8p3jD7xeoGSYbfqCGGH2B6xw==",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
@@ -10484,9 +10501,11 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "^2.0.3",
|
||||
"@actions/github": "^8.0.1",
|
||||
"@actions/tool-cache": "^3.0.1",
|
||||
"@octokit/core": "^7.0.8",
|
||||
"@octokit/plugin-paginate-rest": ">=16.0.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^18.0.0",
|
||||
"glob": "^13.0.6",
|
||||
"lite-matter": "^0.1.2",
|
||||
"mdast-util-from-markdown": "^2.1.0",
|
||||
"semver": "^7.8.5",
|
||||
|
||||
+7
-7
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codeql",
|
||||
"version": "4.39.1",
|
||||
"version": "4.39.2",
|
||||
"private": true,
|
||||
"description": "CodeQL action",
|
||||
"scripts": {
|
||||
@@ -38,13 +38,13 @@
|
||||
"follow-redirects": "^1.16.1",
|
||||
"get-folder-size": "^5.0.0",
|
||||
"https-proxy-agent": "^7.0.6",
|
||||
"js-yaml": "^5.4.3",
|
||||
"js-yaml": "^5.5.0",
|
||||
"jsonschema": "1.5.0",
|
||||
"long": "^5.3.2",
|
||||
"node-forge": "^1.4.0",
|
||||
"semver": "^7.8.5",
|
||||
"undici": "^6.28.0",
|
||||
"uuid": "^14.0.2"
|
||||
"undici": "^7.30.1",
|
||||
"uuid": "^14.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ava/typescript": "6.0.0",
|
||||
@@ -65,14 +65,14 @@
|
||||
"eslint-import-resolver-typescript": "^4.4.5",
|
||||
"eslint-plugin-github": "^6.1.2",
|
||||
"eslint-plugin-import-x": "^4.17.1",
|
||||
"eslint-plugin-jsdoc": "^65.2.0",
|
||||
"eslint-plugin-jsdoc": "^65.3.15",
|
||||
"eslint-plugin-no-async-foreach": "^0.1.1",
|
||||
"glob": "^13.0.6",
|
||||
"globals": "^17.13.0",
|
||||
"nock": "^14.0.17",
|
||||
"sinon": "^22.1.0",
|
||||
"typescript": "^6.0.3",
|
||||
"typescript-eslint": "^8.71.1"
|
||||
"typescript-eslint": "^8.72.0"
|
||||
},
|
||||
"overrides": {
|
||||
"@actions/tool-cache": {
|
||||
@@ -94,6 +94,6 @@
|
||||
"semver": ">=6.3.1"
|
||||
},
|
||||
"glob": "^13.0.6",
|
||||
"undici": "^6.28.0"
|
||||
"undici": "^7.30.1"
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,91 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
import * as core from "@actions/core";
|
||||
import { globSync } from "glob";
|
||||
|
||||
import * as sarif from "../src/sarif";
|
||||
|
||||
function checkStatusPageNotification(n) {
|
||||
const expectedMessage = "Plaintext message";
|
||||
if (n.message.text !== expectedMessage) {
|
||||
const DIAGNOSTIC_ID =
|
||||
process.env["DIAGNOSTIC_ID"] ?? "lang/diagnostics/example";
|
||||
const DIAGNOSTIC_NAME = process.env["DIAGNOSTIC_NAME"] ?? "Diagnostic name";
|
||||
const EXPECTED_MESSAGE = process.env["EXPECTED_MESSAGE"] ?? "Plaintext message";
|
||||
const EXPECTED_LOCATIONS = Number.parseInt(
|
||||
process.env["EXPECTED_LOCATIONS"] ?? "1",
|
||||
);
|
||||
|
||||
function checkStatusPageNotification(n: sarif.Notification) {
|
||||
const expectedMessage = EXPECTED_MESSAGE.trim();
|
||||
if (!n.message.text?.includes(expectedMessage)) {
|
||||
if (n.message.text !== undefined) {
|
||||
core.setFailed(
|
||||
`Expected the status page diagnostic to contain the message '${expectedMessage}', but found '${n.message.text.replaceAll("\n", "\\n")}'.`,
|
||||
);
|
||||
} else {
|
||||
core.setFailed(
|
||||
`Expected the status page diagnostic to contain the message '${expectedMessage}', but found nothing.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const locationCount = n.locations?.length ?? 0;
|
||||
if (locationCount !== EXPECTED_LOCATIONS) {
|
||||
core.setFailed(
|
||||
`Expected the status page diagnostic to have the message '${expectedMessage}', but found '${n.message.text}'.`,
|
||||
`Expected the status page diagnostic to have exactly ${EXPECTED_LOCATIONS} location(s), but found ${locationCount}.`,
|
||||
);
|
||||
}
|
||||
if (n.locations.length !== 1) {
|
||||
}
|
||||
|
||||
function checkSarif(sarifFile: string) {
|
||||
core.info(`Checking SARIF file at '${sarifFile}'`);
|
||||
|
||||
const log = JSON.parse(fs.readFileSync(sarifFile, "utf8")) as sarif.Log;
|
||||
const run = log.runs[0];
|
||||
|
||||
if (run.invocations === undefined) {
|
||||
throw new Error("run.invocations is undefined");
|
||||
}
|
||||
|
||||
const toolExecutionNotifications =
|
||||
run.invocations[0].toolExecutionNotifications;
|
||||
|
||||
if (toolExecutionNotifications === undefined) {
|
||||
throw new Error("toolExecutionNotifications is undefined");
|
||||
}
|
||||
|
||||
const statusPageNotifications = toolExecutionNotifications.filter(
|
||||
(n) =>
|
||||
n.descriptor?.id === DIAGNOSTIC_ID &&
|
||||
n.properties?.visibility?.statusPage,
|
||||
);
|
||||
if (statusPageNotifications.length !== 1) {
|
||||
core.setFailed(
|
||||
`Expected the status page diagnostic to have exactly 1 location, but found ${n.locations.length}.`,
|
||||
"Expected exactly one status page reporting descriptor for this diagnostic in the " +
|
||||
`'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
|
||||
`${statusPageNotifications.length}. All notification reporting descriptors: ` +
|
||||
`${JSON.stringify(toolExecutionNotifications)}.`,
|
||||
);
|
||||
}
|
||||
checkStatusPageNotification(statusPageNotifications[0]);
|
||||
|
||||
const notifications = run.tool.driver.notifications;
|
||||
|
||||
if (notifications === undefined) {
|
||||
throw new Error("notifications is undefined");
|
||||
}
|
||||
|
||||
const diagnosticNotification = notifications.filter(
|
||||
(n) =>
|
||||
n.id === DIAGNOSTIC_ID &&
|
||||
n.name === DIAGNOSTIC_ID &&
|
||||
n.fullDescription?.text === DIAGNOSTIC_NAME,
|
||||
);
|
||||
if (diagnosticNotification.length !== 1) {
|
||||
core.setFailed(
|
||||
"Expected exactly one notification for this diagnostic in the " +
|
||||
`'runs[].tool.driver.notifications[]' SARIF property, but found ` +
|
||||
`${diagnosticNotification.length}. All notifications: ` +
|
||||
`${JSON.stringify(notifications)}.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -21,57 +93,26 @@ function checkStatusPageNotification(n) {
|
||||
const sarifPath = process.env["SARIF_PATH"];
|
||||
|
||||
if (sarifPath === undefined) {
|
||||
throw new Error("The path to a SARIF file must be set in 'SARIF_PATH'.");
|
||||
}
|
||||
|
||||
const log = JSON.parse(fs.readFileSync(sarifPath, "utf8")) as sarif.Log;
|
||||
const run = log.runs[0];
|
||||
|
||||
if (run.invocations === undefined) {
|
||||
throw new Error("run.invocations is undefined");
|
||||
}
|
||||
|
||||
const toolExecutionNotifications =
|
||||
run.invocations[0].toolExecutionNotifications;
|
||||
|
||||
if (toolExecutionNotifications === undefined) {
|
||||
throw new Error("toolExecutionNotifications is undefined");
|
||||
}
|
||||
|
||||
const statusPageNotifications = toolExecutionNotifications.filter(
|
||||
(n) =>
|
||||
n.descriptor?.id === "lang/diagnostics/example" &&
|
||||
n.properties?.visibility?.statusPage,
|
||||
);
|
||||
if (statusPageNotifications.length !== 1) {
|
||||
core.setFailed(
|
||||
"Expected exactly one status page reporting descriptor for this diagnostic in the " +
|
||||
`'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
|
||||
`${statusPageNotifications.length}. All notification reporting descriptors: ` +
|
||||
`${JSON.stringify(toolExecutionNotifications)}.`,
|
||||
throw new Error(
|
||||
"The path to a SARIF file or directory must be set in 'SARIF_PATH'.",
|
||||
);
|
||||
}
|
||||
checkStatusPageNotification(statusPageNotifications[0]);
|
||||
|
||||
const notifications = run.tool.driver.notifications;
|
||||
if (fs.statSync(sarifPath).isDirectory()) {
|
||||
const sarifFiles = globSync("**/*.sarif", {
|
||||
cwd: path.resolve(sarifPath),
|
||||
absolute: true,
|
||||
});
|
||||
|
||||
if (notifications === undefined) {
|
||||
throw new Error("notifications is undefined");
|
||||
}
|
||||
if (sarifFiles.length < 1) {
|
||||
throw new Error(`Unable to find any .sarif files in '${sarifPath}'.`);
|
||||
}
|
||||
|
||||
const diagnosticNotification = notifications.filter(
|
||||
(n) =>
|
||||
n.id === "lang/diagnostics/example" &&
|
||||
n.name === "lang/diagnostics/example" &&
|
||||
n.fullDescription?.text === "Diagnostic name",
|
||||
);
|
||||
if (diagnosticNotification.length !== 1) {
|
||||
core.setFailed(
|
||||
"Expected exactly one notification for this diagnostic in the " +
|
||||
`'runs[].tool.driver.notifications[]' SARIF property, but found ` +
|
||||
`${diagnosticNotification.length}. All notifications: ` +
|
||||
`${JSON.stringify(notifications)}.`,
|
||||
);
|
||||
for (const sarifFile of sarifFiles) {
|
||||
checkSarif(sarifFile);
|
||||
}
|
||||
} else {
|
||||
checkSarif(sarifPath);
|
||||
}
|
||||
|
||||
core.info("Finished diagnostic export test");
|
||||
@@ -2,30 +2,20 @@ name: "Bundle: From toolcache"
|
||||
description: "The CodeQL bundle should be cached within the toolcache"
|
||||
versions:
|
||||
- toolcache
|
||||
installNode: true
|
||||
steps:
|
||||
- name: Install @actions/tool-cache
|
||||
run: npm install @actions/tool-cache@3
|
||||
- name: Check toolcache contains CodeQL
|
||||
continue-on-error: true
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
const toolcache = require('@actions/tool-cache');
|
||||
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
|
||||
if (allCodeqlVersions.length === 0) {
|
||||
throw new Error(`CodeQL could not be found in the toolcache`);
|
||||
}
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts installed
|
||||
|
||||
- id: setup-codeql
|
||||
uses: ./../action/setup-codeql
|
||||
with:
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
|
||||
- name: Check CodeQL is installed within the toolcache
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
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');
|
||||
}
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts installed
|
||||
@@ -6,47 +6,31 @@ operatingSystems:
|
||||
- ubuntu
|
||||
- macos
|
||||
- windows
|
||||
installNode: true
|
||||
steps:
|
||||
- name: Remove CodeQL from toolcache
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
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@3
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts clear
|
||||
|
||||
- name: Check toolcache does not contain CodeQL
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
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');
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts absent
|
||||
|
||||
- id: init
|
||||
uses: ./../action/init
|
||||
with:
|
||||
# Request multiple languages so this check uses the combined bundle.
|
||||
languages: javascript,python
|
||||
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@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
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');
|
||||
}
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts installed -n 1
|
||||
@@ -0,0 +1,72 @@
|
||||
name: "Diagnostic export without database"
|
||||
description: "Tests that temporary diagnostics are correctly included in the failed SARIF."
|
||||
versions:
|
||||
# Overridden by the FF in the `init` step below.
|
||||
- linked
|
||||
installNode: true
|
||||
|
||||
env:
|
||||
# Allow the failed SARIF file to be generated.
|
||||
CODEQL_ACTION_SKIP_GENERATE_FAILED_SARIF: false
|
||||
# But don't actually upload it.
|
||||
CODEQL_ACTION_SKIP_SARIF_UPLOAD: true
|
||||
# Mark telemetry for this workflow so it can be treated separately.
|
||||
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
|
||||
|
||||
steps:
|
||||
# We deliberately need to make this step fail before the database is initialised, but after
|
||||
# some diagnostic has been produced. The simplest way to do that right now is to:
|
||||
#
|
||||
# - Produce a diagnostic before the db is initialised by forcing the use of a nightly release
|
||||
# with the `CODEQL_ACTION_FORCE_NIGHTLY` feature flag.
|
||||
# - Cause `init` to abort because we are attempting to analyse Swift on a non-macOS runner.
|
||||
#
|
||||
- name: Initialise failing analysis
|
||||
id: init
|
||||
uses: ./../action/init
|
||||
continue-on-error: true
|
||||
env:
|
||||
CODEQL_ACTION_FORCE_NIGHTLY: true
|
||||
with:
|
||||
languages: swift
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
|
||||
- name: Analyze
|
||||
uses: ./analyze
|
||||
# In a real workflow, this step wouldn't run. Since we used `continue-on-error`
|
||||
# above, we manually disable it with an `if` condition. Having this step is required
|
||||
# for the init post-action because it checks the workflow definition for e.g. the
|
||||
# `category` input. Without this step, that part of the init post-action would fail.
|
||||
if: false
|
||||
with:
|
||||
category: "/test-codeql-version:${{ matrix.version }}"
|
||||
|
||||
- name: Check diagnostics appear on disk
|
||||
env:
|
||||
DIAGNOSTICS_DIR: "${{ runner.temp }}/codeql-action-temp-diagnostics/"
|
||||
run: |
|
||||
cd ../action
|
||||
npx tsx ./pr-checks/diagnostics-without-db.ts
|
||||
validationJobs:
|
||||
diagnostics-without-db-validation:
|
||||
checkout: true
|
||||
installNode: true
|
||||
steps:
|
||||
- name: Download workflow artifact
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
pattern: test-mode-sarif-*
|
||||
path: sarif
|
||||
|
||||
- name: List artifact contents
|
||||
run: ls -laR ./sarif
|
||||
|
||||
- name: Check diagnostics appear in SARIF
|
||||
env:
|
||||
SARIF_PATH: "./sarif/codeql-failed-run.sarif"
|
||||
DIAGNOSTIC_ID: "codeql-action/forced-nightly-cli"
|
||||
DIAGNOSTIC_NAME: "A nightly release of CodeQL was used"
|
||||
EXPECTED_LOCATIONS: "0"
|
||||
EXPECTED_MESSAGE: |
|
||||
GitHub configured this analysis to use a nightly release of CodeQL to allow you to preview changes from an upcoming release.
|
||||
run: npx tsx ./pr-checks/check-diagnostics.ts
|
||||
@@ -11,16 +11,17 @@ installDotNet: true
|
||||
env:
|
||||
CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS: false
|
||||
CODEQL_ACTION_SUBLANGUAGE_FILE_COVERAGE: true
|
||||
# To balance speed and coverage, we analyze only a single language (JavaScript), but use the
|
||||
# combined bundle so we can test that baseline information is reported for each language in the
|
||||
# multi-language source directory.
|
||||
CODEQL_ACTION_PER_LANGUAGE_BUNDLES: false
|
||||
steps:
|
||||
- uses: ./../action/init
|
||||
id: init
|
||||
with:
|
||||
languages: javascript
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
# To balance speed and coverage, analyze only JavaScript but use the combined bundle so
|
||||
# baseline information is reported for every language in the multi-language repository. A
|
||||
# custom configuration prevents per-language bundles from being used.
|
||||
config: |
|
||||
paths-ignore: []
|
||||
- name: Build code
|
||||
run: ./build.sh
|
||||
- uses: ./../action/analyze
|
||||
|
||||
@@ -1,49 +1,51 @@
|
||||
name: Per-language bundles
|
||||
description: Validates extraction and analysis using each per-language CodeQL bundle.
|
||||
# TODO: Use a released bundle once releases include per-language bundles.
|
||||
matrix:
|
||||
include:
|
||||
- language: actions
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
# Actions also needs the JavaScript extractor.
|
||||
expected-extractors: actions javascript
|
||||
- language: cpp
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
build-mode: manual
|
||||
build-command: gcc -o main main.c
|
||||
- language: csharp
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
build-mode: none
|
||||
- language: go
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
build-mode: autobuild
|
||||
- language: java
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
build-mode: none
|
||||
- language: javascript
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
- language: python
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
- language: ruby
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
- language: rust
|
||||
os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
- language: swift
|
||||
os: macos-latest-xlarge
|
||||
version: nightly-latest
|
||||
version: linked
|
||||
build-mode: autobuild
|
||||
env:
|
||||
CODEQL_ACTION_PER_LANGUAGE_BUNDLES: true
|
||||
installNode: true
|
||||
steps:
|
||||
- name: Remove CodeQL from toolcache
|
||||
run: |
|
||||
cd ./../action
|
||||
npx tsx ./pr-checks/toolcache.ts clear
|
||||
- uses: ./../action/init
|
||||
id: init
|
||||
with:
|
||||
@@ -84,9 +86,8 @@ steps:
|
||||
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
|
||||
run: |
|
||||
# A bundle that is missing most of its extractors must never be left in the toolcache,
|
||||
# where a later job analyzing a different language could pick it up. The runner image
|
||||
# ships with its own CodeQL in the toolcache, so check where this bundle was extracted to
|
||||
# rather than whether the toolcache contains CodeQL at all.
|
||||
# where a later job analyzing a different language could pick it up. Per-language bundles
|
||||
# must instead be extracted under the runner's temporary directory.
|
||||
echo "CodeQL is at $CODEQL_PATH"
|
||||
if [[ "$CODEQL_PATH" == "$RUNNER_TOOL_CACHE"/* ]]; then
|
||||
echo "::error::The per-language bundle was added to the toolcache at $CODEQL_PATH."
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
name: "RuboCop multi-language"
|
||||
description: "Tests using RuboCop to analyze a multi-language repository and then using the CodeQL Action to upload the resulting SARIF"
|
||||
# This check doesn't use CodeQL, so the `version` matrix variable is unused.
|
||||
versions:
|
||||
- default
|
||||
steps:
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
- name: Install Code Scanning integration
|
||||
run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install
|
||||
- name: Install dependencies
|
||||
run: bundle install
|
||||
- name: RuboCop run
|
||||
run: |
|
||||
bash -c "
|
||||
bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
|
||||
[[ $? -ne 2 ]]
|
||||
"
|
||||
- uses: ./../action/upload-sarif
|
||||
with:
|
||||
sarif_file: rubocop.sarif
|
||||
@@ -35,7 +35,9 @@ steps:
|
||||
run: exit 1
|
||||
- uses: ./analyze
|
||||
# In a real workflow, this step wouldn't run. Since we used `continue-on-error`
|
||||
# above, we manually disable it with an `if` condition.
|
||||
# above, we manually disable it with an `if` condition. Having this step is required
|
||||
# for the init post-action because it checks the workflow definition for e.g. the
|
||||
# `category` input. Without this step, that part of the init post-action would fail.
|
||||
if: false
|
||||
with:
|
||||
category: "/test-codeql-version:${{ matrix.version }}"
|
||||
@@ -0,0 +1,48 @@
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
|
||||
import * as core from "@actions/core";
|
||||
|
||||
import type * as diagnostics from "../src/diagnostics";
|
||||
|
||||
const DIAGNOSTIC_ID = "codeql-action/forced-nightly-cli";
|
||||
const diagnosticDirectory = process.env["DIAGNOSTICS_DIR"];
|
||||
|
||||
if (diagnosticDirectory === undefined) {
|
||||
throw new Error("DIAGNOSTICS_DIR is undefined.");
|
||||
}
|
||||
|
||||
const paths = fs
|
||||
.readdirSync(diagnosticDirectory, {
|
||||
recursive: true,
|
||||
encoding: "utf-8",
|
||||
})
|
||||
.filter((p) => p.endsWith(".json"));
|
||||
|
||||
core.info(`Found ${paths.length} paths in '${diagnosticDirectory}'.`);
|
||||
core.info(`Searching for a diagnostic with id '${DIAGNOSTIC_ID}'...`);
|
||||
|
||||
let found = false;
|
||||
for (const diagnosticPath of paths) {
|
||||
if (path.extname(diagnosticPath) !== ".json") {
|
||||
core.info(`Skipping ${diagnosticPath}.`);
|
||||
continue;
|
||||
}
|
||||
core.info(`Found ${diagnosticPath}.`);
|
||||
|
||||
const contents = JSON.parse(
|
||||
fs.readFileSync(path.resolve(diagnosticDirectory, diagnosticPath), "utf-8"),
|
||||
) as diagnostics.DiagnosticMessage;
|
||||
|
||||
if (contents.source.id === DIAGNOSTIC_ID) {
|
||||
core.info(
|
||||
`Found '${DIAGNOSTIC_ID}' in '${diagnosticPath}'. Skipping remaining files.`,
|
||||
);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
throw new Error(`Didn't find '${DIAGNOSTIC_ID}' diagnostic.`);
|
||||
}
|
||||
@@ -20,3 +20,7 @@ is:
|
||||
- "Release info"
|
||||
- "Upload results"
|
||||
- "Update release branch"
|
||||
# These checks are known not to run on every PR (for example, some release
|
||||
# PRs), so requiring them would block the PRs they don't run on.
|
||||
- "github-advanced-security"
|
||||
- "License compliance check"
|
||||
@@ -5,9 +5,11 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "^2.0.3",
|
||||
"@actions/github": "^8.0.1",
|
||||
"@actions/tool-cache": "^3.0.1",
|
||||
"@octokit/core": "^7.0.8",
|
||||
"@octokit/plugin-paginate-rest": ">=16.0.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^18.0.0",
|
||||
"glob": "^13.0.6",
|
||||
"lite-matter": "^0.1.2",
|
||||
"mdast-util-from-markdown": "^2.1.0",
|
||||
"semver": "^7.8.5",
|
||||
|
||||
+71
-30
@@ -43,6 +43,13 @@ type WorkflowInputs = Partial<Record<KnownInputName, WorkflowInput>>;
|
||||
/** An operating system identifier. */
|
||||
type OperatingSystemIdentifier = "ubuntu" | "macos" | "windows";
|
||||
|
||||
/** Mapping from {@link OperatingSystemIdentifier} to default runner image labels. */
|
||||
const DEFAULT_RUNNER_IMAGES: Record<OperatingSystemIdentifier, string> = {
|
||||
ubuntu: "ubuntu-26.04",
|
||||
macos: "macos-26",
|
||||
windows: "windows-2025",
|
||||
};
|
||||
|
||||
/**
|
||||
* Represents an operating system matrix entry for a generated PR check workflow.
|
||||
*
|
||||
@@ -90,7 +97,7 @@ interface Specification extends JobSpecification {
|
||||
services?: any;
|
||||
|
||||
/** Additional jobs to run after the main PR check job. */
|
||||
validationJobs?: Record<string, JobSpecification>;
|
||||
validationJobs?: Record<string, ValidationJobSpecification>;
|
||||
|
||||
/** If set, this check is part of a named collection that gets its own caller workflow. */
|
||||
collection?: string;
|
||||
@@ -122,6 +129,10 @@ interface JobSpecification {
|
||||
installYq?: boolean;
|
||||
}
|
||||
|
||||
type ValidationJobSpecification = JobSpecification & {
|
||||
checkout?: boolean;
|
||||
};
|
||||
|
||||
/** Describes language/framework-specific steps and inputs. */
|
||||
interface LanguageSetup {
|
||||
specProperty: keyof JobSpecification;
|
||||
@@ -133,7 +144,15 @@ interface LanguageSetup {
|
||||
/** Describes partial mappings from built-in languages to their specific setup information. */
|
||||
type LanguageSetups = Partial<Record<BuiltInLanguage, LanguageSetup>>;
|
||||
|
||||
// The default set of CodeQL Bundle versions to use for the PR checks.
|
||||
/** A type representing version identifiers. */
|
||||
type Version =
|
||||
| "default"
|
||||
| "linked"
|
||||
| "nightly-latest"
|
||||
// This is an approximation, but sufficient validation for our needs here.
|
||||
| `stable-v${number}.${number}.${number}`;
|
||||
|
||||
/** The default set of CodeQL Bundle versions to use for the PR checks. */
|
||||
const defaultTestVersions = [
|
||||
// The oldest supported CodeQL version. If bumping, update `CODEQL_MINIMUM_VERSION` in `codeql.ts`
|
||||
"stable-v2.20.7",
|
||||
@@ -155,7 +174,10 @@ const defaultTestVersions = [
|
||||
"linked",
|
||||
// A nightly build directly from the our private repo, built in the last 24 hours.
|
||||
"nightly-latest",
|
||||
];
|
||||
] as const satisfies Version[];
|
||||
|
||||
/** A type representing the default test versions. */
|
||||
type DefaultTestVersion = (typeof defaultTestVersions)[number];
|
||||
|
||||
/** The default versions we use for languages / frameworks, if not specified as a workflow input. */
|
||||
const defaultLanguageVersions = {
|
||||
@@ -263,8 +285,8 @@ const languageSetups: LanguageSetups = {
|
||||
name: "Install Java",
|
||||
uses: pinnedUses(
|
||||
"actions/setup-java",
|
||||
"de7274f081f381c8f8158605e0321c36c376e2e6",
|
||||
"v6.0.1",
|
||||
"b843ebf9b913146b38da2eaa7aeddf76074ae1ad",
|
||||
"v6.1.0",
|
||||
),
|
||||
with: {
|
||||
"java-version": `\${{ inputs.java-version || '${defaultLanguageVersions.java}' }}`,
|
||||
@@ -309,9 +331,11 @@ const languageSetups: LanguageSetups = {
|
||||
},
|
||||
};
|
||||
|
||||
// This is essentially an arbitrary version of `yq`, which happened to be the one that
|
||||
// `choco` fetched when we moved away from using that here.
|
||||
// See https://github.com/github/codeql-action/pull/3423
|
||||
/**
|
||||
* This is essentially an arbitrary version of `yq`, which happened to be the one that
|
||||
* `choco` fetched when we moved away from using that here.
|
||||
* See https://github.com/github/codeql-action/pull/3423
|
||||
*/
|
||||
const YQ_VERSION = "v4.50.1";
|
||||
|
||||
const CHECKS_DIR = path.join(PR_CHECKS_DIR, "checks");
|
||||
@@ -397,12 +421,6 @@ function generateJobMatrix(
|
||||
);
|
||||
}
|
||||
|
||||
const defaultRunnerImages = [
|
||||
"ubuntu-latest",
|
||||
"macos-latest",
|
||||
"windows-latest",
|
||||
];
|
||||
|
||||
for (const operatingSystemConfig of operatingSystems) {
|
||||
const operatingSystem =
|
||||
typeof operatingSystemConfig === "string"
|
||||
@@ -432,16 +450,29 @@ function generateJobMatrix(
|
||||
const runnerImagesForOs =
|
||||
typeof operatingSystemConfig === "string" ||
|
||||
operatingSystemConfig["runner-image"] === undefined
|
||||
? defaultRunnerImages.filter((image) =>
|
||||
? Object.values(DEFAULT_RUNNER_IMAGES).filter((image) =>
|
||||
image.startsWith(operatingSystem),
|
||||
)
|
||||
: [operatingSystemConfig["runner-image"]];
|
||||
|
||||
for (const runnerImage of runnerImagesForOs) {
|
||||
matrix.push({
|
||||
os: runnerImage,
|
||||
version,
|
||||
});
|
||||
// stable-v2.20.7 requires an older version of Java than the default on `ubuntu-latest`.
|
||||
// We could install that older version on the newer runners, or use the older runner.
|
||||
// We do the latter here. This can be removed once we stop supporting `v2.20.7`.
|
||||
// Since this is typed as `DefaultTestVersion`, it will become an error once `stable-v2.20.7`
|
||||
// is removed from `defaultTestVersions`.
|
||||
const requiresOlderRunnerImage: DefaultTestVersion = "stable-v2.20.7";
|
||||
if (
|
||||
runnerImage === DEFAULT_RUNNER_IMAGES["ubuntu"] &&
|
||||
version === requiresOlderRunnerImage
|
||||
) {
|
||||
matrix.push({ os: "ubuntu-24.04", version });
|
||||
} else {
|
||||
matrix.push({
|
||||
os: runnerImage,
|
||||
version,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -462,6 +493,20 @@ function generateJobMatrix(
|
||||
return matrix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `actions/checkout` step.
|
||||
*/
|
||||
function getCheckoutStep(): Step {
|
||||
return {
|
||||
name: "Check out repository",
|
||||
uses: pinnedUses(
|
||||
"actions/checkout",
|
||||
"3d3c42e5aac5ba805825da76410c181273ba90b1",
|
||||
"v7.0.1",
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves setup steps and additional input definitions based on specific languages or frameworks
|
||||
* that are requested by the `checkSpecification`.
|
||||
@@ -531,14 +576,7 @@ function generateJob(
|
||||
|
||||
// Construct the workflow steps needed for this check.
|
||||
const steps: Step[] = [
|
||||
{
|
||||
name: "Check out repository",
|
||||
uses: pinnedUses(
|
||||
"actions/checkout",
|
||||
"3d3c42e5aac5ba805825da76410c181273ba90b1",
|
||||
"v7.0.1",
|
||||
),
|
||||
},
|
||||
getCheckoutStep(),
|
||||
...setupInfo.steps,
|
||||
{
|
||||
name: "Prepare test",
|
||||
@@ -609,13 +647,16 @@ function generateJob(
|
||||
/** Generates a validation job. */
|
||||
function generateValidationJob(
|
||||
specDocument: yaml.Document,
|
||||
jobSpecification: JobSpecification,
|
||||
jobSpecification: ValidationJobSpecification,
|
||||
checkName: string,
|
||||
name: string,
|
||||
) {
|
||||
// Determine which languages or frameworks have to be installed.
|
||||
const { inputs, steps } = getSetupSteps(jobSpecification);
|
||||
|
||||
// Construct a checkout step if requested.
|
||||
const checkoutStep = jobSpecification.checkout ? [getCheckoutStep()] : [];
|
||||
|
||||
// Extract the sequence of steps from the YAML document to persist as much formatting as possible.
|
||||
const specSteps = specDocument.getIn([
|
||||
"validationJobs",
|
||||
@@ -624,7 +665,7 @@ function generateValidationJob(
|
||||
]) as yaml.YAMLSeq;
|
||||
|
||||
// Add the generated steps in front of the ones from the specification.
|
||||
specSteps.items.unshift(...steps);
|
||||
specSteps.items.unshift(...checkoutStep, ...steps);
|
||||
|
||||
const validationJob: Record<string, any> = {
|
||||
name: jobSpecification.name,
|
||||
@@ -635,7 +676,7 @@ function generateValidationJob(
|
||||
"security-events": "read",
|
||||
},
|
||||
"timeout-minutes": 5,
|
||||
"runs-on": "ubuntu-slim",
|
||||
"runs-on": DEFAULT_RUNNER_IMAGES["ubuntu"],
|
||||
steps: specSteps,
|
||||
};
|
||||
|
||||
|
||||
Executable
+94
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env npx tsx
|
||||
|
||||
/**
|
||||
* Provides utility commands for working with the Actions toolcache in PR checks.
|
||||
*/
|
||||
|
||||
import fs from "fs";
|
||||
import { parseArgs } from "node:util";
|
||||
import path from "path";
|
||||
|
||||
import * as core from "@actions/core";
|
||||
import * as toolcache from "@actions/tool-cache";
|
||||
|
||||
function removeCodeQLFromToolcache() {
|
||||
const toolcachePath = process.env["RUNNER_TOOL_CACHE"];
|
||||
|
||||
if (toolcachePath === undefined) {
|
||||
throw new Error("Expected RUNNER_TOOL_CACHE to be defined");
|
||||
}
|
||||
|
||||
const codeqlPath = path.join(toolcachePath, "CodeQL");
|
||||
fs.rmSync(codeqlPath, { recursive: true });
|
||||
|
||||
core.info(`Removed '${codeqlPath}' from the toolcache.`);
|
||||
}
|
||||
|
||||
function findCodeQL() {
|
||||
return toolcache.findAllVersions("CodeQL");
|
||||
}
|
||||
|
||||
function checkNoCodeQLInToolcache() {
|
||||
const allCodeqlVersions = findCodeQL();
|
||||
if (allCodeqlVersions.length !== 0) {
|
||||
throw new Error(
|
||||
`CodeQL should not be found in the toolcache, but found ${allCodeqlVersions}`,
|
||||
);
|
||||
}
|
||||
core.info("No versions of CodeQL found in the toolcache");
|
||||
}
|
||||
|
||||
function hasCodeQLInToolcache(expectedNumber?: string) {
|
||||
const expected =
|
||||
expectedNumber !== undefined
|
||||
? Number.parseInt(expectedNumber, 10)
|
||||
: undefined;
|
||||
|
||||
const allCodeqlVersions = findCodeQL();
|
||||
if (allCodeqlVersions.length === 0) {
|
||||
throw new Error("CodeQL not found in toolcache");
|
||||
}
|
||||
|
||||
core.info(`Found CodeQL versions: ${allCodeqlVersions.join(", ")}`);
|
||||
if (expected !== undefined && allCodeqlVersions.length !== expected) {
|
||||
throw new Error(
|
||||
`Expected ${expected} versions of CodeQL in the toolcache, but found ${allCodeqlVersions.length}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
const { positionals, values } = parseArgs({
|
||||
options: {
|
||||
// The number of expected versions in the toolcache.
|
||||
"expected-version-count": { type: "string", short: "n" },
|
||||
},
|
||||
allowPositionals: true,
|
||||
});
|
||||
|
||||
if (positionals.length < 1) {
|
||||
throw new Error("Command not specified.");
|
||||
}
|
||||
|
||||
const cmd = positionals[0];
|
||||
|
||||
switch (cmd.trim().toLowerCase()) {
|
||||
case "clear":
|
||||
removeCodeQLFromToolcache();
|
||||
return;
|
||||
case "absent":
|
||||
checkNoCodeQLInToolcache();
|
||||
return;
|
||||
case "installed":
|
||||
hasCodeQLInToolcache(values["expected-version-count"]);
|
||||
return;
|
||||
default:
|
||||
throw new Error(`Unknown command '${cmd}'.`);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
main();
|
||||
} catch (err) {
|
||||
core.setFailed(err instanceof Error ? err.message : String(err));
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
} from "./actions-util";
|
||||
import { computeAutomationID } from "./api-client";
|
||||
import { EnvVar } from "./environment";
|
||||
import { getRunnerLogger } from "./logging";
|
||||
import { RecordingLogger, setupTests } from "./testing-utils";
|
||||
import { initializeEnvironment, withTmpDir } from "./util";
|
||||
|
||||
@@ -238,7 +237,7 @@ test.serial("fixCodeQualityCategory", (t) => {
|
||||
GITHUB_EVENT_NAME: "dynamic",
|
||||
},
|
||||
() => {
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
|
||||
// Categories that should get adjusted.
|
||||
t.is(fixCodeQualityCategory(logger, "/language:c#"), "/language:csharp");
|
||||
|
||||
+4
-2
@@ -72,7 +72,7 @@ export const getOptionalInput = function (name: string): string | undefined {
|
||||
* directory that has been set in `CODEQL_ACTION_TEMP` by e.g. a previous step, or the
|
||||
* value of `RUNNER_TEMP` otherwise.
|
||||
*/
|
||||
export function getTemporaryDirectory(env: Env = getEnv()): string {
|
||||
export function getTemporaryDirectory(env: ReadOnlyEnv = getEnv()): string {
|
||||
return (
|
||||
env.getOptional(EnvVar.TEMP) ?? env.getRequired(ActionsEnvVars.RUNNER_TEMP)
|
||||
);
|
||||
@@ -361,9 +361,10 @@ const MAX_STDERR_BUFFER_SIZE = 20000;
|
||||
* Runs a CLI tool.
|
||||
*
|
||||
* @returns Standard output produced by the tool.
|
||||
* @throws A `CommandInvocationError` if the tool exits with a non-zero status code.
|
||||
* @throws A {@link CommandInvocationError} if the tool exits with a non-zero status code.
|
||||
*/
|
||||
export async function runTool(
|
||||
env: Env,
|
||||
cmd: string,
|
||||
args: string[] = [],
|
||||
opts: { stdin?: string; noStreamStdout?: boolean } = {},
|
||||
@@ -374,6 +375,7 @@ export async function runTool(
|
||||
process.stdout.write(`[command]${cmd} ${args.join(" ")}\n`);
|
||||
}
|
||||
const exitCode = await new toolrunner.ToolRunner(cmd, args, {
|
||||
env: env.getDefined(),
|
||||
ignoreReturnCode: true,
|
||||
listeners: {
|
||||
stdout: (data: Buffer) => {
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
supportedAnalysisKinds,
|
||||
} from "./analyses";
|
||||
import { EnvVar } from "./environment";
|
||||
import { getRunnerLogger } from "./logging";
|
||||
import {
|
||||
createFeatures,
|
||||
RecordingLogger,
|
||||
@@ -65,7 +64,7 @@ test.serial(
|
||||
.withArgs("analysis-kinds")
|
||||
.returns("code-scanning,code-quality");
|
||||
const result = await getAnalysisKinds(
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
features,
|
||||
true,
|
||||
);
|
||||
@@ -139,7 +138,7 @@ test.serial(
|
||||
const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
||||
optionalInputStub.withArgs("quality-queries").returns("code-quality");
|
||||
const result = await getAnalysisKinds(
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
features,
|
||||
true,
|
||||
);
|
||||
@@ -155,7 +154,7 @@ test.serial(
|
||||
const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
|
||||
requiredInputStub.withArgs("analysis-kinds").returns("no-such-thing");
|
||||
await t.throwsAsync(
|
||||
getAnalysisKinds(getRunnerLogger(true), features, true),
|
||||
getAnalysisKinds(new RecordingLogger(), features, true),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -181,7 +180,7 @@ for (let i = 0; i < analysisKinds.length; i++) {
|
||||
.withArgs("analysis-kinds")
|
||||
.returns([analysisKind, otherAnalysis].join(","));
|
||||
const result = await getAnalysisKinds(
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
features,
|
||||
true,
|
||||
);
|
||||
@@ -199,7 +198,7 @@ for (let i = 0; i < analysisKinds.length; i++) {
|
||||
.withArgs("analysis-kinds")
|
||||
.returns([analysisKind, otherAnalysis].join(","));
|
||||
await t.throwsAsync(
|
||||
getAnalysisKinds(getRunnerLogger(true), features, true),
|
||||
getAnalysisKinds(new RecordingLogger(), features, true),
|
||||
{
|
||||
instanceOf: ConfigurationError,
|
||||
message: `${analysisKind} and ${otherAnalysis} cannot be enabled at the same time`,
|
||||
|
||||
+3
-17
@@ -50,9 +50,8 @@ import {
|
||||
StatusReportBase,
|
||||
} from "./status-report";
|
||||
import {
|
||||
cleanupTrapCaches,
|
||||
TrapCacheCleanupStatusReport,
|
||||
uploadTrapCaches,
|
||||
warnIfTrapCacheCleanupEnvVarIsSet,
|
||||
} from "./trap-caching";
|
||||
import * as uploadLib from "./upload-lib";
|
||||
import { UploadResult } from "./upload-lib";
|
||||
@@ -86,7 +85,6 @@ async function sendStatusReport(
|
||||
trapCacheUploadTime: number | undefined,
|
||||
dbCreationTimings: DatabaseCreationTimings | undefined,
|
||||
didUploadTrapCaches: boolean,
|
||||
trapCacheCleanup: TrapCacheCleanupStatusReport | undefined,
|
||||
dependencyCacheResults: DependencyCacheUploadStatusReport | undefined,
|
||||
databaseUploadResults: DatabaseUploadResult[],
|
||||
logger: Logger,
|
||||
@@ -107,7 +105,6 @@ async function sendStatusReport(
|
||||
...statusReportBase,
|
||||
...(stats || {}),
|
||||
...(dbCreationTimings || {}),
|
||||
...(trapCacheCleanup || {}),
|
||||
dependency_caching_upload_results: dependencyCacheResults,
|
||||
database_upload_results: databaseUploadResults,
|
||||
};
|
||||
@@ -229,8 +226,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
|
||||
| undefined = undefined;
|
||||
let runStats: QueriesStatusReport | undefined = undefined;
|
||||
let config: Config | undefined = undefined;
|
||||
let trapCacheCleanupTelemetry: TrapCacheCleanupStatusReport | undefined =
|
||||
undefined;
|
||||
let trapCacheUploadTime: number | undefined = undefined;
|
||||
let dbCreationTimings: DatabaseCreationTimings | undefined = undefined;
|
||||
let didUploadTrapCaches = false;
|
||||
@@ -278,6 +273,8 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
|
||||
);
|
||||
}
|
||||
|
||||
warnIfTrapCacheCleanupEnvVarIsSet(action);
|
||||
|
||||
const apiDetails = getApiDetails();
|
||||
const outputDir = actionsUtil.getRequiredInput("output");
|
||||
action.env.export(EnvVar.SARIF_RESULTS_OUTPUT_DIR, outputDir);
|
||||
@@ -416,13 +413,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
|
||||
didUploadTrapCaches = await uploadTrapCaches(codeql, config, logger);
|
||||
trapCacheUploadTime = performance.now() - trapCacheUploadStartTime;
|
||||
|
||||
// Clean up TRAP caches
|
||||
trapCacheCleanupTelemetry = await cleanupTrapCaches(
|
||||
config,
|
||||
features,
|
||||
logger,
|
||||
);
|
||||
|
||||
// Store dependency cache(s) if dependency caching is enabled.
|
||||
if (shouldStoreCache(config.dependencyCachingEnabled)) {
|
||||
dependencyCacheResults = await uploadDependencyCaches(
|
||||
@@ -474,7 +464,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
|
||||
trapCacheUploadTime,
|
||||
dbCreationTimings,
|
||||
didUploadTrapCaches,
|
||||
trapCacheCleanupTelemetry,
|
||||
dependencyCacheResults,
|
||||
databaseUploadResults,
|
||||
logger,
|
||||
@@ -497,7 +486,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
|
||||
trapCacheUploadTime,
|
||||
dbCreationTimings,
|
||||
didUploadTrapCaches,
|
||||
trapCacheCleanupTelemetry,
|
||||
dependencyCacheResults,
|
||||
databaseUploadResults,
|
||||
logger,
|
||||
@@ -511,7 +499,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
|
||||
trapCacheUploadTime,
|
||||
dbCreationTimings,
|
||||
didUploadTrapCaches,
|
||||
trapCacheCleanupTelemetry,
|
||||
dependencyCacheResults,
|
||||
databaseUploadResults,
|
||||
logger,
|
||||
@@ -525,7 +512,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
|
||||
trapCacheUploadTime,
|
||||
dbCreationTimings,
|
||||
didUploadTrapCaches,
|
||||
trapCacheCleanupTelemetry,
|
||||
dependencyCacheResults,
|
||||
databaseUploadResults,
|
||||
logger,
|
||||
|
||||
+2
-2
@@ -17,12 +17,12 @@ import { defaultSuites } from "./config/db-config";
|
||||
import { Feature } from "./feature-flags";
|
||||
import * as gitUtils from "./git-utils";
|
||||
import { BuiltInLanguage } from "./languages";
|
||||
import { getRunnerLogger } from "./logging";
|
||||
import {
|
||||
setupTests,
|
||||
setupActionsVars,
|
||||
createFeatures,
|
||||
createTestConfig,
|
||||
RecordingLogger,
|
||||
callee,
|
||||
} from "./testing-utils";
|
||||
import * as uploadLib from "./upload-lib";
|
||||
@@ -195,7 +195,7 @@ test.serial("status report fields", async (t) => {
|
||||
undefined,
|
||||
codeql,
|
||||
config,
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
createFeatures([Feature.QaTelemetryEnabled]),
|
||||
);
|
||||
t.deepEqual(Object.keys(statusReport).sort(), [
|
||||
|
||||
@@ -401,21 +401,6 @@ export async function listActionsCaches(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an Actions cache item by its ID.
|
||||
*
|
||||
* See https://docs.github.com/en/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id.
|
||||
*/
|
||||
export async function deleteActionsCache(id: number) {
|
||||
const repositoryNwo = getRepositoryNwo();
|
||||
|
||||
await getApiClient().rest.actions.deleteActionsCacheById({
|
||||
owner: repositoryNwo.owner,
|
||||
repo: repositoryNwo.repo,
|
||||
cache_id: id,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all custom repository properties.
|
||||
*
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"maximumVersion":"3.23","minimumVersion":"3.18"}
|
||||
{"maximumVersion":"3.23","minimumVersion":"3.19"}
|
||||
@@ -10,12 +10,12 @@ import {
|
||||
scanArtifactsForTokens,
|
||||
TokenType,
|
||||
} from "./artifact-scanner";
|
||||
import { getRunnerLogger } from "./logging";
|
||||
import {
|
||||
checkExpectedLogMessages,
|
||||
getRecordingLogger,
|
||||
LoggedMessage,
|
||||
makeTestToken,
|
||||
RecordingLogger,
|
||||
} from "./testing-utils";
|
||||
|
||||
test("makeTestToken", (t) => {
|
||||
@@ -121,7 +121,7 @@ for (const { type, value, checkPattern } of testTokens) {
|
||||
}
|
||||
|
||||
test("scanArtifactsForTokens handles files without tokens", async (t) => {
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "scanner-test-"));
|
||||
|
||||
try {
|
||||
|
||||
@@ -3,15 +3,14 @@ import path from "path";
|
||||
|
||||
import test from "ava";
|
||||
|
||||
import { getRunnerLogger } from "../logging";
|
||||
import { setupTests } from "../testing-utils";
|
||||
import { RecordingLogger, setupTests } from "../testing-utils";
|
||||
import * as util from "../util";
|
||||
|
||||
import { getCachedCodeQlVersion } from "./output-cache";
|
||||
|
||||
setupTests(test);
|
||||
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
|
||||
test.serial(
|
||||
"getCachedCodeQlVersion reuses a version persisted by an earlier step",
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
import { getTemporaryDirectory } from "../actions-util";
|
||||
import { Env } from "../environment";
|
||||
import { ReadOnlyEnv } from "../environment";
|
||||
import * as json from "../json";
|
||||
import { Logger } from "../logging";
|
||||
|
||||
@@ -51,7 +51,7 @@ export function resetCachedCodeQlVersion(): void {
|
||||
* Returns the path to the temporary file that backs the
|
||||
* on-disk cache of CLI responses between workflow steps.
|
||||
*/
|
||||
export function getCommandCacheFilePath(env: Env): string {
|
||||
export function getCommandCacheFilePath(env: ReadOnlyEnv): string {
|
||||
return path.join(getTemporaryDirectory(env), COMMAND_CACHE_FILENAME);
|
||||
}
|
||||
|
||||
|
||||
+16
-15
@@ -22,7 +22,6 @@ import type { Config } from "./config-utils";
|
||||
import * as defaults from "./defaults.json";
|
||||
import { DocUrl } from "./doc-url";
|
||||
import { BuiltInLanguage } from "./languages";
|
||||
import { getRunnerLogger } from "./logging";
|
||||
import { ToolsSource } from "./setup-codeql";
|
||||
import {
|
||||
setupTests,
|
||||
@@ -34,6 +33,8 @@ import {
|
||||
makeVersionInfo,
|
||||
createTestConfig,
|
||||
makeMacro,
|
||||
getCodeQLForTesting,
|
||||
RecordingLogger,
|
||||
} from "./testing-utils";
|
||||
import { ToolsDownloadStatusReport } from "./tools-download";
|
||||
import * as util from "./util";
|
||||
@@ -102,7 +103,7 @@ async function installIntoToolcache({
|
||||
undefined, // otherLanguagePacksReason
|
||||
false, // useOverlayAwareDefaultCliVersion
|
||||
createFeatures([]),
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
false,
|
||||
);
|
||||
}
|
||||
@@ -140,7 +141,7 @@ function mockApiDetails(apiDetails: Required<GitHubApiDetails>) {
|
||||
}
|
||||
|
||||
async function stubCodeql(): Promise<codeql.CodeQL> {
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
const codeqlObject = await getCodeQLForTesting();
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.17.6"));
|
||||
sinon
|
||||
.stub(codeqlObject, "isTracedLanguage")
|
||||
@@ -176,7 +177,7 @@ test.serial(
|
||||
undefined, // otherLanguagePacksReason
|
||||
false, // useOverlayAwareDefaultCliVersion
|
||||
features,
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
false,
|
||||
);
|
||||
|
||||
@@ -212,7 +213,7 @@ test.serial(
|
||||
undefined, // otherLanguagePacksReason
|
||||
false, // useOverlayAwareDefaultCliVersion
|
||||
features,
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
false,
|
||||
);
|
||||
|
||||
@@ -252,7 +253,7 @@ test.serial(
|
||||
undefined, // otherLanguagePacksReason
|
||||
false, // useOverlayAwareDefaultCliVersion
|
||||
features,
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
false,
|
||||
);
|
||||
t.assert(toolcache.find("CodeQL", "0.0.0-20200610"));
|
||||
@@ -362,7 +363,7 @@ for (const {
|
||||
undefined, // otherLanguagePacksReason
|
||||
false, // useOverlayAwareDefaultCliVersion
|
||||
features,
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
false,
|
||||
);
|
||||
t.assert(toolcache.find("CodeQL", expectedToolcacheVersion));
|
||||
@@ -405,7 +406,7 @@ for (const toolcacheVersion of [
|
||||
undefined, // otherLanguagePacksReason
|
||||
false, // useOverlayAwareDefaultCliVersion
|
||||
features,
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
false,
|
||||
);
|
||||
t.is(
|
||||
@@ -450,7 +451,7 @@ test.serial(
|
||||
undefined, // otherLanguagePacksReason
|
||||
false, // useOverlayAwareDefaultCliVersion
|
||||
features,
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
false,
|
||||
);
|
||||
t.deepEqual(result.toolsVersion, "0.0.0-20200601");
|
||||
@@ -497,7 +498,7 @@ test.serial(
|
||||
undefined, // otherLanguagePacksReason
|
||||
false, // useOverlayAwareDefaultCliVersion
|
||||
features,
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
false,
|
||||
);
|
||||
t.deepEqual(result.toolsVersion, defaults.cliVersion);
|
||||
@@ -537,7 +538,7 @@ test.serial(
|
||||
undefined, // otherLanguagePacksReason
|
||||
false, // useOverlayAwareDefaultCliVersion
|
||||
features,
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
false,
|
||||
);
|
||||
t.deepEqual(result.toolsVersion, defaults.cliVersion);
|
||||
@@ -579,7 +580,7 @@ test.serial(
|
||||
undefined, // otherLanguagePacksReason
|
||||
false, // useOverlayAwareDefaultCliVersion
|
||||
features,
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
false,
|
||||
);
|
||||
|
||||
@@ -664,7 +665,7 @@ const injectedConfigMacro = makeMacro({
|
||||
tempDir,
|
||||
};
|
||||
thisStubConfig.computedConfig = generateCodeScanningConfig(
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
thisStubConfig.originalUserInput,
|
||||
augmentationProperties,
|
||||
);
|
||||
@@ -1039,7 +1040,7 @@ test.serial("runTool summarizes autobuilder errors", async (t) => {
|
||||
[2019-09-18 12:00:01] [autobuild] A non-error message
|
||||
`;
|
||||
stubToolRunnerConstructor(1, stderr);
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
const codeqlObject = await getCodeQLForTesting();
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.17.6"));
|
||||
sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
|
||||
// io throws because of the test CodeQL object.
|
||||
@@ -1095,7 +1096,7 @@ test.serial("runTool recognizes fatal internal errors", async (t) => {
|
||||
com.semmle.util.exception.CatastrophicError: An error occurred while evaluating ControlFlowGraph::ControlFlow::Root.isRootOf/1#dispred#f610e6ed/2@86282cc8
|
||||
Severe disk cache trouble (corruption or out of space) at /home/runner/work/_temp/codeql_databases/go/db-go/default/cache/pages/28/33.pack: Failed to write item to disk`;
|
||||
stubToolRunnerConstructor(1, stderr);
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
const codeqlObject = await getCodeQLForTesting();
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.17.6"));
|
||||
sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
|
||||
// io throws because of the test CodeQL object.
|
||||
|
||||
+96
-55
@@ -18,7 +18,7 @@ import { CliError, wrapCliConfigurationError } from "./cli-errors";
|
||||
import type { ActionConfig } from "./config/action-config";
|
||||
import { appendExtraQueryExclusions, type Config } from "./config-utils";
|
||||
import { DocUrl } from "./doc-url";
|
||||
import { EnvVar, getEnv, exportEnvVar } from "./environment";
|
||||
import { EnvVar, getEnv, Env, ReadOnlyEnv } from "./environment";
|
||||
import {
|
||||
CodeQLDefaultVersionInfo,
|
||||
Feature,
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
} from "./feature-flags";
|
||||
import { isAnalyzingDefaultBranch } from "./git-utils";
|
||||
import { Language } from "./languages";
|
||||
import { getRunnerLogger, Logger } from "./logging";
|
||||
import type { Logger } from "./logging";
|
||||
import { writeBaseDatabaseOidsFile, writeOverlayChangesFile } from "./overlay";
|
||||
import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
|
||||
import * as setupCodeql from "./setup-codeql";
|
||||
@@ -199,6 +199,7 @@ export interface CodeQL {
|
||||
sarifFile: string,
|
||||
automationDetailsId: string | undefined,
|
||||
config: ActionConfig<"tempDir">,
|
||||
diagnosticDir: string | undefined,
|
||||
): Promise<void>;
|
||||
/** Get the location of an extractor for the specified language. */
|
||||
resolveExtractor(language: Language): Promise<string>;
|
||||
@@ -259,17 +260,17 @@ const CODEQL_MINIMUM_VERSION = "2.20.7";
|
||||
/**
|
||||
* This version will shortly become the oldest version of CodeQL that the Action will run with.
|
||||
*/
|
||||
const CODEQL_NEXT_MINIMUM_VERSION = "2.21.3";
|
||||
const CODEQL_NEXT_MINIMUM_VERSION = "2.22.4";
|
||||
|
||||
/**
|
||||
* This is the version of GHES that was most recently deprecated.
|
||||
*/
|
||||
const GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.17";
|
||||
const GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.18";
|
||||
|
||||
/**
|
||||
* This is the deprecation date for the version of GHES that was most recently deprecated.
|
||||
*/
|
||||
const GHES_MOST_RECENT_DEPRECATION_DATE = "2026-09-24";
|
||||
const GHES_MOST_RECENT_DEPRECATION_DATE = "2026-10-16";
|
||||
|
||||
/** The CLI verbosity level to use for extraction in debug mode. */
|
||||
const EXTRACTION_DEBUG_MODE_VERBOSITY = "progress++";
|
||||
@@ -486,18 +487,6 @@ export function createStubCodeQL(partialCodeql: Partial<CodeQL>): CodeQL {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a real, newly created CodeQL instance for testing. The instance refers to
|
||||
* a non-existent placeholder codeql command, so tests that use this function
|
||||
* should also stub the toolrunner.ToolRunner constructor.
|
||||
*/
|
||||
export async function getCodeQLForTesting(
|
||||
cmd = "codeql-for-testing",
|
||||
logger: Logger = getRunnerLogger(true),
|
||||
): Promise<CodeQL> {
|
||||
return getCodeQLForCmd(logger, cmd, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a CodeQL object for CodeQL CLI access.
|
||||
*
|
||||
@@ -506,17 +495,18 @@ export async function getCodeQLForTesting(
|
||||
* version requirement. Must be set to true outside tests.
|
||||
* @returns A new CodeQL object
|
||||
*/
|
||||
async function getCodeQLForCmd(
|
||||
export async function getCodeQLForCmd(
|
||||
logger: Logger,
|
||||
cmd: string,
|
||||
checkVersion: boolean,
|
||||
env: Env = getEnv(),
|
||||
): Promise<CodeQL> {
|
||||
const codeql: CodeQL = {
|
||||
getPath() {
|
||||
return cmd;
|
||||
},
|
||||
async getVersion() {
|
||||
const cacheFilePath = outputCache.getCommandCacheFilePath(getEnv());
|
||||
const cacheFilePath = outputCache.getCommandCacheFilePath(env);
|
||||
let result = outputCache.getCachedCodeQlVersion(
|
||||
logger,
|
||||
cacheFilePath,
|
||||
@@ -524,6 +514,7 @@ async function getCodeQLForCmd(
|
||||
);
|
||||
if (result === undefined) {
|
||||
result = await runCliJson<VersionInfo>(
|
||||
env,
|
||||
cmd,
|
||||
["version", "--format=json"],
|
||||
{
|
||||
@@ -607,6 +598,7 @@ async function getCodeQLForCmd(
|
||||
: ["--no-calculate-baseline"];
|
||||
|
||||
await runCli(
|
||||
env,
|
||||
cmd,
|
||||
[
|
||||
"database",
|
||||
@@ -642,7 +634,7 @@ async function getCodeQLForCmd(
|
||||
}
|
||||
},
|
||||
async runAutobuild(config: Config, language: Language) {
|
||||
applyAutobuildAzurePipelinesTimeoutFix();
|
||||
applyAutobuildAzurePipelinesTimeoutFix(env);
|
||||
|
||||
const autobuildCmd = path.join(
|
||||
await this.resolveExtractor(language),
|
||||
@@ -652,8 +644,11 @@ async function getCodeQLForCmd(
|
||||
|
||||
// Bump the verbosity of the autobuild command if we're in debug mode
|
||||
if (config.debugMode) {
|
||||
process.env[EnvVar.CLI_VERBOSITY] =
|
||||
process.env[EnvVar.CLI_VERBOSITY] || EXTRACTION_DEBUG_MODE_VERBOSITY;
|
||||
env.set(
|
||||
EnvVar.CLI_VERBOSITY,
|
||||
env.getOptional(EnvVar.CLI_VERBOSITY) ??
|
||||
EXTRACTION_DEBUG_MODE_VERBOSITY,
|
||||
);
|
||||
}
|
||||
|
||||
// On macOS, System Integrity Protection (SIP) typically interferes with
|
||||
@@ -670,10 +665,10 @@ async function getCodeQLForCmd(
|
||||
// When `DYLD_INSERT_LIBRARIES` is set in the environment for a step,
|
||||
// the Actions runtime introduces its own workaround for SIP
|
||||
// (https://github.com/actions/runner/pull/416).
|
||||
await runCli(autobuildCmd);
|
||||
await runCli(env, autobuildCmd);
|
||||
},
|
||||
async extractScannedLanguage(config: Config, language: Language) {
|
||||
await runCli(cmd, [
|
||||
await runCli(env, cmd, [
|
||||
"database",
|
||||
"trace-command",
|
||||
"--index-traceless-dbs",
|
||||
@@ -685,10 +680,10 @@ async function getCodeQLForCmd(
|
||||
},
|
||||
async extractUsingBuildMode(config: Config, language: Language) {
|
||||
if (config.buildMode === BuildMode.Autobuild) {
|
||||
applyAutobuildAzurePipelinesTimeoutFix();
|
||||
applyAutobuildAzurePipelinesTimeoutFix(env);
|
||||
}
|
||||
try {
|
||||
await runCli(cmd, [
|
||||
await runCli(env, cmd, [
|
||||
"database",
|
||||
"trace-command",
|
||||
"--use-build-mode",
|
||||
@@ -727,7 +722,7 @@ async function getCodeQLForCmd(
|
||||
...getExtraOptionsFromEnv(["database", "finalize"]),
|
||||
databasePath,
|
||||
];
|
||||
await runCli(cmd, args);
|
||||
await runCli(env, cmd, args);
|
||||
},
|
||||
async resolveLanguages(
|
||||
{
|
||||
@@ -736,7 +731,7 @@ async function getCodeQLForCmd(
|
||||
filterToLanguagesWithQueries: boolean;
|
||||
} = { filterToLanguagesWithQueries: false },
|
||||
) {
|
||||
return runCliJson<ResolveLanguagesOutput>(cmd, [
|
||||
return runCliJson<ResolveLanguagesOutput>(env, cmd, [
|
||||
"resolve",
|
||||
"languages",
|
||||
"--format=betterjson",
|
||||
@@ -765,7 +760,11 @@ async function getCodeQLForCmd(
|
||||
if (workingDir !== undefined) {
|
||||
codeqlArgs.push("--working-dir", workingDir);
|
||||
}
|
||||
return await runCliJson<ResolveBuildEnvironmentOutput>(cmd, codeqlArgs);
|
||||
return await runCliJson<ResolveBuildEnvironmentOutput>(
|
||||
env,
|
||||
cmd,
|
||||
codeqlArgs,
|
||||
);
|
||||
},
|
||||
async databaseRunQueries(
|
||||
databasePath: string,
|
||||
@@ -784,7 +783,7 @@ async function getCodeQLForCmd(
|
||||
ignoringOptions: ["--expect-discarded-cache"],
|
||||
}),
|
||||
];
|
||||
await runCli(cmd, codeqlArgs);
|
||||
await runCli(env, cmd, codeqlArgs);
|
||||
},
|
||||
async databaseInterpretResults(
|
||||
databasePath: string,
|
||||
@@ -817,7 +816,7 @@ async function getCodeQLForCmd(
|
||||
"--sarif-group-rules-by-pack",
|
||||
"--sarif-include-query-help=always",
|
||||
"--sublanguage-file-coverage",
|
||||
...(await getJobRunUuidSarifOptions()),
|
||||
...(await getJobRunUuidSarifOptions(env)),
|
||||
...getExtraOptionsFromEnv(["database", "interpret-results"]),
|
||||
];
|
||||
if (sarifRunPropertyFlag !== undefined) {
|
||||
@@ -837,7 +836,7 @@ async function getCodeQLForCmd(
|
||||
}
|
||||
// Capture the stdout, which contains the analysis summary. Don't stream it to the Actions
|
||||
// logs to avoid printing it twice.
|
||||
return await runCli(cmd, codeqlArgs, {
|
||||
return await runCli(env, cmd, codeqlArgs, {
|
||||
noStreamStdout: true,
|
||||
});
|
||||
},
|
||||
@@ -854,7 +853,7 @@ async function getCodeQLForCmd(
|
||||
`--cache-cleanup=${cleanupLevel}`,
|
||||
...getExtraOptionsFromEnv(["database", "cleanup"]),
|
||||
];
|
||||
await runCli(cmd, codeqlArgs);
|
||||
await runCli(env, cmd, codeqlArgs);
|
||||
}
|
||||
},
|
||||
async databaseBundle(
|
||||
@@ -888,7 +887,9 @@ async function getCodeQLForCmd(
|
||||
]),
|
||||
);
|
||||
}
|
||||
await new toolrunner.ToolRunner(cmd, args).exec();
|
||||
await new toolrunner.ToolRunner(cmd, args, {
|
||||
env: env.getDefined(),
|
||||
}).exec();
|
||||
},
|
||||
async databaseExportDiagnostics(
|
||||
databasePath: string,
|
||||
@@ -909,27 +910,59 @@ async function getCodeQLForCmd(
|
||||
if (automationDetailsId !== undefined) {
|
||||
args.push("--sarif-category", automationDetailsId);
|
||||
}
|
||||
await new toolrunner.ToolRunner(cmd, args).exec();
|
||||
await new toolrunner.ToolRunner(cmd, args, {
|
||||
env: env.getDefined(),
|
||||
}).exec();
|
||||
},
|
||||
async diagnosticsExport(
|
||||
sarifFile: string,
|
||||
automationDetailsId: string | undefined,
|
||||
config: ActionConfig<"tempDir">,
|
||||
diagnosticDir: string | undefined,
|
||||
): Promise<void> {
|
||||
// We may be exporting diagnostics for a failed SARIF, in which case the configuration
|
||||
// file may not have been written to disk and there may not be a database. The CLI
|
||||
// will produce a SARIF for diagnostics from `diagnosticDir` without it. Therefore,
|
||||
// we check whether `configPath` exists and only provide it to the CLI if it does.
|
||||
// Although not needed, the CLI will produce an error if it
|
||||
// is provided with an argument to `--sarif-codescanning-config` that does not exist.
|
||||
let configPath: string | undefined =
|
||||
getGeneratedCodeScanningConfigPath(config);
|
||||
|
||||
if (!fs.existsSync(configPath)) {
|
||||
// Warn if there is no configuration file, even though `config` claims that `init`
|
||||
// was successful. This shouldn't be happening.
|
||||
if (config.successfullyInitialised) {
|
||||
logger.warning(
|
||||
[
|
||||
`Expected a configuration file at '${configPath}', which does not exist.`,
|
||||
"Continuing with diagnostics export anyway, without a configuration file.",
|
||||
].join(" "),
|
||||
);
|
||||
}
|
||||
|
||||
configPath = undefined;
|
||||
}
|
||||
|
||||
const args = [
|
||||
"diagnostics",
|
||||
"export",
|
||||
"--format=sarif-latest",
|
||||
`--output=${sarifFile}`,
|
||||
`--sarif-codescanning-config=${getGeneratedCodeScanningConfigPath(
|
||||
config,
|
||||
)}`,
|
||||
...(configPath !== undefined
|
||||
? [`--sarif-codescanning-config=${configPath}`]
|
||||
: []),
|
||||
...(diagnosticDir !== undefined
|
||||
? [`--diagnostic-dir=${diagnosticDir}`]
|
||||
: []),
|
||||
...getExtraOptionsFromEnv(["diagnostics", "export"]),
|
||||
];
|
||||
if (automationDetailsId !== undefined) {
|
||||
args.push("--sarif-category", automationDetailsId);
|
||||
}
|
||||
await new toolrunner.ToolRunner(cmd, args).exec();
|
||||
await new toolrunner.ToolRunner(cmd, args, {
|
||||
env: env.getDefined(),
|
||||
}).exec();
|
||||
},
|
||||
async resolveExtractor(language: Language): Promise<string> {
|
||||
// Request it using `format=json` so we don't need to strip the trailing new line generated by
|
||||
@@ -947,6 +980,7 @@ async function getCodeQLForCmd(
|
||||
...getExtraOptionsFromEnv(["resolve", "extractor"]),
|
||||
],
|
||||
{
|
||||
env: env.getDefined(),
|
||||
silent: true,
|
||||
listeners: {
|
||||
stdout: (data) => {
|
||||
@@ -974,7 +1008,7 @@ async function getCodeQLForCmd(
|
||||
...getExtraOptionsFromEnv(["resolve", "queries"]),
|
||||
...queries,
|
||||
];
|
||||
return await runCliJson<string[]>(cmd, codeqlArgs, {
|
||||
return await runCliJson<string[]>(env, cmd, codeqlArgs, {
|
||||
noStreamStdout: true,
|
||||
});
|
||||
},
|
||||
@@ -988,7 +1022,7 @@ async function getCodeQLForCmd(
|
||||
"--format=json",
|
||||
...getExtraOptionsFromEnv(["resolve", "database"]),
|
||||
];
|
||||
return await runCliJson<ResolveDatabaseOutput>(cmd, codeqlArgs, {
|
||||
return await runCliJson<ResolveDatabaseOutput>(env, cmd, codeqlArgs, {
|
||||
noStreamStdout: true,
|
||||
});
|
||||
},
|
||||
@@ -1015,7 +1049,7 @@ async function getCodeQLForCmd(
|
||||
args.push("--sarif-merge-runs-from-equal-category");
|
||||
}
|
||||
|
||||
await runCli(cmd, args);
|
||||
await runCli(env, cmd, args);
|
||||
},
|
||||
};
|
||||
// To ensure that status reports include the CodeQL CLI version wherever
|
||||
@@ -1037,7 +1071,7 @@ async function getCodeQLForCmd(
|
||||
);
|
||||
} else if (
|
||||
checkVersion &&
|
||||
process.env[EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] !== "true" &&
|
||||
env.getOptional(EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING) !== "true" &&
|
||||
!(await util.codeQlVersionAtLeast(codeql, CODEQL_NEXT_MINIMUM_VERSION))
|
||||
) {
|
||||
const result = await codeql.getVersion();
|
||||
@@ -1055,7 +1089,7 @@ async function getCodeQLForCmd(
|
||||
}' by 'github/codeql-action/*@v${getActionVersion()}' in your code scanning workflow to ` +
|
||||
"continue using this version of the CodeQL Action.",
|
||||
);
|
||||
exportEnvVar(EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING, "true");
|
||||
env.export(EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING, "true");
|
||||
}
|
||||
return codeql;
|
||||
}
|
||||
@@ -1132,12 +1166,13 @@ export function getExtraOptions(
|
||||
}
|
||||
|
||||
async function runCli(
|
||||
env: Env,
|
||||
cmd: string,
|
||||
args: string[] = [],
|
||||
opts: { stdin?: string; noStreamStdout?: boolean } = {},
|
||||
): Promise<string> {
|
||||
try {
|
||||
return await runTool(cmd, args, opts);
|
||||
return await runTool(env, cmd, args, opts);
|
||||
} catch (e) {
|
||||
if (e instanceof CommandInvocationError) {
|
||||
throw wrapCliConfigurationError(new CliError(e));
|
||||
@@ -1148,6 +1183,8 @@ async function runCli(
|
||||
|
||||
/**
|
||||
* Wraps the command executor {@link runCli} and tries to parse the output as JSON.
|
||||
*
|
||||
* @param env The environment variables.
|
||||
* @param cmd The command to run.
|
||||
* @param args The arguments to pass to the command.
|
||||
* @param opts The options for running the command.
|
||||
@@ -1156,11 +1193,12 @@ async function runCli(
|
||||
* @returns The parsed JSON output from the command.
|
||||
*/
|
||||
async function runCliJson<T>(
|
||||
env: Env,
|
||||
cmd: string,
|
||||
args: string[] = [],
|
||||
opts: { stdin?: string; noStreamStdout?: boolean } = {},
|
||||
): Promise<T> {
|
||||
const output = await runCli(cmd, args, opts);
|
||||
const output = await runCli(env, cmd, args, opts);
|
||||
try {
|
||||
return JSON.parse(output) as T;
|
||||
} catch (e) {
|
||||
@@ -1259,17 +1297,20 @@ function getExtractionVerbosityArguments(
|
||||
* Without the fix, long build processes will timeout when pulling down Java packages
|
||||
* https://developercommunity.visualstudio.com/content/problem/292284/maven-hosted-agent-connection-timeout.html
|
||||
*/
|
||||
function applyAutobuildAzurePipelinesTimeoutFix() {
|
||||
const javaToolOptions = process.env["JAVA_TOOL_OPTIONS"] || "";
|
||||
process.env["JAVA_TOOL_OPTIONS"] = [
|
||||
...javaToolOptions.split(/\s+/),
|
||||
"-Dhttp.keepAlive=false",
|
||||
"-Dmaven.wagon.http.pool=false",
|
||||
].join(" ");
|
||||
function applyAutobuildAzurePipelinesTimeoutFix(env: Env) {
|
||||
const javaToolOptions = env.getOptional("JAVA_TOOL_OPTIONS") ?? "";
|
||||
env.set(
|
||||
"JAVA_TOOL_OPTIONS",
|
||||
[
|
||||
...javaToolOptions.split(/\s+/),
|
||||
"-Dhttp.keepAlive=false",
|
||||
"-Dmaven.wagon.http.pool=false",
|
||||
].join(" "),
|
||||
);
|
||||
}
|
||||
|
||||
async function getJobRunUuidSarifOptions() {
|
||||
const jobRunUuid = process.env[EnvVar.JOB_RUN_UUID];
|
||||
async function getJobRunUuidSarifOptions(env: ReadOnlyEnv) {
|
||||
const jobRunUuid = env.getOptional(EnvVar.JOB_RUN_UUID);
|
||||
|
||||
return jobRunUuid ? [`--sarif-run-property=jobRunUuid=${jobRunUuid}`] : [];
|
||||
}
|
||||
+16
-16
@@ -21,7 +21,6 @@ import { RepositoryProperties } from "./feature-flags/properties";
|
||||
import * as gitUtils from "./git-utils";
|
||||
import { GitVersionInfo } from "./git-utils";
|
||||
import { BuiltInLanguage, Language } from "./languages";
|
||||
import { getRunnerLogger } from "./logging";
|
||||
import { CODEQL_OVERLAY_MINIMUM_VERSION } from "./overlay";
|
||||
import * as overlayDiagnostics from "./overlay/diagnostics";
|
||||
import { OverlayDisabledReason } from "./overlay/diagnostics";
|
||||
@@ -42,6 +41,7 @@ import {
|
||||
callee,
|
||||
SAMPLE_DOTCOM_API_DETAILS,
|
||||
AssertableTarget,
|
||||
RecordingLogger,
|
||||
} from "./testing-utils";
|
||||
import {
|
||||
GitHubVariant,
|
||||
@@ -102,7 +102,7 @@ function createTestInitConfigInputs(
|
||||
features: createFeatures([]),
|
||||
repositoryProperties: {},
|
||||
enableFileCoverageInformation: true,
|
||||
logger: getRunnerLogger(true),
|
||||
logger: new RecordingLogger(),
|
||||
} satisfies configUtils.InitConfigInputs,
|
||||
overrides,
|
||||
);
|
||||
@@ -150,7 +150,7 @@ function mockListLanguages(languages: string[]) {
|
||||
|
||||
test.serial("load empty config", async (t) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
const languages = "javascript,python";
|
||||
|
||||
setupActionsVars(tempDir, tempDir);
|
||||
@@ -196,7 +196,7 @@ test.serial("load empty config", async (t) => {
|
||||
|
||||
test.serial("load code quality config", async (t) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
const languages = "actions";
|
||||
|
||||
setupActionsVars(tempDir, tempDir);
|
||||
@@ -252,7 +252,7 @@ test.serial(
|
||||
"initActionState doesn't throw if there are queries configured in the repository properties",
|
||||
async (t) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
const languages = "javascript";
|
||||
|
||||
setupActionsVars(tempDir, tempDir);
|
||||
@@ -315,7 +315,7 @@ test.serial(
|
||||
|
||||
test.serial("loading a saved config produces the same config", async (t) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
|
||||
const codeql = createStubCodeQL({
|
||||
async resolveLanguages() {
|
||||
@@ -363,7 +363,7 @@ test.serial("loading a saved config produces the same config", async (t) => {
|
||||
|
||||
test.serial("loading config with version mismatch throws", async (t) => {
|
||||
return await withTmpDir(async (tempDir) => {
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
|
||||
const codeql = createStubCodeQL({
|
||||
async resolveLanguages() {
|
||||
@@ -788,12 +788,12 @@ test.serial("Unknown languages", async (t) => {
|
||||
});
|
||||
});
|
||||
|
||||
const mockLogger = getRunnerLogger(true);
|
||||
const mockLogger = new RecordingLogger();
|
||||
|
||||
test.serial("no generateRegistries when registries is undefined", async (t) => {
|
||||
return await withTmpDir(async (tmpDir) => {
|
||||
const registriesInput = undefined;
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
const { registriesAuthTokens, qlconfigFile } =
|
||||
await configUtils.generateRegistries(registriesInput, tmpDir, logger);
|
||||
|
||||
@@ -814,7 +814,7 @@ test.serial(
|
||||
token: "not-a-token",
|
||||
},
|
||||
]);
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
const { registriesAuthTokens, qlconfigFile } =
|
||||
await configUtils.generateRegistries(registriesInput, tmpDir, logger);
|
||||
|
||||
@@ -2225,7 +2225,7 @@ test("applyIncrementalAnalysisSettings: no-op when mode is not Overlay and diff
|
||||
const config = createTestConfig({});
|
||||
config.overlayDatabaseMode = OverlayDatabaseMode.None;
|
||||
const codeql = createStubCodeQL({});
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
|
||||
await configUtils.applyIncrementalAnalysisSettings(
|
||||
config,
|
||||
@@ -2243,7 +2243,7 @@ test("applyIncrementalAnalysisSettings: keeps overlay mode and adds exclusions w
|
||||
overlayDatabaseMode: OverlayDatabaseMode.Overlay,
|
||||
});
|
||||
const codeql = createStubCodeQL({});
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
|
||||
await configUtils.applyIncrementalAnalysisSettings(
|
||||
config,
|
||||
@@ -2266,7 +2266,7 @@ test.serial(
|
||||
});
|
||||
config.useOverlayDatabaseCaching = true;
|
||||
const codeql = createStubCodeQL({});
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
const addDiagnosticsStub = sinon
|
||||
.stub(overlayDiagnostics, "addOverlayDisablementDiagnostics")
|
||||
.resolves();
|
||||
@@ -2298,7 +2298,7 @@ test.serial(
|
||||
config.useOverlayDatabaseCaching = false;
|
||||
config.overlayModeSetExplicitly = true;
|
||||
const codeql = createStubCodeQL({});
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
const addDiagnosticsStub = sinon
|
||||
.stub(overlayDiagnostics, "addOverlayDisablementDiagnostics")
|
||||
.resolves();
|
||||
@@ -2321,7 +2321,7 @@ test("applyIncrementalAnalysisSettings: adds exclusions for diff-informed-only r
|
||||
const config = createTestConfig({});
|
||||
config.overlayDatabaseMode = OverlayDatabaseMode.None;
|
||||
const codeql = createStubCodeQL({});
|
||||
const logger = getRunnerLogger(true);
|
||||
const logger = new RecordingLogger();
|
||||
|
||||
await configUtils.applyIncrementalAnalysisSettings(
|
||||
config,
|
||||
@@ -2535,7 +2535,7 @@ test("determineUserConfig - merges configs if FF is enabled in Default Setup", a
|
||||
// also check whether loading the configuration from disk that was written
|
||||
// by `determineUserConfig` matches our expectations.
|
||||
const loadedFromDisk = configUtils.getLocalConfig(
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
expectedConfigPath,
|
||||
false,
|
||||
);
|
||||
|
||||
@@ -465,6 +465,8 @@ export async function initActionState(
|
||||
overlayModeSetExplicitly: false,
|
||||
repositoryProperties,
|
||||
enableFileCoverageInformation,
|
||||
// We don't set this to `true` until `init` is successful.
|
||||
successfullyInitialised: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -130,6 +130,9 @@ export interface Config {
|
||||
* Whether to enable file coverage information.
|
||||
*/
|
||||
enableFileCoverageInformation: boolean;
|
||||
|
||||
/** Whether the analysis was successfully initialised using the configuration. */
|
||||
successfullyInitialised: boolean;
|
||||
}
|
||||
|
||||
/** Properties available in `Config`. */
|
||||
|
||||
@@ -2,15 +2,15 @@ import test, { ExecutionContext } from "ava";
|
||||
|
||||
import { RepositoryProperties } from "../feature-flags/properties";
|
||||
import { BuiltInLanguage, Language } from "../languages";
|
||||
import { getRunnerLogger } from "../logging";
|
||||
import {
|
||||
checkExpectedLogMessages,
|
||||
getRecordingLogger,
|
||||
LoggedMessage,
|
||||
makeMacro,
|
||||
RecordingLogger,
|
||||
setupActionsVars,
|
||||
} from "../testing-utils";
|
||||
import { ConfigurationError, prettyPrintPack } from "../util";
|
||||
import { ConfigurationError, prettyPrintPack, withTmpDir } from "../util";
|
||||
|
||||
import * as dbConfig from "./db-config";
|
||||
|
||||
@@ -384,7 +384,7 @@ calculateAugmentationErrorMacro(
|
||||
|
||||
test("parseUserConfig - successfully parses valid YAML", (t) => {
|
||||
const result = dbConfig.parseUserConfig(
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
"test",
|
||||
`
|
||||
paths-ignore:
|
||||
@@ -410,7 +410,7 @@ test("parseUserConfig - throws a ConfigurationError if the file is not valid YAM
|
||||
t.throws(
|
||||
() =>
|
||||
dbConfig.parseUserConfig(
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
"test",
|
||||
`
|
||||
paths-ignore:
|
||||
@@ -562,74 +562,89 @@ test("mergeDefaultSetupAndUserConfigs - keeps other properties from user-supplie
|
||||
t.deepEqual(result, configFile);
|
||||
});
|
||||
|
||||
test("mergeDefaultSetupAndUserConfigs - ignores, but warns about, unknown keys from Default Setup", async (t) => {
|
||||
const logger = new RecordingLogger();
|
||||
const configFile: dbConfig.UserConfig = {
|
||||
"query-filters": [{ exclude: { a: "b" } }],
|
||||
"paths-ignore": ["path"],
|
||||
};
|
||||
test.serial(
|
||||
"mergeDefaultSetupAndUserConfigs - ignores, but warns about, unknown keys from Default Setup",
|
||||
async (t) => {
|
||||
const logger = new RecordingLogger();
|
||||
const configFile: dbConfig.UserConfig = {
|
||||
"query-filters": [{ exclude: { a: "b" } }],
|
||||
"paths-ignore": ["path"],
|
||||
};
|
||||
|
||||
const result = dbConfig.mergeDefaultSetupAndUserConfigs(
|
||||
logger,
|
||||
{
|
||||
"default-setup": {
|
||||
borg: [],
|
||||
org: {
|
||||
unknown: "foo",
|
||||
"model-packs": [],
|
||||
await withTmpDir(async (tmpDir) => {
|
||||
setupActionsVars(tmpDir, tmpDir);
|
||||
const result = dbConfig.mergeDefaultSetupAndUserConfigs(
|
||||
logger,
|
||||
{
|
||||
"default-setup": {
|
||||
borg: [],
|
||||
org: {
|
||||
unknown: "foo",
|
||||
"model-packs": [],
|
||||
},
|
||||
} as unknown as dbConfig.DefaultSetupConfig,
|
||||
"paths-ignore": ["other-path"],
|
||||
},
|
||||
} as unknown as dbConfig.DefaultSetupConfig,
|
||||
"paths-ignore": ["other-path"],
|
||||
},
|
||||
configFile,
|
||||
);
|
||||
configFile,
|
||||
);
|
||||
|
||||
t.deepEqual(result, {
|
||||
...configFile,
|
||||
"default-setup": { org: { "model-packs": [] } },
|
||||
});
|
||||
t.deepEqual(result, {
|
||||
...configFile,
|
||||
"default-setup": { org: { "model-packs": [] } },
|
||||
});
|
||||
|
||||
const expectedUnrecognisedKeys = [
|
||||
".default-setup.org.unknown",
|
||||
".default-setup.borg",
|
||||
".paths-ignore",
|
||||
].join(", ");
|
||||
checkExpectedLogMessages(t, logger.messages, [
|
||||
`Unrecognised keys in Default Setup configuration: ${expectedUnrecognisedKeys}`,
|
||||
]);
|
||||
});
|
||||
const expectedUnrecognisedKeys = [
|
||||
".default-setup.org.unknown",
|
||||
".default-setup.borg",
|
||||
".paths-ignore",
|
||||
].join(", ");
|
||||
checkExpectedLogMessages(t, logger.messages, [
|
||||
`Unrecognised keys in Default Setup configuration: ${expectedUnrecognisedKeys}`,
|
||||
]);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
test("mergeDefaultSetupAndUserConfigs - warns about invalid keys from Default Setup", async (t) => {
|
||||
const logger = new RecordingLogger();
|
||||
const configFile: dbConfig.UserConfig = {};
|
||||
test.serial(
|
||||
"mergeDefaultSetupAndUserConfigs - warns about invalid keys from Default Setup",
|
||||
async (t) => {
|
||||
const logger = new RecordingLogger();
|
||||
const configFile: dbConfig.UserConfig = {};
|
||||
|
||||
const result = dbConfig.mergeDefaultSetupAndUserConfigs(
|
||||
logger,
|
||||
{
|
||||
"default-setup": {
|
||||
org: {
|
||||
"model-packs": [123],
|
||||
await withTmpDir(async (tmpDir) => {
|
||||
setupActionsVars(tmpDir, tmpDir);
|
||||
|
||||
const result = dbConfig.mergeDefaultSetupAndUserConfigs(
|
||||
logger,
|
||||
{
|
||||
"default-setup": {
|
||||
org: {
|
||||
"model-packs": [123],
|
||||
},
|
||||
} as unknown as dbConfig.DefaultSetupConfig,
|
||||
},
|
||||
} as unknown as dbConfig.DefaultSetupConfig,
|
||||
},
|
||||
configFile,
|
||||
);
|
||||
configFile,
|
||||
);
|
||||
|
||||
t.deepEqual(result, {
|
||||
...configFile,
|
||||
"default-setup": { org: { "model-packs": [123] } },
|
||||
});
|
||||
t.deepEqual(result, {
|
||||
...configFile,
|
||||
"default-setup": { org: { "model-packs": [123] } },
|
||||
});
|
||||
|
||||
const expectedInvalidKeys = [".default-setup.org.model-packs[0]"].join(", ");
|
||||
checkExpectedLogMessages(t, logger.messages, [
|
||||
`Invalid keys in Default Setup configuration: ${expectedInvalidKeys}`,
|
||||
]);
|
||||
});
|
||||
const expectedInvalidKeys = [".default-setup.org.model-packs[0]"].join(
|
||||
", ",
|
||||
);
|
||||
checkExpectedLogMessages(t, logger.messages, [
|
||||
`Invalid keys in Default Setup configuration: ${expectedInvalidKeys}`,
|
||||
]);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
/** Parses `contents` as a configuration without validating it. */
|
||||
function parseUnvalidatedConfig(contents: string): dbConfig.UserConfig {
|
||||
return dbConfig.parseUserConfig(
|
||||
getRunnerLogger(true),
|
||||
new RecordingLogger(),
|
||||
"test",
|
||||
contents,
|
||||
false,
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
import * as fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
import test, { type ExecutionContext } from "ava";
|
||||
|
||||
import * as diagnostics from "./diagnostics";
|
||||
import { BuiltInLanguage } from "./languages";
|
||||
import {
|
||||
checkExpectedLogMessages,
|
||||
createTestConfig,
|
||||
initAllState,
|
||||
RecordingLogger,
|
||||
setupTests,
|
||||
} from "./testing-utils";
|
||||
import { withTmpDir } from "./util";
|
||||
|
||||
setupTests(test);
|
||||
|
||||
const id = "codeql-action/test-diagnostic";
|
||||
const name = "Test title";
|
||||
|
||||
test("makeDiagnostic - adds expected properties", (t) => {
|
||||
const diagnostic = diagnostics.makeDiagnostic(id, name, {});
|
||||
|
||||
t.truthy(diagnostic.timestamp);
|
||||
t.is(diagnostic.source.id, id);
|
||||
t.is(diagnostic.source.name, name);
|
||||
});
|
||||
|
||||
test("getLanguageDiagnosticsPath gets language-specific path", async (t) =>
|
||||
withTmpDir(async (tmpDir) => {
|
||||
for (const language of Object.values(BuiltInLanguage)) {
|
||||
t.is(
|
||||
diagnostics.getLanguageDiagnosticsPath(tmpDir, language),
|
||||
path.resolve(
|
||||
tmpDir,
|
||||
language,
|
||||
...diagnostics.CODEQL_ACTION_DIAGNOSTIC_SUBDIR_PARTS,
|
||||
),
|
||||
);
|
||||
}
|
||||
}));
|
||||
|
||||
test("getTempLanguageDiagnosticsPath returns path without language", async (t) =>
|
||||
withTmpDir(async (tmpDir) => {
|
||||
t.is(
|
||||
diagnostics.getTempLanguageDiagnosticsPath(tmpDir),
|
||||
path.resolve(
|
||||
tmpDir,
|
||||
diagnostics.TEMP_DIAGNOSTIC_DIR_NAME,
|
||||
...diagnostics.CODEQL_ACTION_DIAGNOSTIC_SUBDIR_PARTS,
|
||||
),
|
||||
);
|
||||
}));
|
||||
|
||||
test("getTempLanguageDiagnosticsPath returns language-specific path if a language is provided", async (t) =>
|
||||
withTmpDir(async (tmpDir) => {
|
||||
t.is(
|
||||
diagnostics.getTempLanguageDiagnosticsPath(tmpDir, BuiltInLanguage.swift),
|
||||
path.resolve(
|
||||
tmpDir,
|
||||
diagnostics.TEMP_DIAGNOSTIC_DIR_NAME,
|
||||
BuiltInLanguage.swift,
|
||||
...diagnostics.CODEQL_ACTION_DIAGNOSTIC_SUBDIR_PARTS,
|
||||
),
|
||||
);
|
||||
}));
|
||||
|
||||
test("getDatabaseDiagnosticsPath returns language-specific path", async (t) =>
|
||||
withTmpDir(async (tmpDir) => {
|
||||
t.is(
|
||||
diagnostics.getDatabaseDiagnosticsPath(
|
||||
createTestConfig({ dbLocation: tmpDir }),
|
||||
BuiltInLanguage.swift,
|
||||
),
|
||||
path.resolve(
|
||||
tmpDir,
|
||||
BuiltInLanguage.swift,
|
||||
...diagnostics.CODEQL_ACTION_DIAGNOSTIC_SUBDIR_PARTS,
|
||||
),
|
||||
);
|
||||
}));
|
||||
|
||||
/**
|
||||
* Diagnostic files that are written to disk don't have deterministic names.
|
||||
* This function recursively finds all `.json` files at {@link rootPath},
|
||||
* asserts that there is exactly one, and that it matches {@link expected}.
|
||||
*
|
||||
* @param rootPath The path to start searching from.
|
||||
*/
|
||||
function assertSingleDiagnosticIn(
|
||||
t: ExecutionContext<unknown>,
|
||||
rootPath: string,
|
||||
expected: diagnostics.DiagnosticMessage,
|
||||
) {
|
||||
// Find all `.json` files in `rootPath` and check that there is exactly one.
|
||||
const filePaths = fs
|
||||
.readdirSync(rootPath, {
|
||||
recursive: true,
|
||||
encoding: "utf-8",
|
||||
})
|
||||
.filter((p) => p.endsWith(".json"));
|
||||
|
||||
t.is(filePaths.length, 1);
|
||||
|
||||
// Check that the written diagnostic matches the one we added.
|
||||
const contents = fs.readFileSync(
|
||||
path.resolve(rootPath, filePaths[0]),
|
||||
"utf-8",
|
||||
);
|
||||
|
||||
const readDiagnostic = JSON.parse(contents) as diagnostics.DiagnosticMessage;
|
||||
t.deepEqual(readDiagnostic, expected);
|
||||
}
|
||||
|
||||
test("addDiagnostic writes temporary diagnostics and flushDiagnostics moves them to the database", async (t) =>
|
||||
withTmpDir(async (tmpDir) => {
|
||||
const logger = new RecordingLogger();
|
||||
|
||||
const tempDiagDir = path.resolve(tmpDir, "temp");
|
||||
const testDbDir = path.resolve(tmpDir, "test", "database");
|
||||
const diagnostic = diagnostics.makeDiagnostic(id, name, {});
|
||||
|
||||
// Write the diagnostic. The path provided for `dbLocation` doesn't exist,
|
||||
// so the diagnostic will be written to a temporary location.
|
||||
t.notThrows(() => {
|
||||
diagnostics.addDiagnostic(
|
||||
createTestConfig({ tempDir: tempDiagDir, dbLocation: testDbDir }),
|
||||
BuiltInLanguage.actions,
|
||||
diagnostic,
|
||||
logger,
|
||||
);
|
||||
});
|
||||
|
||||
// Check that `tempDiagDir` was created.
|
||||
t.true(fs.existsSync(tempDiagDir));
|
||||
|
||||
// Check that the diagnostic exists under `tempDiagDir`.
|
||||
assertSingleDiagnosticIn(t, tempDiagDir, diagnostic);
|
||||
|
||||
// Flush the diagnostics. This will cause the diagnostic we wrote previously to
|
||||
// be moved to a location under `dbLocation`.
|
||||
t.notThrows(() => {
|
||||
diagnostics.flushDiagnostics(
|
||||
initAllState({ logger }),
|
||||
createTestConfig({
|
||||
tempDir: tempDiagDir,
|
||||
dbLocation: testDbDir,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
// Check that `testDbDir` was created.
|
||||
t.true(fs.existsSync(testDbDir));
|
||||
|
||||
// Check that the diagnostic exists under `testDbDir`.
|
||||
assertSingleDiagnosticIn(t, testDbDir, diagnostic);
|
||||
|
||||
// Check that we logged that the database directory doesn't exist yet
|
||||
// and that we moved one diagnostic.
|
||||
checkExpectedLogMessages(t, logger.messages, [
|
||||
`but the database at ${path.join(testDbDir, "actions")} does not exist yet`,
|
||||
"Moving 1 diagnostic(s) to their respective databases.",
|
||||
]);
|
||||
}));
|
||||
Loaded 100 of 136 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user