Skip to content
Merged
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
5 changes: 3 additions & 2 deletions pkg/attestation/crafter/crafter.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,8 @@ func (c *Crafter) AutoCollectPRMetadata(ctx context.Context, attestationID strin
}

// Create a temporary file for the metadata
tmpFile, err := os.CreateTemp("", "pr-metadata-*.json")
materialName := fmt.Sprintf("pr-metadata-%s", metadata.Number)
tmpFile, err := os.CreateTemp("", fmt.Sprintf("%s.json", materialName))
if err != nil {
return fmt.Errorf("failed to create temp file: %w", err)
}
Expand All @@ -549,7 +550,7 @@ func (c *Crafter) AutoCollectPRMetadata(ctx context.Context, attestationID strin
tmpFile.Close()

// Add the material using the crafter with explicit CHAINLOOP_PR_INFO type
if _, err := c.AddMaterialContractFree(ctx, attestationID, schemaapi.CraftingSchema_Material_CHAINLOOP_PR_INFO.String(), "pr-metadata", tmpFile.Name(), casBackend, nil); err != nil {
if _, err := c.AddMaterialContractFree(ctx, attestationID, schemaapi.CraftingSchema_Material_CHAINLOOP_PR_INFO.String(), materialName, tmpFile.Name(), casBackend, nil); err != nil {
return fmt.Errorf("failed to add PR/MR metadata material: %w", err)
}

Expand Down
Loading