-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gh variable get
command
#9103
Comments
Thanks for the enhancement request. It seems like an obvious addition, I wonder why it wasn't there to begin with. However, no one has asked for it! It looks like in one of the original PRs for the Can you describe your use case a little bit more? It's useful to us to know how people are using the CLI commands to help us understand the bigger picture. |
We are currently building an internal "starter kit" where we use some shell scripts to set up the individual projects. These script store some data in variables (e.g., which Jira projects a repository is connected to) and this info is then used by GitHub Action workflows. It's no problem to set the variables using |
Thanks!
So if I understand correctly there are two outcomes:
That makes sense. I wondered whether |
In theory, I have race conditions, yes. In practice, probably not. Both solutions would be useful. I guess the current lack of a |
Yeh that's my suspicion as well. In the absence of any other obvious reason appearing, this seems like a good addition to me. I'm going to label it |
Ok, I took a stab at it. It's heavily based on the |
I created #9118 as a follow up on this if you're interested in having a look at it I can point you in the right direction but no worries if you're not interested. Thanks! |
Thank you, @williammartin! I wanted to take a look at #9118 today, but I can see @babakks beat me to it. Thank you, @babakks! |
@arnested Sorry, I didn't notice this comment here. I was just looking for |
No need to be sorry, @babakks 😄 I didn't really have the time anyway 😄 |
Describe the feature or problem you’d like to solve
It's currently possible to set a variable using, e.g.,
gh variable set FOO --body=BAR
.And it's possible to list all variables using:
It's not possible, though, to read a single variable using, e.g.,
gh variable get FOO
.It is possible to achieve using:
I'm pretty sure I won't be able to remember that command when I need it. And I'm pretty sure it'll require a lot of brain cycles to read and understand it.
Proposed solution
I propose to add a
gh variable get FOO
.The text was updated successfully, but these errors were encountered: