1
1
import * as core from "@actions/core" ;
2
2
3
3
import * as actionsUtil from "./actions-util" ;
4
- import { getActionVersion } from "./actions-util" ;
4
+ import { getActionVersion , isFirstPartyAnalysis } from "./actions-util" ;
5
5
import { getGitHubVersion } from "./api-client" ;
6
6
import { Logger , getActionsLogger } from "./logging" ;
7
7
import { parseRepositoryNwo } from "./repository" ;
@@ -22,6 +22,8 @@ import {
22
22
wrapError ,
23
23
} from "./util" ;
24
24
25
+ const ACTION_NAME = "upload-sarif" ;
26
+
25
27
interface UploadSarifStatusReport
26
28
extends StatusReportBase ,
27
29
upload_lib . UploadStatusReport { }
@@ -32,7 +34,7 @@ async function sendSuccessStatusReport(
32
34
logger : Logger ,
33
35
) {
34
36
const statusReportBase = await createStatusReportBase (
35
- "upload-sarif" ,
37
+ ACTION_NAME ,
36
38
"success" ,
37
39
startedAt ,
38
40
undefined ,
@@ -56,7 +58,7 @@ async function run() {
56
58
57
59
await sendStatusReport (
58
60
await createStatusReportBase (
59
- "upload-sarif" ,
61
+ ACTION_NAME ,
60
62
"starting" ,
61
63
startedAt ,
62
64
undefined ,
@@ -87,6 +89,7 @@ async function run() {
87
89
await sendSuccessStatusReport ( startedAt , uploadResult . statusReport , logger ) ;
88
90
} catch ( unwrappedError ) {
89
91
const error =
92
+ ! isFirstPartyAnalysis ( ACTION_NAME ) &&
90
93
unwrappedError instanceof upload_lib . InvalidSarifUploadError
91
94
? new ConfigurationError ( unwrappedError . message )
92
95
: wrapError ( unwrappedError ) ;
@@ -95,7 +98,7 @@ async function run() {
95
98
console . log ( error ) ;
96
99
await sendStatusReport (
97
100
await createStatusReportBase (
98
- "upload-sarif" ,
101
+ ACTION_NAME ,
99
102
getActionsStatus ( error ) ,
100
103
startedAt ,
101
104
undefined ,
0 commit comments