Skip to content

Updating of a repo variable returns a Created message instead of Updated message  #8712

@Naedish

Description

@Naedish

Describe the bug

When updating an existing repo variable the return message is Created instead of Updated. This behaviour isn't observed for Environment or Organisation variables, only repo variables.

gh --version
gh version 2.44.1 (2024-02-16)
https://github.com/cli/cli/releases/tag/v2.44.1

Steps to reproduce the behavior

  1. Be inside a git repo in the command line
  2. Create a new variable for the repo with gh set a
  3. Update the variable using gh set a
  4. Return message is ✓ Created variable a for xxx/yyy

If you do the same for an environment level or organisation level variable it correctly returns the Updated response.

Logs

PS C:\Users\Dean\Projects\TEMPO> gh variable list
no variables found
PS C:\Users\Dean\Projects\TEMPO> gh variable list --env devo
no variables found
PS C:\Users\Dean\Projects\TEMPO> gh variable set a
? Paste your variable a

? Paste your variable a

✓ Created variable a for Naedish/TEMPO
PS C:\Users\Dean\Projects\TEMPO> gh variable set a
? Paste your variable a

? Paste your variable a

✓ Created variable a for Naedish/TEMPO
PS C:\Users\Dean\Projects\TEMPO> gh variable set a --env devo
? Paste your variable a

? Paste your variable a

✓ Created variable a for Naedish/TEMPO environment devo
PS C:\Users\Dean\Projects\TEMPO> gh variable set a --env devo
? Paste your variable a

? Paste your variable a

✓ Updated variable a for Naedish/TEMPO environment devo
PS C:\Users\Dean\Projects\TEMPO>
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggh-variablerelating to the gh variable commandhelp wantedContributions welcomep3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions