{"id":15903686,"url":"https://github.com/e3v3a/gh-missue","last_synced_at":"2025-03-20T20:30:50.363Z","repository":{"id":31767551,"uuid":"128574749","full_name":"E3V3A/gh-missue","owner":"E3V3A","description":"A complete GitHub issue migration CLI tool written in Ruby -- Migrate Like a Boss!","archived":false,"fork":false,"pushed_at":"2024-07-03T09:15:10.000Z","size":100,"stargazers_count":13,"open_issues_count":8,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T19:41:09.561Z","etag":null,"topics":["docopt","github-api","github-issues-migrate","github-labels","octokit-rb","ruby","ruby-cli"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/E3V3A.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-07T22:45:09.000Z","updated_at":"2025-02-01T18:55:36.000Z","dependencies_parsed_at":"2024-10-28T08:13:40.698Z","dependency_job_id":null,"html_url":"https://github.com/E3V3A/gh-missue","commit_stats":{"total_commits":17,"total_committers":3,"mean_commits":5.666666666666667,"dds":0.4117647058823529,"last_synced_commit":"75c761f6ff433803de5bf3706ddf4133f3592c59"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E3V3A%2Fgh-missue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E3V3A%2Fgh-missue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E3V3A%2Fgh-missue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E3V3A%2Fgh-missue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/E3V3A","download_url":"https://codeload.github.com/E3V3A/gh-missue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244685439,"owners_count":20493269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["docopt","github-api","github-issues-migrate","github-labels","octokit-rb","ruby","ruby-cli"],"created_at":"2024-10-06T12:03:45.494Z","updated_at":"2025-03-20T20:30:50.067Z","avatar_url":"https://github.com/E3V3A.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"### gh-missue -- Migrate Like a Boss!\n\n[![Gem Version](https://badge.fury.io/rb/missue.svg)](https://badge.fury.io/rb/missue \"Last Uploaded Gem Version\")\n[![GitHub last commit](https://img.shields.io/github/last-commit/E3V3A/gh-missue.svg)](https://github.com/E3V3A/gh-missue \"Last commit time/day\")\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/E3V3A/gh-missue/graphs/commit-activity \"Is this repo maintained?\")\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/E3V3A/gh-missue.svg)](http://isitmaintained.com//project/E3V3A/gh-missue \"Average time to resolve an issue\")\n\n\nA complete GitHub issue migration CLI tool written in Ruby.\n\n\n---\n\n**Q:** *What does `gh-missue` do?*\n\nThe primary use is for migrating selected issues from any one repository to another.\nBut it can do much more. You can also:\n\n- Migrate *issues*, their labels and their comments in correct order.\n- `WIP` Migrate originally *closed* issues as *closed* **or** *opened*.\n- List any/all issues in any puplic repository\n- List or migrate only issues selected by their *status*: `[all, open, closed]`\n- Migrate issues selected by their issue *numbers*, like `1,5-7,12`\n- List all available issue *labels* for any repository\n- List all repos R/W access availability info using your current access token.\n- Copy all available issue *labels* for any repository, including: `name, color, description`.\n- Use 2 different types of GitHub authentication: (*none, OAuth2 token*)  \n  (The GitHub Authentication API has discontinued allowing the use of *username/password*.)\n- Test your current GitHub request status showing your: *rate limit, remaining requests, quota refresh time*.\n- Test your authentication token\n\n\n**Q:** *What does it **not** do?*\n\n- Does not close issues on source repository after move\n- Does not copy time-stamps. The new time is when the issue was moved.\n- Does not copy issue-author. You will be the new author of all moved issues.\n- Does not copy comment-authors. You will be the new author of all moved issue comments.\n- Does not copy PR's. (But script can be easily modified to do so.)\n- Does not replace the highly useful GitHub CLI tools [`gh`]() and [`hub`]().\n\n\n**Q:** *Why is this needed?*\n\nSometimes, the structure of your project changes so drastically that it would break your repository.\nYou need an easy way to start from scratch and just commit everything to a new repository.\nBut, you've got all these valuable issues in the old repository on Github. Unfortunately, the new `gh` \ntool only copies (*transfer*) one issue at the time, and with no additional control. \n\nFor any GitHub CLI usage, it is highly recommended to also install either [`gh`](https://cli.github.com/) or [`hub`](https://hub.github.com/).\nBoth these tools allow you to do native GitHub Pull Requests.\n\n\u003cdetails\u003e\n\u003csummary\u003eClickMe! How to do a PR from CLI\u003c/summary\u003e\n\nThere are 3 different ways to issue a native GitHub PR, depending on `gh` or `hub`.\n\n* Using `curl` with the [API](https://docs.github.com/en/rest/reference/pulls#create-a-pull-request)\n* Using [gh](https://cli.github.com/manual/gh_pr_create)\n* Using [hub](https://hub.github.com/hub-pull-request.1.html)\n\n\n```bash\n#------------------------------------------------\n# Using 'curl'\n#------------------------------------------------\ncurl -X POST -H \"Accept: application/vnd.github.v3+json\" \\\n  https://api.github.com/repos/octocat/hello-world/pulls \\\n  -d '{\"head\":\"head\",\"base\":\"base\"}'\n\n#------------------------------------------------\n# Using 'gh' CLI\n#------------------------------------------------\n\n# Doing a simple PR using gh: \ngh pr create --title \"PR Title\" --body \"PR Body\"\n\n# To autofill the title and body of a pull request from your commits:\ngh pr create --fill\n\n# To specify branches\n# where: \n#   -B, --base \u003cbranch\u003e     : The branch into which you want your code merged\n#   -H, --head \u003cbranch\u003e     : The branch that contains commits for your pull request (default: current branch)\ngh pr create --base develop --head MYUSER:my-branch\n\n#------------------------------------------------\n# Using 'hub' CLI\n#------------------------------------------------\n# open a pull request for the branch you've just pushed\nhub pull-request\n\n# specify title and body\nhub pull-request -m \"PR Title\" -m \"PR Body\"\n\n#  creates a pull request with explicit base and head branches\nhub pull-request --base OWNER:master --head MYUSER:my-branch\n\n# open a pull request with title \u0026 body from a file\nhub pull-request --copy -F prepared-message.md\n\n```\n\n\u003c/details\u003e\n\n\n**Q:** *Why are you using Ruby?*\n\nI have never used Ryby until a few evenings ago. I came across an old library to migrate issues on github. \nHowever, it was half broken and extremely limited. But using a library sucked and I wanted a proper CLI \nthat could handle large request rates. I decided to hack into it. Ruby is a nice and suprisingly robust \nlanguage and it is still alive. Not surprsingly it is used by GitHub themselves.\n\nYou can read more about `Why Ruby isn't dead`: [here](https://www.engineyard.com/blog/ruby-still-isnt-dead) and \n[here](https://expertise.jetruby.com/is-ruby-on-rails-dead-2018-edition-407a618dab3a) and \n[here](https://www.tiobe.com/tiobe-index/ruby/).\n\n\n**Q:** *Will I continue to support this tool?*\n\nSure, if it is broken, but I will not spend any more time for new features. So if you wanna add something \nplease send me a PR.\n\n---\n\n#### Screenshots! \n\n![Full](./docs/screen1.png \"gh-missue like a boss!\")  \n\u003csub\u003e(FFS always include a screenshot in your GitHub repo!)\u003c/sub\u003e\n \n![Full](./docs/screen2.png \"Linked and labelled issue copies!\")  \n![Full](./docs/screen3.png \"GitHub Rate Limits!\")\n\n\n---\n\n### Dependencies\n\nThis tool depends on:\n\n1. [docopt](https://github.com/docopt/docopt.rb/)  -- For amazingly cool command line option handling\n2. [octokit](https://github.com/octokit/octokit.rb/) -- For GitHub API access\n\n\n### Installation \n\n**Automatic** install:\n\nWe are now in the public repo, under [`missue`](https://rubygems.org/gems/missue).\n\n`gem install missue`\n\n\n**Manual** install:\n\n1. To make this run, you need to:  \n   (a) Have Ruby installed.  \n       You can Manually install the `WITHOUT DEVKIT` version of Ruby from [here](https://rubyinstaller.org/downloads/), or use:  \n       `winget install ruby`  \n   (b) `gem install octokit`  \n   (c) `gem install docopt`  \n   (d) Clone this repo:  \n       `git clone https://github.com/E3V3A/gh-missue.git`\n\n2. You also **have to** create a personal authentication token for your GitHub\n   account. This is needed to be able to push the new issues and labels into \n   your own repos. It also avoid you getting rate-limited by a large number \n   of requests in short time. Learn how to do this [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).\n\n3. Run and test the app with:  \n\n```Ruby\n# check version:\nruby.exe -v\n\n# Set your GITHUB_OAUTH_TOKEN as an environment variable (here in Powershell)\n$env:GITHUB_OAUTH_TOKEN = 'YOUR_40_CHAR_OATH2_TOKEN'\n\n# List the current open issues (and labels) for this repo:\nruby.exe .\\missue.rb -l open \"YOUR_40_CHAR_OATH2_TOKEN\" \"E3V3A/gh-missue\"\n\n# Same as above, but with some more Warnings \u0026 Debug output:\nruby.exe -W2 .\\missue.rb -d -l open \"YOUR_40_CHAR_OATH2_TOKEN\" \"E3V3A/gh-missue\"\n\n# Check your current gitHub API Rate Limits:\nruby.exe .\\missue.rb -r \"YOUR_40_CHAR_OATH2_TOKEN\"\n```\n\n### Usage\n\n\u003cdetails\u003e\n\u003csummary\u003eClick To See Usage!\u003c/summary\u003e\n\n```\n$ ruby.exe .\\bin\\missue.rb -h\n\nDescription:\n\n    gh-missue is a Ruby program that bulk migrate issues from one github repository to another.\n    Please note that you can only migrate issues to your own repo, unless you have an OAuth2\n    authentication token. You can also list all the open or closed issues and PR's along with\n    the colored labels. It also include the original author's name and URL of the issues copied.\n\n  Usage:\n        missue.rb [-c | -n \u003cilist\u003e | -t \u003citype\u003e] \u003csource_repo\u003e \u003ctarget_repo\u003e\n        missue.rb [-c | -n \u003cilist\u003e | -t \u003citype\u003e] \u003coauth2_token\u003e \u003csource_repo\u003e \u003ctarget_repo\u003e\n        missue.rb [-c | -n \u003cilist\u003e | -t \u003citype\u003e] \u003cusername\u003e \u003cpassword\u003e \u003csource_repo\u003e \u003ctarget_repo\u003e\n        missue.rb [-d] -l \u003citype\u003e [\u003coauth2_token\u003e] \u003crepo\u003e\n        missue.rb -n \u003cilist\u003e\n        missue.rb -t \u003citype\u003e\n        missue.rb [-d] -r [\u003coauth2_token\u003e]\n        missue.rb -d\n        missue.rb -v\n        missue.rb -h\n\n  Options:\n\n        -c                  - only copy all issue labels from \u003csource\u003e to \u003ctarget\u003e repos, including name, color and description\n        -l \u003citype\u003e \u003crepo\u003e   - list available issues of type \u003citype\u003e (all,open,closed) and all labels in repository \u003crepo\u003e\n        -t \u003citype\u003e          - specify what type (all,open,closed) of issues to migrate. [default: open]\n        -r                  - show current rate limit and authentication method for your IP\n        -d                  - show debug info with full option list, raw requests \u0026 responses etc.\n        -n \u003cilist\u003e          - only migrate issues with comma separated numbers given by the list. Can include a range.\n        -h, --help          - show this help message and exit\n        -v, --version       - show version and exit\n\n  Examples:\n\n        missue.rb -r\n        missue.rb -l open E3V3A/gh-missue\n        missue.rb -t closed \"E3V3A/TESTO\" \"USERNAME/REPO\"\n        missue.rb -n 1,4-5 \"E3V3A/TESTO\" \"USERNAME/REPO\"\n\n  Dependencies:\n        missue.rb depends on the following gem packages: octokit, docopt.\n\n  Bugs or Issues?\n        Please report bugs or issues here:\n        https://github.com/E3V3A/gh-missue\n\n```\n\n\u003c/details\u003e\n\n\n---\n\n### How to Run\n\nThere are several ways to run this tool. Please refer to the built-in help for details. \nTo show help, use the command option `-h`,  like this: `./gh-missue.rb -h`.\n\nTo copy all the **open** issues from one repository (`\u003csource_repo\u003e`) to another (`\u003ctarget_repo\u003e`):\n\n1. If you want your issues to also copy the issue labels and including the `name, color, description` tags,  \n   you have to make sure the target repo does not already have any issue labels. If it does,  \n   you need to remove them first, using the github web page under *labels* settings.\n2. First copy **all** the issue labels with:  \n   `./gh-missue.rb -c \u003csource_repo\u003e \u003ctarget_repo\u003e`\n3. Then copy all the *open* issues with:  \n   `./gh-missue.rb -t open \u003csource_repo\u003e \u003ctarget_repo\u003e`\n\n\n* If you omit creating all labels, the individual issue labels used, will still be created, but without color or description.\n* If you hit a rate limit, you will need to insert your [personal access token](https://github.com/settings/tokens), before `\u003csource_repo\u003e`.  \nYou can check your current rate limit with: `./gh-missue.rb -r`\n\n\n---\n\n#### Bugs and Warnings\n\n* :red_circle: If you need to copy more than 30 issues/hour, you will need to create a personal access token.  \n  (Because the unauthenticated request limit is 60, and each copy operation need 2 requests.)\n\n* If you are only migrating *labels* (with the `-c` option), make sure the labels doesn't already exist\nin the target repo, or you will have a failure. I.e. there are some default labels, that you need\nto remove from your target repo!\n\n* :information_source: For other bugs, issues, details and updates, please refer to the\n[issue tracker](https://github.com/E3V3A/gh-missue/issues).\n\n\n#### Contribution\n\nFeel free to post issues and PR's related to this tool.\nFeel free to fork, break, fix and contribute. Enjoy!\n\n---\n\n**References:**\n\n* [Ruby in 20 minutes](https://www.ruby-lang.org/en/documentation/quickstart/)\n* [Installing Ruby on Rail on RPi3](http://jeanbrito.com/2017/01/23/installing-ruby2-4-on-rails5-environment-on-raspberry-pi-3/)\n* [How to write a Gemfile](https://collectiveidea.com/blog/archives/2014/09/17/how-we-write-a-gemfile)\n* The GitHub CLI tool [`gh`](https://github.com/cli/cli)\n* The GitHub CLI tool [`hub`](https://github.com/github/hub)\n\n\n**Essential GitHub API documents:**\n\n\n[1] https://developer.github.com/v3/issues/  \n[2] https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting  \n[3] https://docs.github.com/en/rest/overview/media-types#request-specific-version  \n[4] Some ideas for [Labels-used-for-issues](https://github.com/dotnet/roslyn/wiki/Labels-used-for-issues)  \n\n\n---\n\n#### Credits\n\nMost grateful thanks to:\n* [Xanewok](https://github.com/Xanewok/) - for adding original author \u0026 issue link functionality \n\n---\n\n#### License\n\n[![GitHub license](https://img.shields.io/github/license/E3V3A/gh-missue.svg)](https://github.com/E3V3A/gh-missue/blob/master/LICENSE)  \nA license to :sparkling_heart:!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe3v3a%2Fgh-missue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe3v3a%2Fgh-missue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe3v3a%2Fgh-missue/lists"}