diff --git a/eng/common/scripts/Delete-RemoteBranches.ps1 b/eng/common/scripts/Delete-RemoteBranches.ps1 index 0dd20150589..da55471ef25 100644 --- a/eng/common/scripts/Delete-RemoteBranches.ps1 +++ b/eng/common/scripts/Delete-RemoteBranches.ps1 @@ -30,15 +30,11 @@ foreach ($branch in $branches) exit 1 } - "bvranch $branch" - "PR COunt $($pullRequests.Count)" - - if ($pullRequests.Count -eq 0) { LogDebug "Branch [ $branchName ] in repo [ $RepoName ] has no associated Pull Request. Deleting Branch" try{ - Delete-References -RepoOwner $RepoOwner -RepoName $RepoName -Ref ($branch.Remove(0,5)) + Delete-References -RepoOwner $RepoOwner -RepoName $RepoName -Ref ($branch.Remove(0,5)) -AuthToken $AuthToken } catch { LogError "Delete-References failed with exception:`n$_" diff --git a/eng/pipelines/templates/jobs/tools-cleanup.yml b/eng/pipelines/templates/jobs/tools-cleanup.yml index a7bb15e956c..88be953e580 100644 --- a/eng/pipelines/templates/jobs/tools-cleanup.yml +++ b/eng/pipelines/templates/jobs/tools-cleanup.yml @@ -26,7 +26,7 @@ jobs: workingDirectory: $(System.DefaultWorkingDirectory) filePath: $(System.DefaultWorkingDirectory)/eng/common/scripts/Delete-RemoteBranches.ps1 arguments: > + -RepoOwner "Azure" -RepoName ${{ repo }} -BranchPrefix "sync-eng/common-" - -WorkingDirectory $(System.DefaultWorkingDirectory) -AuthToken $(azuresdk-github-pat) \ No newline at end of file