(bundle *protobundle.Bundle)
| 287 | } |
| 288 | |
| 289 | func (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 | |
| 306 | func pushToControlPlane(ctx context.Context, conn *grpc.ClientConn, bundle *protobundle.Bundle, workflowRunID string, markVersionAsReleased bool) (string, error) { |
| 307 | encodedBundle, err := encodeBundle(bundle) |
no test coverage detected