An open API service indexing awesome lists of open source software.

https://github.com/jeromewolff/github-organization-repo-bulk-delete

PowerShell Script to bulk delete multiple repositories in a organization via Fine-grained Personal Access Token
https://github.com/jeromewolff/github-organization-repo-bulk-delete

github-token powershell powershell-script powershell7

Last synced: 6 months ago
JSON representation

PowerShell Script to bulk delete multiple repositories in a organization via Fine-grained Personal Access Token

Awesome Lists containing this project

README

          

# GitHub Repository Deletion Tool

A PowerShell script to delete multiple GitHub repositories within an organization based on a specific prefix. This tool utilizes a fine-grained personal access token (PAT) for authentication and interacts with the GitHub REST API.

## Features

- Deletes repositories with a specified prefix.
- Works for repositories within an organization.
- Supports GitHub's fine-grained access token for secure and scoped authentication.
- Handles paginated results for organizations with many repositories.

## Prerequisites

1. **GitHub Token**: A fine-grained personal access token with the `delete_repo` permission scoped to the target organization.
2. **PowerShell**: PowerShell 7 or higher is recommended.

## Usage

### 1. Clone or Download the Script
Save the script as `Delete-GitHubRepos.ps1`.

### 2. Run the Script
Execute the script in PowerShell with the following parameters:

```powershell
.\Delete-GitHubRepos.ps1 -GitHubToken "" -OrganizationName "" -RepoPrefix ""
```