Skip to content

Instantly share code, notes, and snippets.

@nitrocode
Created June 2, 2022 16:43
Show Gist options
  • Select an option

  • Save nitrocode/a988ae466a58f40cadda0677380751b4 to your computer and use it in GitHub Desktop.

Select an option

Save nitrocode/a988ae466a58f40cadda0677380751b4 to your computer and use it in GitHub Desktop.
Close configure renovatebot prs

Close configure renovatebot prs

After enabling renovatebot on an org for the first time, it doesn't seem like there is a way to prevent opening a PR in every repo.

Using the gh cli, we can retrieve every repo, collect the PR number associated with the new PR, and close each one until we're ready to configure each.

ORG=myorg

gh repo list $ORG -L 400 --json name --jq '.[].name' > repo-list.text

cat repo-list.txt | while read repo; do \
  echo gh pr close -R $ORG/$repo $(gh pr list -R $ORG/$repo --json title,number --jq '.[] | select(.title == "Configure Renovate") | .number')
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment