Avaliable to clone labels between repositories #122983
-
Select Topic AreaProduct Feedback BodyConfiguration same issues labels in two(or more) repos are troublesome and boring. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
For new repos: Create a repository template that already has all your labels defined. Then, when you create a new repo using that template, the labels will be there. For existing repos: If you wanted to replicate the labels from on repository to another, you could use the rest apis. Do something like this (NOTE: I have not run this code, thanks GitHub Copilot!): Get the labels from the source repo:
Run this shell script to take the labels from the source and create them in the target:
If you prefer, you could also use the GitHub CLI, it makes it a little cleaner:
|
Beta Was this translation helpful? Give feedback.
For new repos:
Create a repository template that already has all your labels defined. Then, when you create a new repo using that template, the labels will be there.
For existing repos:
If you wanted to replicate the labels from on repository to another, you could use the rest apis. Do something like this (NOTE: I have not run this code, thanks GitHub Copilot!):
Get the labels from the source repo:
curl -s -H "Authorization: token your_token" https://api.github.com/repos/source_owner/source_repo/labels > labels.json
Run this shell script to take the labels from the source and create them in the target: