Skip to content

Commit

Permalink
Generate BOM metadata timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
logicaloud committed Aug 17, 2023
1 parent 47967d7 commit 574ffd3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CycloneDX/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,12 @@ async Task<int> OnExecuteAsync(CommandLineApplication app) {
bom.Metadata.Component.BomRef = $"{bom.Metadata.Component.Name}@{bom.Metadata.Component.Version}";
}

// Automatically generate a timestamp if none is provided with the metadata
if (bom.Metadata.Timestamp == null)
{
bom.Metadata.Timestamp = DateTime.UtcNow;
}

AddMetadataTool(bom);

if (!(noSerialNumber || noSerialNumberDeprecated)) bom.SerialNumber = "urn:uuid:" + System.Guid.NewGuid().ToString();
Expand Down

0 comments on commit 574ffd3

Please sign in to comment.