In case you want to automate batch accpeting Dependabot Pull Requests
Using the GitHub CLI
gh pr list --json number -q .[].number -S author:app/dependabot > prs.txt
for /f %a in (prs.txt) do (gh pr merge -d -r %a)
gh pr list --json number -q .[].number -S author:app/dependabot | xargs gh pr merge -d -r
In case you are using Dependabot with Azure DevOps
Using the Azure CLI
az repos pr list --status active [--creator <build-service-dependabot>] > prs.json
jq .[].pullRequestId prs.json > prs.txt
for /f %a in (prs.txt) do (
az repos pr update --id %a --status completed --delete-source-branch true --transition-work-items true
)
Get all remote branches (not merged yet), match dependabot
-branches using ripgrep and delete
git branch -r --no-merged | rg '(dependabot/.+)' -or '$1' | xargs git push origin -d