This script automates the process of setting GitHub repositories to private. You can customize the keyword targeting logic to match your preferences for finding repositories.
- Language: JavaScript
- Runtime: Node.js
- Dependencies: Axios
- API: Github
- Install Node.js: Ensure you have Node.js installed on your system.
- Clone the Repository: Clone this repository to your local machine.
- Install Dependencies: Run
npm install
to install the required Axios package. - Set Up Keyword Logic: Open the script and locate the section where the keyword targeting logic is defined. You can customize it to match your criteria for identifying repositories to privatize. For example, change the logic from
startsWith('WK') || startsWith('wk')
to your preferred condition. - Set Up Authentication: Replace
'your_github_username'
and'your_personal_access_token'
in the script with your actual GitHub username and personal access token. Ensure the token hasrepo
scope permissions. - Run the Script: Execute the script using the command
node script.js
. - Caution: Test the script with a few repositories first and use it responsibly. Ensure compliance with GitHub's terms of service.