Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ inputs:
default: latest
working-directory:
description: Working Directory
sarif-tool-name:
description: Re-write SARIF file tool name
default: 'true'
attestation:
description: Attestation
default: 'false'
Expand Down
13 changes: 13 additions & 0 deletions src/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ pub struct Action {
)]
working_directory: String,

/// Re-write SARIF file tool name
#[input(
description = "Re-write SARIF file tool name",
rename = "sarif-tool-name",
default = "true"
)]
sarif_tool_name: bool,

/// Attestation
#[input(description = "Attestation", default = "false")]
attestation: bool,
Expand Down Expand Up @@ -360,6 +368,11 @@ impl Action {
log::debug!("Allow empty database: {}", self.allow_empty_database);
self.allow_empty_database
}

pub fn sarif_tool_name(&self) -> bool {
log::debug!("Re-write SARIF tool name: {}", self.sarif_tool_name);
self.sarif_tool_name
}
}

#[cfg(test)]
Expand Down
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,13 @@ async fn main() -> Result<()> {

log::info!("Post-processing SARIF results");

extractors::update_sarif(&sarif_path, extractor.display_name.clone())
.context("Failed to update SARIF file with extractor information")?;
if action.sarif_tool_name() {
log::info!("Updating SARIF tool name with extractor information");
extractors::update_sarif(&sarif_path, extractor.display_name.clone())
.context("Failed to update SARIF file with extractor information")?;
} else {
log::info!("Skipping SARIF tool name update as per configuration");
}

// Reload the database to get analysis info
database.reload()?;
Expand Down
Loading