Today I'm going to show you how you can easily export Issue, Releases, Milestone, Commit History and more from GitHub, using the GitHub Artifact Exporter.
Intro
GitHub Artifact Exporter provides a CLI and a simple GUI for exporting GitHub Issues and related comments based on a date range, and it supports GitHubโs full search syntax, allowing you to filter results based on your search parameters.
The CLI also supports exporting:
- Commits
- Milestones,
- Projects
- Pull requests, including comments
- Releases
And you can export all of that in different formats: JSON, JSON lines, CSV, and Jira-formatted CSV. And of course if you export in CSV, it means that you can open it in Excel. Cool right?
Video
As usual, if you are a visual learner, or simply prefer to watch and listen instead of reading, here you have the video with the whole explanation and demo, which to be fair is much more complete than this post.
Link to the video: https://youtu.be/xYIJLQB1YF4
If you rather prefer reading, well... let's just continue :)
Prerequisites
There are few prerequisites to run the exporter.
Lerna
First of all it is a lerna project, so you need to have lerna installed. If you don't know what lerna is don't worry because I didn't even know it existed until I started looking into the exporter project. Apparently it's a tool for managing JavaScript projects split within multiple repos and packages.
All you need to do is install lerna via npm and then use it to build and run the project as directed from the instructions in the repository.
npm install -g lerna
Yes, you've heard it right... The GitHub Artifact Exporter comes with the sources and you have to build it yourself. We will do it in a moment, and you can find the link to the repo in the video description.
GitHub PAT
Second prerequisite is to generate a Personal Access Token with the "read packages" scope so you can pull from GitHub Package Registry.
Installation
Alright, let's quickly see how to install the tool... or better, build it since it comes with the source code :)
First think we need is the code. Head to the official repo and, download the package in the release.
GUI
To install the GUI, we need to execute the lerna commands to build the whole thing:
lerna exec npm install
lerna link
lerna bootstrap
CLI
The step above builds also the CLI part, and in fact you can go into the /packages/cli/bin
folder and there you will find the cmd executable for it.
But you can also install the CLI standalone using:
npm install @github/github-artifact-exporter-cli
Usage
Alright, now that we have it installed let's see how to use it.
For this, check the video here for the explanation and the demo. (The demo starts at minute 3:40
Like, share and follow me ๐ for more content:
๐ฝ YouTube
โ Buy me a coffee
๐ Patreon
๐ CoderDave.io Website
๐ Merch
๐ฆ๐ป Facebook page
๐ฑโ๐ป GitHub
๐ฒ๐ป Twitter
๐ด๐ป LinkedIn
๐ Podcast