DEV Community

Cover image for 🏷️ Github CLI v2.9.0 is out : clone labels feature #5452 is here
adriens for opt-nc

Posted on • Updated on

🏷️ Github CLI v2.9.0 is out : clone labels feature #5452 is here

πŸ™‹ Intro

GitHub CLI v2.9.0 is out and brings some nice new features around labels :

Image description

As recently I felt the need (for organizational level reporting) to synchronize labels on distinct repos (see dedicated feedback) :
Image description

, this latest release was the perfect match ❣️

🎞️ The demo

A short video worths a thousand words so here go πŸ‘‡

πŸ“œ Movie script

⚠️ Replace with your account⚠️

clear

# πŸ€” So a new release is avilable for Gtihub Cli ❔
# πŸ‘‰ What's new on v2.9.0... let's find out πŸ‘‡  
gh release view v2.9.0 --repo cli/cli

# 🎁 ... and what is cli/cli #5452 "label clone" feature ❔
gh issue view 5452 --repo cli/cli

# πŸ†— Let's give it a try ❣️

# 1️⃣ Create a master repo 
gh repo create gh-cli-demo-labels-master --public 

# 🏷️ See labels on the newly created repo πŸ‘‡
gh label list --repo adriens/gh-cli-demo-labels-master

# βž• Create a custom label 🦩
gh label create SOMETHING_PINK --description "I love pink things" --color FFC0CB --repo adriens/gh-cli-demo-labels-master

# βœ… And check it has been created  πŸ‘‡
gh label list --repo adriens/gh-cli-demo-labels-master

# πŸ” Look for the newly created label πŸ‘‡
gh label list --repo adriens/gh-cli-demo-labels-master | grep PINK

# βž•  Now, create a new repo...
gh repo create gh-cli-demo-labels-synced --public 

# ... List existing labels on te newly created repo
gh label list --repo adriens/gh-cli-demo-labels-synced

# βœ… Check that the PINK label does not exists
gh label list --repo adriens/gh-cli-demo-labels-synced | grep PINK

# πŸͺ„ Sync labels ✨
gh label clone adriens/gh-cli-demo-labels-master --repo adriens/gh-cli-demo-labels-synced

# πŸ•΅οΈ See if the clone command did work 🀞
gh label list --repo adriens/gh-cli-demo-labels-synced | grep PINK

# πŸŽ† Job done 🀸

# 🧽 Cleanup the mess 🧼
gh repo delete adriens/gh-cli-demo-labels-master --confirm
gh repo delete adriens/gh-cli-demo-labels-synced --confirm

# 🎬 That's all folks
gh repo view cli/cli

# 🌟 Go like it 🌟
gh repo view cli/cli --web
Enter fullscreen mode Exit fullscreen mode

πŸ”– Resources

Top comments (1)

Collapse
 
adriens profile image
adriens