Skip to content

Instantly share code, notes, and snippets.

@devinschumacher
Created October 19, 2024 00:47
Show Gist options
  • Select an option

  • Save devinschumacher/8410599cacfe26f4b3235cda7e7bc87e to your computer and use it in GitHub Desktop.

Select an option

Save devinschumacher/8410599cacfe26f4b3235cda7e7bc87e to your computer and use it in GitHub Desktop.
How to list all repositories in your Github organization and close all their issues using the Github CLI
title How to list all repositories in your Github organization and close all their issues using the Github CLI

How to list all repositories in your Github organization and close all their issues using the Github CLI

  1. List all repositories in the organization:
gh repo list serp-archive --json name --jq '.[].name'
  1. For each repository, list all open issues and close them. You can run the following command for each repository manually:
gh issue list --repo <org>/<repo> --state open --json number --jq '.[].number' | xargs -I{} gh issue close {} --repo <org>/<repo>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment