MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / saveBundle

Method saveBundle

app/cli/pkg/action/attestation_push.go:289–304  ·  view source on GitHub ↗
(bundle *protobundle.Bundle)

Source from the content-addressed store, hash-verified

287}
288
289func (action *AttestationPush) saveBundle(bundle *protobundle.Bundle) error {
290 // Save bundle to disk if requested
291 if action.bundlePath != "" {
292 bundleJSON, err := encodeBundle(bundle)
293 if err != nil {
294 return fmt.Errorf("encoding bundle: %w", err)
295 }
296 action.Logger.Info().Msg(fmt.Sprintf("Storing Sigstore bundle %s", action.bundlePath))
297 err = os.WriteFile(action.bundlePath, bundleJSON, 0600)
298 if err != nil {
299 return fmt.Errorf("writing bundle: %w", err)
300 }
301 }
302
303 return nil
304}
305
306func pushToControlPlane(ctx context.Context, conn *grpc.ClientConn, bundle *protobundle.Bundle, workflowRunID string, markVersionAsReleased bool) (string, error) {
307 encodedBundle, err := encodeBundle(bundle)

Callers 1

RunMethod · 0.95

Calls 2

encodeBundleFunction · 0.85
InfoMethod · 0.65

Tested by

no test coverage detected