{"id":18941518,"url":"https://github.com/mchmarny/gh2csv","last_synced_at":"2026-04-18T13:33:47.908Z","repository":{"id":45480531,"uuid":"513681347","full_name":"mchmarny/gh2csv","owner":"mchmarny","description":"Collection of scripts to export GitHub data into CSV","archived":false,"fork":false,"pushed_at":"2022-08-03T18:31:52.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-07T02:06:43.416Z","etag":null,"topics":["api","bash","csv","events","export","issue","pr","repository"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mchmarny.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-13T21:52:38.000Z","updated_at":"2023-10-12T21:14:38.000Z","dependencies_parsed_at":"2022-07-15T06:30:31.328Z","dependency_job_id":null,"html_url":"https://github.com/mchmarny/gh2csv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mchmarny/gh2csv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fgh2csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fgh2csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fgh2csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fgh2csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mchmarny","download_url":"https://codeload.github.com/mchmarny/gh2csv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fgh2csv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31971488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bash","csv","events","export","issue","pr","repository"],"created_at":"2024-11-08T12:28:22.600Z","updated_at":"2026-04-18T13:33:47.876Z","avatar_url":"https://github.com/mchmarny.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gh2csv\n\nCollection of scripts to export GitHub data into CSV\n\n* Repos in an Organization\n* PRs and PR Comments for a given Repo\n* Issues and Issues Comments for a given Repo\n* Contributors for a given Repo \n* Events for a given Repo \n\n\u003e Note, the provided PR, PR Comments, Issues, and Issue Comments export only the basic events, you can alter the fields names to include additional data needed for your use-case. \n\n## Prerequisites \n\n* [Personal GitHub access token](https://github.com/settings/tokens) \n* [jq command-line](https://stedolan.github.io/jq/)\n\n## Setup\n\nExporting your GitHub token as environment variables\n\n```shell\nexport GITHUB_ACCESS_TOKEN=\"your-token-here\"\n```\n\n## Export\n\n\u003e Each one of the below scripts uses paging to export all of the data from the inception of that repo. Depending on the size of your repo, that may take a while. You can experiment with the starting page number in each script to start with a more recent records. \n\n### Org Repos \n\n```shell\nbin/repo org_name\n```\n\nhttps://docs.github.com/en/rest/repos/repos\n\nOutputs CSV file (repo-`org_name`.csv) containing: \n\n* `repo` - name of the repo \n* `org` - organization name\n* `url` - fully qualified URL of the repo in GitHub\n* `home` - homepage from repo settings\n* `lang` - language from repo settings \n* `license` - the type of of license used in the repo (e.g. apache-2.0)\n* `update` - last update date (yyy-MM-dd)\n* `desc` - repo description from settings \n\n### PRs\n\n```shell\nbin/pr [org_name] [repo_name]\n```\n\nhttps://docs.github.com/en/rest/pulls/pulls\n\nOutputs CSV file (pr-`org_name`-`repo-name`.csv) containing: \n\n* `id` - numeric identifier for that PR\n* `number` - sequential number of that PR\n* `state` - current state fo that PR (open, closed)\n* `repo` - name of the repo \n* `org` - organization name\n* `user` - username who submitted the PR\n* `created` - ISO timestamp of when the PR was created\n* `updated` - ISO timestamp of when the PR was updated\n* `merged` - ISO timestamp of when the PR was merged\n* `closed` - ISO timestamp of when the PR was closed\n* `title` - PR tile at that time \n* `labels` - Comma-separated list of labels\n\nThe `pr` command also exports PR Reviews for each one of the PRs into CSV file (prr-`org_name`-`repo-name`.csv) containing: \n\nhttps://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request\n\n* `id` - numeric identifier for that PR review \n* `number` - number of the PR\n* `state` - current state fo that PR review\n* `repo` - name of the repo \n* `org` - organization name\n* `user` - username who submitted the PR review\n* `submitted` - ISO timestamp of that PR review\n* `association` - author association (CONTRIBUTOR, MEMBER etc) \n\n### PR Comments \n\n```shell\nbin/prc [org_name] [repo_name]\n```\n\nhttps://docs.github.com/en/rest/pulls/comments#list-review-comments-in-a-repository\n\nOutputs CSV file (prc-`org_name`-`repo-name`.csv) containing: \n\n* `id` - numeric identifier for that PR comment\n* `number` - number of the PR\n* `review_id` - request review ID\n* `in_reply_to_id` - numeric identifier for the PR\n* `position` - order of the comment in the context of the PR\n* `repo` - name of the repo \n* `org` - organization name\n* `author` - username who made the PR comment\n* `association` - author association (CONTRIBUTOR, MEMBER etc) \n* `created_at` - comment creation timestamp \n* `updated_at` - comment update timestamp\n\n### Issues \n\n```shell\nbin/issue [org_name] [repo_name]\n```\n\nhttps://docs.github.com/en/rest/issues/issues#list-repository-issues\n\nOutputs CSV file (issue-`org_name`-`repo-name`.csv) containing: \n\n* `id` - numeric identifier for that issue\n* `number` - number of the issue\n* `state` - current state fo that PR review\n* `repo` - name of the repo \n* `org` - organization name\n* `author` - username who created the issue\n* `created` - ISO timestamp of when the issue was created\n* `closed` - ISO timestamp of when the issue was closed\n* `title` - PR tile at that time \n* `labels` - Comma-separated list of labels\n\n\n### Issue Comments \n\n```shell\nbin/issuec [org_name] [repo_name]\n```\n\nhttps://docs.github.com/en/rest/issues/comments#list-issue-comments-for-a-repository\n\nOutputs CSV file (issuec-`org_name`-`repo-name`.csv) containing: \n\n* `id` - numeric identifier for that issue comment\n* `number` - number of the issues \n* `repo` - name of the repo \n* `org` - organization name\n* `author` - username who made the issue comment \n* `updated` - ISO timestamp of the issue comment was last updated\n* `association` - comment author association (role)\n\n### Contributors \n\n```shell\nbin/contrib [org_name] [repo_name]\n```\n\nhttps://docs.github.com/en/rest/repos/repos#list-repository-contributors\n\nOutputs CSV file (contrib-`org_name`-`repo-name`.csv) containing: \n\n* `id` - numeric identifier for that issue comment\n* `repo` - name of the repo \n* `org` - organization name\n* `user` - username who made the issue comment \n* `admin` - whether the user is a repo admin\n* `num` - number of contributions to this repo made by that user\n\n### Events \n\n\u003e Note: Only events created within the past 90 days will be included in timelines.\n\n```shell\nbin/event \n[org_name] [repo_name]\n```\n\nhttps://docs.github.com/en/rest/activity/events\n\nOutputs CSV file (event-`org_name`-`repo-name`.csv) containing: \n\n* `id` - numeric identifier for that event\n* `repo` - name of the repo \n* `org` - organization name\n* `user` - the actor (user) that caused that event\n* `type` - the type of the event (e.g. `PushEvent`)\n* `time` - ANSI timestamp of this event\n\n\n## Disclaimer\n\nThis is my personal project and it does not represent my employer. I take no responsibility for issues caused by this code. I do my best to ensure that everything wor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmchmarny%2Fgh2csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmchmarny%2Fgh2csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmchmarny%2Fgh2csv/lists"}