@@ -87,13 +87,13 @@ func RunGitClone(ctx context.Context, wk workerruntime.Runtime, a sdk.Action, se
87
87
var err error
88
88
gitURL , auth , err = vcsStrategy (ctx , wk , wk .Parameters (), secrets )
89
89
if err != nil {
90
- return sdk.Result {}, fmt .Errorf ("Could not use VCS Auth Strategy from application: %v" , err )
90
+ return sdk.Result {}, fmt .Errorf ("could not use VCS Auth Strategy from application: %v" , err )
91
91
}
92
92
key = & auth .PrivateKey
93
93
}
94
94
95
95
if gitURL == "" {
96
- return sdk.Result {}, fmt .Errorf ("Git repository URL is not set. Nothing to perform" )
96
+ return sdk.Result {}, fmt .Errorf ("git repository URL is not set. Nothing to perform" )
97
97
}
98
98
99
99
//If url is not http(s), a key must be found
@@ -150,7 +150,7 @@ func RunGitClone(ctx context.Context, wk workerruntime.Runtime, a sdk.Action, se
150
150
151
151
workdir , err := workerruntime .WorkingDirectory (ctx )
152
152
if err != nil {
153
- return sdk.Result {}, fmt .Errorf ("Unable to find current working directory: %v" , err )
153
+ return sdk.Result {}, fmt .Errorf ("unable to find current working directory: %v" , err )
154
154
}
155
155
156
156
workdirPath := workdir .Name ()
@@ -173,6 +173,8 @@ func gitClone(ctx context.Context, w workerruntime.Runtime, params []sdk.Paramet
173
173
174
174
//git.LogFunc = log.InfoWithoutCtx
175
175
//Perform the git clone
176
+ w .SendLog (ctx , workerruntime .LevelInfo , fmt .Sprintf ("cloning repository %s" , url ))
177
+
176
178
userLogCommand , err := git .Clone (url , basedir , dir , auth , clone , output )
177
179
178
180
w .SendLog (ctx , workerruntime .LevelInfo , userLogCommand )
@@ -186,7 +188,7 @@ func gitClone(ctx context.Context, w workerruntime.Runtime, params []sdk.Paramet
186
188
}
187
189
188
190
if err != nil {
189
- return sdk.Result {}, fmt .Errorf ("Unable to git clone: %s" , err )
191
+ return sdk.Result {}, fmt .Errorf ("unable to git clone: %s" , err )
190
192
}
191
193
192
194
// extract info only if we git clone the same repo as current application linked to the pipeline
@@ -215,7 +217,7 @@ func gitClone(ctx context.Context, w workerruntime.Runtime, params []sdk.Paramet
215
217
}
216
218
217
219
if errTag != nil {
218
- return sdk.Result {}, sdk .WithStack (fmt .Errorf ("Unable to list tag for getting current version: %v" , errTag ))
220
+ return sdk.Result {}, sdk .WithStack (fmt .Errorf ("unable to list tag for getting current version: %v" , errTag ))
219
221
}
220
222
221
223
return sdk.Result {Status : sdk .StatusSuccess , NewVariables : vars }, nil
@@ -277,10 +279,9 @@ func extractInfo(ctx context.Context, w workerruntime.Runtime, basedir, dir stri
277
279
Value : info .Branch ,
278
280
}
279
281
res = append (res , gitBranch )
280
-
281
282
w .SendLog (ctx , workerruntime .LevelInfo , fmt .Sprintf ("git.branch: %s" , info .Branch ))
282
283
} else {
283
- w .SendLog (ctx , workerruntime .LevelInfo , fmt . Sprintf ( "git.branch: [empty]" ) )
284
+ w .SendLog (ctx , workerruntime .LevelInfo , "git.branch: [empty]" )
284
285
}
285
286
} else if branch != "" && branch != "{{.git.branch}}" {
286
287
w .SendLog (ctx , workerruntime .LevelInfo , fmt .Sprintf ("git.branch: %s" , branch ))
0 commit comments