Skip to content

Commit 71e6077

Browse files
authored
Merge branch 'main' into nickfyson/speculative-script-fix
2 parents f2c09fb + b8e2556 commit 71e6077

10 files changed

+24
-12
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the
66

77
## [UNRELEASED]
88

9+
No user facing changes.
10+
11+
## 3.25.0 - 15 Apr 2024
12+
913
- The deprecated feature for extracting dependencies for a Python analysis has been removed. [#2224](https://github.com/github/codeql-action/pull/2224)
1014

1115
As a result, the following inputs and environment variables are now ignored:

lib/api-client.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/api-client.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-lib.js

+6-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-lib.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeql",
3-
"version": "3.25.0",
3+
"version": "3.25.1",
44
"private": true,
55
"description": "CodeQL action",
66
"scripts": {

src/api-client.ts

+1
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ export function wrapApiConfigurationError(e: unknown) {
199199
if (isHTTPError(e)) {
200200
if (
201201
e.message.includes("API rate limit exceeded for site ID installation") ||
202+
e.message.includes("commit not found") ||
202203
/^ref .* not found in this repository$/.test(e.message)
203204
) {
204205
return new ConfigurationError(e.message);

src/upload-lib.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,16 @@ export async function uploadFromActions(
320320

321321
function getSarifFilePaths(sarifPath: string) {
322322
if (!fs.existsSync(sarifPath)) {
323-
throw new InvalidSarifUploadError(`Path does not exist: ${sarifPath}`);
323+
// This is always a configuration error, even for first-party runs.
324+
throw new ConfigurationError(`Path does not exist: ${sarifPath}`);
324325
}
325326

326327
let sarifFiles: string[];
327328
if (fs.lstatSync(sarifPath).isDirectory()) {
328329
sarifFiles = findSarifFilesInDir(sarifPath);
329330
if (sarifFiles.length === 0) {
330-
throw new InvalidSarifUploadError(
331+
// This is always a configuration error, even for first-party runs.
332+
throw new ConfigurationError(
331333
`No SARIF files found to upload in "${sarifPath}".`,
332334
);
333335
}
@@ -733,7 +735,8 @@ export function validateUniqueCategory(sarif: SarifFile): void {
733735
for (const [category, { id, tool }] of Object.entries(categories)) {
734736
const sentinelEnvVar = `CODEQL_UPLOAD_SARIF_${category}`;
735737
if (process.env[sentinelEnvVar]) {
736-
throw new InvalidSarifUploadError(
738+
// This is always a configuration error, even for first-party runs.
739+
throw new ConfigurationError(
737740
"Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. " +
738741
"The easiest fix is to specify a unique value for the `category` input. If .runs[].automationDetails.id is specified " +
739742
"in the sarif file, that will take precedence over your configured `category`. " +

0 commit comments

Comments
 (0)