Skip to content

Commit

Permalink
Merge branch 'main' into nickfyson/speculative-script-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfyson committed Apr 16, 2024
2 parents f2c09fb + b8e2556 commit 71e6077
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the

## [UNRELEASED]

No user facing changes.

## 3.25.0 - 15 Apr 2024

- The deprecated feature for extracting dependencies for a Python analysis has been removed. [#2224](https://github.com/github/codeql-action/pull/2224)

As a result, the following inputs and environment variables are now ignored:
Expand Down
1 change: 1 addition & 0 deletions lib/api-client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/api-client.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions lib/upload-lib.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/upload-lib.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "3.25.0",
"version": "3.25.1",
"private": true,
"description": "CodeQL action",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export function wrapApiConfigurationError(e: unknown) {
if (isHTTPError(e)) {
if (
e.message.includes("API rate limit exceeded for site ID installation") ||
e.message.includes("commit not found") ||
/^ref .* not found in this repository$/.test(e.message)
) {
return new ConfigurationError(e.message);
Expand Down
9 changes: 6 additions & 3 deletions src/upload-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,16 @@ export async function uploadFromActions(

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

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

0 comments on commit 71e6077

Please sign in to comment.