This Python tool is designed to manage GitHub repositories. It automates the process of copying milestones and issues from one repository to another.
- Get Organization Repositories: Fetches all repositories under a specific organization.
- Get User Repository: Retrieves a specific repository's details.
- Get Repository Issues and Milestones: Collects all issues and milestones associated with a specific repository.
- Check for Existing Elements: Checks for the existence of milestones and issues to avoid duplication.
- Post Requests: Ability to post new milestones and issues to a repository.
Before you begin, ensure you have Python installed on your machine. Then, follow these steps:
- Clone the repository:
git clone https://github.com/AI-Assistant/issue_copy.git)https://github.com/AI-Assistant/issue_copy.git
- Navigate to the project directory:
cd [PROJECT_DIRECTORY]
- Install required packages:
pip install virtualenv
Create virtual enviorment:
virtualenv venv
Activate virtual enviorment:
.\venv\Scripts\activate
Install requirements:
pip install -r requirements.txt
- Set up your GitHub API credentials in a creds.py file:
api_key = "YOUR_GITHUB_API_KEY"
- Edit the 'main' function in the script to specify the source and target repositories for copying milestones and issues.
#Get requests
organisation_name = "ORGANISATION" #Name of the organisation
org_repo_get = "RepoWithIssues" #Name of the repository to copy from
#Post requests
org_repo_post = "RepoWithoutIssues" #Name of the repository to copy to
- Run the script.