Bläddra i källkod

chore: add some debugging

jose-fully-ported 2 år sedan
förälder
incheckning
f30daf428c
1 ändrade filer med 7 tillägg och 1 borttagningar
  1. 7 1
      cli/cmd/docker/builder.go

+ 7 - 1
cli/cmd/docker/builder.go

@@ -209,7 +209,12 @@ func buildLocalWithBuildkit(ctx context.Context, opts BuildOpts) error {
 
 	cacheFrom := fmt.Sprintf("%s:%s", opts.ImageRepo, opts.CurrentTag)
 	cacheTo := ""
-	if ok, _ := isRunningInGithubActions(); ok && os.Getenv("BUILDKIT_CACHE_EXPORTER") == "gha" {
+	ok, ghaErr := isRunningInGithubActions()
+	if ghaErr != nil {
+		fmt.Printf("Github Actions environment error: %s\n", err.Error())
+	}
+		
+	if ok && os.Getenv("BUILDKIT_CACHE_EXPORTER") == "gha" {
 		fmt.Println("Github Actions environment detected, switching to the GitHub Actions cache exporter")
 		cacheFrom = "type=gha"
 		cacheTo = "type=gha"
@@ -368,5 +373,6 @@ func isRunningInGithubActions() (bool, error) {
 	}
 	defer resp.Body.Close() //nolint:errcheck
 
+	fmt.Println("%d\n", resp.StatusCode)
 	return resp.StatusCode == http.StatusOK, nil
 }