Skip to content

Instantly share code, notes, and snippets.

@jeremystretch
Created June 30, 2025 17:43
Show Gist options
  • Select an option

  • Save jeremystretch/8b73eb2217835cd848c857afeadce231 to your computer and use it in GitHub Desktop.

Select an option

Save jeremystretch/8b73eb2217835cd848c857afeadce231 to your computer and use it in GitHub Desktop.
Copy GitHub issue labels from one repository to another
gh api repos/$ORGANIZATION/$SOURCE_REPO/labels --paginate > labels.json
jq -c '.[]' labels.json | while read -r label; do
name=$(echo "$label" | jq -r '.name')
color=$(echo "$label" | jq -r '.color')
description=$(echo "$label" | jq -r '.description')
gh api repos$ORGANIZATION/$TARGET_REPO/labels -f name="$name" -f color="$color" -f description="$description"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment