Skip to content

Commit

Permalink
fix env name, set env in workflow
Browse files Browse the repository at this point in the history
Signed-off-by: MarkAckert <[email protected]>
  • Loading branch information
MarkAckert committed Feb 1, 2024
1 parent 97dfeb9 commit bd0f9b4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/license-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ env:
ARTIFACT_REPO: init_in_step_one
ARTIFACT_VERSION: init_in_step_one
ORT_VERSION: 12.0.0
ORT_LOG_LEVEL: ${{ github.event.inputs.ort_log_level }}

jobs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class OrtReportAction implements IAction {
console.log("Running ORT License and Notice report on " + resolvedDir);
const reportProcess = spawn("ort", ["report", "-i", resolvedDir + "/analyzer-result.json",
"-o", Constants.LICENSE_REPORTS_DIR + path.sep + path.basename(projectPath),
Constants.ORT_DEBUG_LEVEL,
Constants.ORT_LOG_LEVEL,
"-f", "PlainTextTemplate",
"-O", "PlainTextTemplate=template.id=NOTICE_DEFAULT", // generates notices
"-O", `PlainTextTemplate=template.path=${Constants.SOURCE_RESOURCES_DIR}/../resources/tpsr-full-template.md.ftl` //generates tpsr section
Expand Down
2 changes: 1 addition & 1 deletion licenses/dependency-scan/src/actions/ort/OrtSbomAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class OrtSbomAction implements IAction {
console.log("Running ORT SBOM generation for " + resolvedDir);
const reportProcess = spawn("ort", ["report", "-i", resolvedDir + "/analyzer-result.json",
"-o", Constants.SBOM_REPORTS_DIR + path.sep + path.basename(projectPath),
Constants.ORT_DEBUG_LEVEL,
Constants.ORT_LOG_LEVEL,
"-O", `SpdxDocument=document.name=${path.basename(projectPath)}`,
"-f", "SpdxDocument"
], {
Expand Down
2 changes: 1 addition & 1 deletion licenses/dependency-scan/src/actions/ort/OrtScanAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class OrtScanAction implements IAction {
projectDir,
"-o",
projectDir,
Constants.ORT_DEBUG_LEVEL,
Constants.ORT_LOG_LEVEL,
"-f",
"JSON"], {
cwd: process.env.cwd,
Expand Down
2 changes: 1 addition & 1 deletion licenses/dependency-scan/src/constants/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ export class Constants {

public static readonly SKIP_INSTALL_SPECIFIC: string = Utilities.getEnvStr("SKIP_INSTALL_SPECIFIC", "")

public static readonly ORT_DEBUG_LEVEL: string = Utilities.getOrtDebug("ORT_DEBUG_LEVEL", "--warn");
public static readonly ORT_LOG_LEVEL: string = Utilities.getOrtLogLevel("ORT_LOG_LEVEL", "warn");
}
2 changes: 1 addition & 1 deletion licenses/dependency-scan/src/utils/Utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { isNullOrUndefined } from "util";

export class Utilities {

public static getOrtDebug(envVar: string, defaultLevel: string): string {
public static getOrtLogLevel(envVar: string, defaultLevel: string): string {
const envValue = Utilities.getEnvStr(envVar, defaultLevel);
switch(envValue.toLowerCase()) {
case "info":
Expand Down

0 comments on commit bd0f9b4

Please sign in to comment.