@@ -174,7 +174,10 @@ func (gr *Runner) LoadRemoteTags(
174
174
_ , err = gr .run (noHarmDone , "fetch" , "-t" , string (remoteUpstream ), "master" )
175
175
if err != nil {
176
176
// Handle if repo is not a fork
177
- gr .run (noHarmDone , "fetch" , "-t" , "master" )
177
+ _ , err = gr .run (noHarmDone , "fetch" , "-t" , "master" )
178
+ if err != nil {
179
+ _ = fmt .Errorf ("failed to fetch tags from master" )
180
+ }
178
181
}
179
182
180
183
gr .comment ("loading remote tags" )
@@ -364,16 +367,16 @@ func (gr *Runner) GetLatestTag(releaseBranch string) (string, error) {
364
367
// Assuming release branch has this format: release-path/to/module-vX.Y.Z
365
368
// and each release branch maintains tags, extract version from latest `releaseBranch`
366
369
gr .comment ("extract version from latest release branch" )
367
- filteredBranchList , err := gr .run (noHarmDone , "branch" , "-a" , "--list" , "*" + string ( releaseBranch ) + "*" , "--sort=-committerdate" )
370
+ filteredBranchList , err := gr .run (noHarmDone , "branch" , "-a" , "--list" , "*" + releaseBranch + "*" , "--sort=-committerdate" )
368
371
if len (filteredBranchList ) < 1 {
369
- fmt .Errorf ("latest tag not found for %s" , releaseBranch )
372
+ _ = fmt .Errorf ("latest tag not found for %s" , releaseBranch )
370
373
return "" , err
371
374
}
372
375
newestBranch := strings .Split (strings .ReplaceAll (filteredBranchList , "\r \n " , "\n " ), "\n " )
373
376
split := strings .Split (newestBranch [0 ], "-" )
374
377
latestTag = split [len (split )- 1 ]
375
378
if err != nil {
376
- fmt .Errorf ("error getting latest tag for %s: %q " , releaseBranch , err . Error () )
379
+ _ = fmt .Errorf ("error getting latest tag for %s" , releaseBranch )
377
380
}
378
381
379
382
return latestTag , nil
0 commit comments