Skip to content

Instantly share code, notes, and snippets.

@mheadd
Last active November 27, 2019 15:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mheadd/069330b271b3152d163569b948885090 to your computer and use it in GitHub Desktop.
Save mheadd/069330b271b3152d163569b948885090 to your computer and use it in GitHub Desktop.
Fetch closed issues from a Github repo
##!/bin/bash
## The name of the Github account user or org
OWNER=$1
## The name of the repo
REPO=$2
## Append the file with listd of issues
curl -s "https://api.github.com/repos/$OWNER/$REPO/issues?page=1&per_page=100&state=closed" \
| in2csv -f json \
| csvcut -c 10,11,36,76,78 \
> issues.csv
@mheadd
Copy link
Author

mheadd commented Nov 27, 2019

This script requires that csvkit is installed on your computer. If you are on a Mac, try:

sudo pip install csvkit

Once csvkit is installed, download the script and make it executable.

chmod +x path/to/get-issues.sh

Execute it by passing in the name of the user org and repo that you want to extract issues from:

./get-issues.sh {user-name} {repo-name}

The resultant csv file can then be uploaded to Google sheets and sorted by date

@mheadd
Copy link
Author

mheadd commented Nov 27, 2019

Sample output (using mheadd and civicbot params:

title,user/login,state,created_at,closed_at
"When flight number not found, exception tossed.",mheadd,closed,2016-03-19T21:12:50+00:00,2016-03-19T21:13:07+00:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment