Delete Source Branch After Merge

This commit is contained in:
6543 2021-05-05 09:34:51 +02:00
parent 5222bde661
commit ebbcdeeb30
Signed by: 6543
GPG Key ID: C99B82E40B027BAE
1 changed files with 6 additions and 0 deletions

View File

@ -152,6 +152,12 @@ func threatRepo(baseBranchRule glob.Glob, client *gitlab.Client, repo *gitlab.Pr
fmt.Printf(" pull '%s' can not be merged: %v\n", pullList[0].WebURL, err)
} else {
fmt.Printf(" pull '%s' got merged successfully\n", pull.WebURL)

if err, _ := client.Branches.DeleteBranch(repo.ID, baseBranch.Name); err != nil {
fmt.Printf(" branch '%s' can not be deleted: %v\n", baseBranch.Name, err)
} else {
fmt.Printf(" branch '%s' successfully deleted\n", baseBranch.Name)
}
}

// since we had a match go to next repo ...