Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/sshaw/export-pull-requests

Export pull requests and/or issues to a CSV file. Supports GitHub, GitLab, and Bitbucket
https://github.com/sshaw/export-pull-requests

bitbucket csv github github-issues-export gitlab issues pull-requests ruby

Last synced: 2 months ago
JSON representation

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

Lists

README

        

# Export Pull Requests

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

Supports GitHub, GitLab, and Bitbucket.

## Installation

[Ruby](https://www.ruby-lang.org/en/documentation/installation/) is required.
With Ruby installed run:

gem install 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, 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](#usage).

#### Token

The API token can be set by:

* `EPR_TOKEN` environment variable
* `epr.token` setting in `.gitconfig` (add via `git config --add epr.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`).

The provided URL must point the API endpoint, not the user-facing site. For GitHub this is `http(s)://YOUR-SITE/api/v3`.

### Bitbucket

**Due to [various issues with the Bitbucket gem](https://github.com/sshaw/export-pull-requests/issues/26) support for Bitbucket
requires using a Ruby version < 3 and manually installing the Bitbucket library via `gem install bitbucket_rest_api`.**

**Alternatively, on a Ruby version < 3 you can run: gem install export-pull-requests -v=0.3.7**

You can use [app passwords](https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html) 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](https://gitlab.com/profile/personal_access_tokens).

Enterprise editions of GitLab have an [issue export feature](https://docs.gitlab.com/ee/user/project/issues/csv_export.html).

## See Also

- [Batch Labels](https://github.com/sshaw/batchlabels) - 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](http://screenstaring.com)