Skip to content

Mark limits errors from third-party SARIF uploads as configuration errors #2173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use isFirstPartyAnalysis for a stronger check
  • Loading branch information
henrymercer committed Feb 29, 2024
commit e12a8cc5eb90431cfed6096ac78c48448b5cf331
10 changes: 6 additions & 4 deletions lib/upload-sarif-action.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-sarif-action.js.map

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

11 changes: 7 additions & 4 deletions src/upload-sarif-action.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as core from "@actions/core";

import * as actionsUtil from "./actions-util";
import { getActionVersion } from "./actions-util";
import { getActionVersion, isFirstPartyAnalysis } from "./actions-util";
import { getGitHubVersion } from "./api-client";
import { Logger, getActionsLogger } from "./logging";
import { parseRepositoryNwo } from "./repository";
Expand All @@ -22,6 +22,8 @@ import {
wrapError,
} from "./util";

const ACTION_NAME = "upload-sarif";

interface UploadSarifStatusReport
extends StatusReportBase,
upload_lib.UploadStatusReport {}
Expand All @@ -32,7 +34,7 @@ async function sendSuccessStatusReport(
logger: Logger,
) {
const statusReportBase = await createStatusReportBase(
"upload-sarif",
ACTION_NAME,
"success",
startedAt,
undefined,
Expand All @@ -56,7 +58,7 @@ async function run() {

await sendStatusReport(
await createStatusReportBase(
"upload-sarif",
ACTION_NAME,
"starting",
startedAt,
undefined,
Expand Down Expand Up @@ -87,6 +89,7 @@ async function run() {
await sendSuccessStatusReport(startedAt, uploadResult.statusReport, logger);
} catch (unwrappedError) {
const error =
!isFirstPartyAnalysis(ACTION_NAME) &&
unwrappedError instanceof upload_lib.InvalidSarifUploadError
? new ConfigurationError(unwrappedError.message)
: wrapError(unwrappedError);
Expand All @@ -95,7 +98,7 @@ async function run() {
console.log(error);
await sendStatusReport(
await createStatusReportBase(
"upload-sarif",
ACTION_NAME,
getActionsStatus(error),
startedAt,
undefined,
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy