Skip to content

Avaliable to clone labels between repositories #122983

Discussion options

You must be logged in to vote

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:

for row in $(cat labels.json | jq -r '.[] | @base64'); do
    name=$(echo ${row} | base…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@JingHai-Lingyun
Comment options

@mickeygousset
Comment options

@JingHai-Lingyun
Comment options

Answer selected by JingHai-Lingyun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Repositories The core of version-controlled code storage Product Feedback
2 participants