heaths / gh-label

GitHub CLI extension for label management
MIT License
59 stars 5 forks source link

[feature request] Add command to copy all labels from one repo to another #18

Closed micalevisk closed 2 years ago

micalevisk commented 2 years ago

For now, I've used this web app https://micalevisk.github.io/github-label-manager whenever I need do copy all labels from one repository. I think it would be cool if we could this with your gh extension as GitHub doesn't have such feature :)

heaths commented 2 years ago

Yep. Definitely on my todo list. Unfortunately, it'll be slow since we can't do any mass updates of labels, and I'll have to handle both create and update REST calls separately. I've added github/feedback#9593 in hopes of a better way to address this.

heaths commented 2 years ago

I added both export and import commands, such that you can export from one repo, optionally make any modifications you want to, then import into another repository. Not only do I think this is more flexible but avoids some complexity with having to executed commands in rapid succession against two different repos, which can be specified numerous ways including a fixed set of named environment variables. As such, that could also lead to consumer confusion.

Does that seem a reasonable solution to you for this request? I can update the README with examples of using both commands to sync labels from one repo to the other.

heaths commented 2 years ago

I published a new prerelease v0.4.0, which you can upgrade with gh now to try it out:

gh extension upgrade heaths/gh-label
micalevisk commented 2 years ago

Editing the labels before importing them is even better. Thanks!