No commit activity in last 3 years
No release in over 3 years
Program to export GitHub, GitLab, or Bitbucket pull requests/merge requests and issues to CSV a file. This is forked version of https://github.com/sshaw/export-pull-requests project.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.9
~> 4.1, >= 4.1.3

Runtime

 Project Readme

Export Pull Requests

Export pull requests/merge requests and/or issues to a CSV file.

Supports GitHub, GitLab, and Bitbucket.

Installation

Ruby is required.

With Ruby installed run:

gem install redis # needed to stay under BitBucket rate limit
gem install zz-export-pull-requests

This installs the epr executable.

Usage

usage: epr [options] user/repo1 [user/repo2...]
    -b, --body                       Include the issue/pr body description in the output (GitHub only)
    -c, --creator=USER1,USER2,...    Export PRs created by given username(s); prepend `!' to exclude user
    -e, --endpoint=URL               Endpoint URL for 'enterprise', etc... repositories
    -m, --milestone=WHAT             Export items assigned to the given milestone (GitHub/GitLab only)
    -a, --assignee=USER              Export items assigned to the given user (GitHub/GitLab only)
    -l, --labels=LABEL(S)            Export items with the given label(s) (GitHub/GitLab only)
    -h, --help                       Show this message
    -p, --provider=NAME              Service provider: bitbucket, github, or gitlab; defaults to github
    -s, --state=STATE                Export items in the given state, defaults to open
    -t, --token=TOKEN                API token
    -x, --export=WHAT                What to export: pr, pr_comments (BitBucket only), issues, or all; defaults to all
    -v, --version                    epr version

Config

These can all be set by one of the below methods or via the command line.

Token

The API token can be set by:

  • EPR_TOKEN environment variable
  • epr.token setting in .gitconfig (add via git config --add epr.token <your API token>)
  • github.oauth-token setting in .gitconfig

Default Service

github is the default. You can set a new default via EPR_SERVICE.

Examples

Export open PRs and issues in sshaw/git-link and sshaw/itunes_store_transporter:

epr sshaw/git-link sshaw/itunes_store_transporter > pr.csv

Export open pull request not created by sshaw in padrino/padrino-framework:

epr -x pr -c '!sshaw' padrino/padrino-framework > pr.csv

Export open merge requests from a GitLab project:

epr -x pr -p gitlab gitlab-org/gitlab-ce > pr.csv

Export all issues from a GitLab project:

epr -x issues -p gitlab gitlab-org/gitlab-ce > pr.csv

Service Notes

To connect to a custom/"Enterprise" installation of any of the supported services use the endpoint option (-e)

Bitbucket

You can use app passwords for the API token. Just provide your token info in bitbucket_username:app_password format:

epr -p bitbucket -t bitbucket_username:app_password user/repo1

GitLab

Authentication can be done via a personal access token.

Enterprise editions of GitLab have an issue export feature.

See Also

  • Batch Labels - Add/remove labels in batches to/from GitHub issues and pull requests.

Author

Skye Shaw [skye.shaw AT gmail]

License

Released under the MIT License: www.opensource.org/licenses/MIT


Made by ScreenStaring