Giter Site home page Giter Site logo

github-repo-delete-utility's Introduction

GitHub Repository Deletion Script

This script allows you to delete multiple repositories from your GitHub account using a personal access token (PAT).

Getting Started

1. Generate Personal Access Token (PAT)

To use this script, you'll need to generate a personal access token (PAT) on GitHub. Follow these steps to generate the token:

  1. Navigate to GitHub Settings: Go to the Settings page of your GitHub account.

  2. Access Developer Settings: In the Settings page, scroll down the left sidebar and click on "Developer settings".

  3. Generate New Token: Under Developer settings, click on "Personal access tokens".

  4. Choose Classic Tokens: Click on the second option, "Tokens (classic)".

  5. Generate New Token: Click on the "Generate new token" button.

  6. Provide Token Description: Enter a description for the token.

  7. Select Scopes: Choose the scopes (permissions) for the token. You'll likely need permissions related to repositories, such as repo (Full control of private repositories) and delete_repo (Delete repositories).

  8. Generate Token: Click on the "Generate token" button.

  9. Copy Token: Once the token is generated, copy the token value and store it securely.

  10. Use Token: In your script or application, use this token as the auth parameter when authenticating with the GitHub API.

  11. Keep Token Secure: Treat your personal access token like a password and do not share it with anyone or expose it in public repositories.

2. Installation

To install dependencies, run:

npm install

3. Configuration

After installing the script, you need to create a config.js file with your GitHub personal access token and username. You can use the provided sample.config.js as a template:

  1. Copy sample.config.js to config.js.
  2. Open config.js in a text editor.
  3. Replace GITHUB_PERSONAL_ACCESS_TOKEN with your actual GitHub personal access token.
  4. Replace GITHUB_USERNAME with your GitHub username.
  5. Save the file.

Make sure to keep your personal access token secure and do not share it with anyone or expose it in public repositories.

4. Usage

To delete repositories, run the script:

npm run delete-repos

Additional flags can be used to modify the behavior of the script:

  • -y or --yes: Skips the prompt confirmation before deleting repositories.
npm run delete-repos -- -y
  • --except : Deletes all repositories except those listed in the specified file. Each repository name should be listed on a separate line in the file.
npm run delete-repos -- --except 'github-repo-delete/excluded_repos.txt'

Author

Ankita D.

github-repo-delete-utility's People

Contributors

contentstack-ankitad avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.