- Install node.js.
- Clone to your local.
cd
into the directory.- Run
npm install
- Copy
config.example.js
toconfig.js
and replace the github token with your own Personal Access Token. - (optional) Copy
search.example.yml
tosearch.yml
and replace any example saved searches with your own.
- Run
node index.js
- Choose "New Search"
- The Owner and Repo are the first two parts of the URL. For example, in this case
Lullabot
andgithub-export
respectively. - For the
query
input, use anything that you would use to search for issues in GitHub. For exampleis:open is:pr
- For
fields
, you can specify any fields you know the machine name for. If unsure, sayall
to get all fields, or run the app again and choose "Show Available Fields" from the options menu.
node index.js -o Lullabot -r github-export -q "is:issue is:open" -f "title,html_url" -f issuedump.csv
If you leave any required options empty, the app will prompt you for them.
Run with the --help
flag to see all available options.
Find yourself repeating the same searches over and over? Save the parameters in search.yml
!
# Example saved search. Export all issues from my repo and save it into the 'exports' folder as 'allmystuff.csv'.
MyStuff:
all:
owner: Lullabot
repo: github-export
query: "is:issue"
fields: title,html_url
file: "allmystuff.csv" # optional
then, perform the search by running this command:
node index.js -s MyStuff:all
If you forget any required parameters, the app will ask you for them.
You can also override any saved search settings using the CLI flags.
node index.js -s MyStuff:all -q "is:issue is:open"
In any search, when prompted for the fields you want, say all
and all available field data will be exported. Then you can specify the ones you want in your next search.
Examples:
AllFields:
owner: Lullabot
repo: github-export
query: is:issue is:open label:Example
fields: all
Run node index.js
without any parameters. When prompted, select "Show Available Fields" and the system will show all available fields from an example issue in this repo and save the results to an export file.
- Doesn't pull complex field values (yet), like Users or Labels (See #3)
- Doesn't pull data added via GitHub Projects, like custom fields. (See #4)
Want a quick and easy way to get a dump of GitHub issues into your application? Call this search directly using the .search()
method!
const exporter = new Exporter('MyGitHubPersonlAccessToken');
let issues = [];
issues = await exporter.search({
owner: 'Lullabot',
repo: 'github-export',
query: 'label:Example',
fields: 'title,html_url', // (optional) Defaults to all fields
headerRow: true // (optional) Defaults to false
}).catch(err => {
console.error(err.message);
});
if (issues) {
console.log(issues);
}