mirror of
https://github.com/github/codeql-action.git
synced 2026-01-03 21:20:09 +08:00
add first_party_analysis boolean to all status reports
This commit is contained in:
@@ -7,6 +7,7 @@ import * as safeWhich from "@chrisgavin/safe-which";
|
||||
import { JSONSchemaForNPMPackageJsonFiles } from "@schemastore/package";
|
||||
|
||||
import type { Config } from "./config-utils";
|
||||
import { EnvVar } from "./environment";
|
||||
import {
|
||||
doesDirectoryExist,
|
||||
getCodeQLDatabasePath,
|
||||
@@ -259,6 +260,17 @@ export function getActionVersion(): string {
|
||||
return pkg.version!;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns a boolean indicating whether the analysis is considered to be first party.
|
||||
*
|
||||
* This is based on whether the init action has been used, which is only used for first party analysis.
|
||||
* When a SARIF file has been generated by other means and submitted using the upload action, this is
|
||||
* considered to be a third party analysis and is treated differently when calculating SLOs.
|
||||
*/
|
||||
export function isFirstPartyAnalysis(): boolean {
|
||||
return process.env[EnvVar.INIT_ACTION_HAS_RUN] === "true";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the event that triggered this workflow.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user