@@ -418,18 +418,25 @@ func BuildImageOnce(once *sync.Once, dctx, dfile, nameAndTag string, buildArgs m
418418
419419func BuildImage (dctx , dfile , nameAndTag string , buildArgs map [string ]string ) error {
420420 dfilePath := filepath .Join (dctx , dfile )
421+
421422 if os .Getenv ("CTF_CLNODE_DLV" ) == "true" {
422423 commandParts := []string {"docker" , "build" , "--build-arg" , `GO_GCFLAGS=all=-N -l` , "--build-arg" , "CHAINLINK_USER=chainlink" }
423424 for k , v := range buildArgs {
424425 commandParts = append (commandParts , "--build-arg" , fmt .Sprintf ("%s=%s" , k , v ))
425426 }
427+ if os .Getenv ("GITHUB_TOKEN" ) != "" {
428+ commandParts = append (commandParts , "--secret id=GIT_AUTH_TOKEN,env=GITHUB_TOKEN" )
429+ }
426430 commandParts = append (commandParts , "-t" , nameAndTag , "-f" , dfilePath , dctx )
427431 return RunCommand (commandParts [0 ], commandParts [1 :]... )
428432 }
429433 commandParts := []string {"docker" , "build" , "--build-arg" , "CHAINLINK_USER=chainlink" }
430434 for k , v := range buildArgs {
431435 commandParts = append (commandParts , "--build-arg" , fmt .Sprintf ("%s=%s" , k , v ))
432436 }
437+ if os .Getenv ("GITHUB_TOKEN" ) != "" {
438+ commandParts = append (commandParts , "--secret id=GIT_AUTH_TOKEN,env=GITHUB_TOKEN" )
439+ }
433440 commandParts = append (commandParts , "-t" , nameAndTag , "-f" , dfilePath , dctx )
434441 return RunCommand (commandParts [0 ], commandParts [1 :]... )
435442}
0 commit comments