Skip to content

Export pull requests and/or issues to a CSV file. Supports GitHub, GitLab, and Bitbucket

Notifications You must be signed in to change notification settings

lucasceballos/export-pull-requests

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 export-pull-requests

This installs the epr executable.

Usage

usage: epr [-bhv] [-e url] [-s state] [-t token] [-c user1,user2...] user/repo1 [user/repo2...]
    -b, --body                       Include the issue/pr body description in the output
    -c, --creator=USER1,USER2,...    Export PRs created by given username(s); prepend `!' to exclude user
    -e, --endpoint=URL               Endpoint URL for 'enterprise', etc... repositories
    -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, 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 HTTP Auth style using: username:app_password.

GitLab

Authentication can be done via a personal access token.

Enterprise editions of GitLab have an issue export feature.

Author

Skye Shaw [skye.shaw AT gmail]

License

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


Made by ScreenStaring

About

Export pull requests and/or issues to a CSV file. Supports GitHub, GitLab, and Bitbucket

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%