Giter VIP home page Giter VIP logo

gh-label's Introduction

gh label

GitHub CLI extension for issue label management.

Install

Make sure you have version 2.0 or newer of the GitHub CLI installed.

gh extension install heaths/gh-label

Upgrade

The gh extension list command shows if updates are available for extensions. To upgrade, you can use the gh extension upgrade command:

gh extension upgrade heaths/gh-label

# Or upgrade all extensions:
gh extension upgrade --all

Commands

create

Create a label in a repository. You can specify colors with or without a preceeding hash ("#"). If you do not specify a color a random color will be choosen.

gh label create feedback
gh label create p1 --color e00808
gh label create p2 --color "#ffa501" --description "Affects more than a few users"

delete

Delete a label from a repository.

gh label delete p1

edit

Edit a label in a repository. You can specify colors with or without a preceeding hash ("#").

gh label edit general --new-name feedback
gh label edit feedback --color c046ff --description "User feedback"

export

Export labels from the repository to , or stdout if is "-".

gh label export ./labels.csv
gh label export ./labels.json
gh label export --format csv -

import

Import labels into the repository from , or stdin if is "-".

gh label import ./labels.csv
gh label import ./labels.json
gh label import --format csv -

list

List labels in a repository. You can optionally pass a substring to match in the label name or description.

gh label list
gh label list service

License

Licensed under the MIT license.

Portions of this source copied from vilmibm/gh-user-status under the GNU Affero General Public License v3.0.

gh-label's People

Contributors

heaths avatar maxdevjs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gh-label's Issues

Upgrade to Go 1.17

Now that cli/gh-extension-precompile#8 is merged and the v1 tag updated to include the change, again upgrade to Go 1.17 (just since that's what I have installed across my machines so it's more likely code will more likely compile in CIs like locally) and pass it to go_version for the action.

`gh label list` Fails Within Repository

Hi @heaths,
I've recently downloaded your extension and when I tried to list the labels I received the following error,

error: cannot find gh; is it installed? error: exec: "gh": executable file not found in $PATH

However, I am able to use gh normally and gh label --help works. Here is my path which contains gh twice (exported again to try and pix this issue)

/usr/bin/latexmk:/snap/bin/gh:/usr/bin/latexmk:/home/jordan/anaconda3/bin:/home/jordan/anaconda3/condabin:/home/jordan/.opam/default/bin:/home/jordan/.cargo/bin:/home/jordan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:~/Documents/flutter/bin:~/Documents/flutter/bin:/snap/bin/gh

Regards
Jordam

`gh label create` does not work outside of git repository

gh label list works using $GH_REPO, but gh label create exits with an error:

~ 23:55 $ echo $GH_REPO
razzius/dev-env-issues
~ 23:55 $ gh label list | head -3
bash    853A20
bug     d73a4a  Something isn't working
documentation   0075ca  Improvements or additions to documentation
~ 23:55 $ gh label create emacs
Error: failed to create label; error: gh returned error: exit status 1, stderr: unable to expand placeholder in path: fatal: not a git repository (or any of the parent directories): .git
/usr/local/bin/git: exit status 128

Support darwin-arm64

Running gh upgrade --all reports:

[graph]: already up to date
[label]: gh-label unsupported for darwin-arm64. Open an issue: `gh issue create -R heaths/gh-label -t'Support darwin-arm64'`
[markdown-preview]: upgrade complete

... so, raiding this issue!

Installation failed

โžœ gh extension install heaths/gh-label
"label" matches the name of a built-in command

How to fix it?

Edit-Command

This is a nice and useful extension to the github-cli.

I would like to see an edit or update-action which allows me to change the color, name, or description of a label. Just passing arguments for the fields I want to change and leaving the other unchanged seems like the simplest complete solution to me.

Sadly, I do not know go, so I just opened this issue

Add support for secure token storage

Token storage change in latest release of gh

This is a message from the GitHub CLI team, maintainers of gh, writing to inform you that the most recent release of gh contains changes which may affect your extension. The latest release introduces the feature of storing authentication tokens in the system keyring (encrypted storage) instead of in a plain text file.
The keyrings that are supported are:

  • Keychain on macOS

  • GNOME Keyring on Linux (Secret Service dbus interface)

  • Wincred on Windows

This has huge security benefits for the users of our tool and was one of our oldest outstanding issues. Unfortunately this change has the potential to break extensions that rely on utilizing the users authentication token to work.

In order to have continued compatibility with gh there are some actions you, as an extension author, need to take. These actions will depend on the implementation of your extension.

Extensions built in Go using go-gh:

  1. Upgrade your go-gh version to v1.2.1, the latest version.

  2. Verify that in your extension retrieval of the user authentication token is done using the auth.TokenForHost function.

    • If you were previously accessing the authentication token using any other method it will no longer work.
    • Automatic resolution of the authentication token when using the API clients will continue to work without changes.

All other extensions:

  1. Verify that in your extension retrieval of the user authentication token is done by shelling out to the gh auth token command.

    • If you were previously accessing the authentication token using the gh config get command, reading the configuration file directly, or any other methods it will no longer work.

As of right now storing the authentication token in the system keyring is an opt-in feature, but in the near future it will be required and at that point if the changes above are not made then your extension will be broken for all users. If you have any questions/concerns about this change please feel free to open a discussion in the gh repo.

Thanks,
The GitHub CLI Team

Create command does not work

The gh label list command works, but none of the others work. They do not appear to be installed:

> gh label create
Error: unknown command "create" for "label"
Run 'label --help' for usage.

> gh label --help
Usage:
  label [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  list        List labels for the repository matching optional 'label' substring in the name or description

Flags:
  -h, --help              help for label
  -R, --repo OWNER/REPO   Select another repository using the OWNER/REPO format

Use "label [command] --help" for more information about a command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.