Skip to content

a simple script to export merged PR of an assignee during a period, in python

License

Notifications You must be signed in to change notification settings

vincentporte/export_merged_pull_requests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Export Merged Pull Requests

A Python script to export merged pull requests assigned to a user within a specified time period.

Setup

  1. Copy .env.example to .env and populate it with the required values.
  2. Initialize the virtual environment by running uv sync.

Quick Start

  1. Run the following command to collect merged pull requests for the first quarter of 2025:
   uv run python scripts/collect_pull_requests.py --repository orga/repo --start-date 2025-01-01 --end-date 2025-03-31
  1. The exported pull requests will be available in the data directory.

Legacy Usage

  1. Activate the virtual environment:
source .venv/bin/activate
  1. Execute the script:
python scripts/collect_pull_requests.py --repository orga/repo --start-date 2025-01-01 --end-date 2025-03-31
  1. Retrieve the exported PRs from the data directory.

  2. To run the script with a specific user, use the --user flag:

python scripts/collect_pull_requests.py --repository orga/repo --start-date 2025-01-01 --end-date 2025-03-31 --user <username>
  1. To convert the .md file to .pdf, use the command:
ppandoc data/PRs_<REPO>_<START-DATE>_<END-DATE>.md -o data/PRs_<REPO>_<START-DATE>_<END-DATE>.pdf --pdf-engine=xelatex

test

Run the test suite in virtual env with:

pytest tests/

License

This project is licensed under GNU General Public License v3.0. See the LICENSE file for details.

Next Steps

  • Add CI/CD pipeline for automated testing and deployment.
  • Enhance tests to cover more cases.

About

a simple script to export merged PR of an assignee during a period, in python

Resources

License

Stars

Watchers

Forks

Packages

No packages published