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
gh release ls -L 100 --json name > releases.json
jq .[].name releases.json > releases.txt
# remove quotes and unneeded release versions (grep!)
for /f %a in (releases.txt) do (
gh release delete -y --cleanup-tag %a
)