A Python tool to export pull request comments from github repositories. This tool helps developers and teams to easily extract and save PR comments for documentation, analysis, or archival purposes.
- Export pull request comments from github repositories
- Save comments to text files with proper formatting
- Configurable through environment variables
- Easy to set up and use
- Python 3.6 or higher
- GitHub access token with repo permissions
- GitHub repository details
- Clone the repository:
git clone https://github.com/yourusername/PR-CommentExport.git
cd PR-CommentExport
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Copy
.env.example
to.env
and configure your settings:
cp .env.example .env
Edit the .env
file with your GitHub details:
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_REPO_OWNER=owner_username
GITHUB_REPO_NAME=repository_name
GITHUB_PR_NUMBER=pull_request_number
These environment variables are required:
GITHUB_TOKEN
: Your GitHub Personal Access Token with repo accessGITHUB_REPO_OWNER
: The owner/organization of the repositoryGITHUB_REPO_NAME
: The name of the repositoryGITHUB_PR_NUMBER
: The number of the pull request to export comments from
Run the main script:
python export.py
The script will export all PR comments to a text file in the current directory.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.