Skip to content

gh extension install --pin <tag> --force ignores pin when extension is already installed #13551

Open

Description

@aovechki

Summary

When an extension is already installed, running:

gh extension install OWNER/REPO --pin <tag> --force

appears to route through upgrade logic and installs latest, instead of honoring the pinned tag.

Environment

  • OS: Linux
  • gh version: 2.89.0 (2026-03-26)
  • Example extension: github/gh-aw

Reproduction

  1. Install an older version:
    gh extension install github/gh-aw --pin v0.74.8
  2. Verify:
    gh extension list
  3. Attempt forced pinned install:
    gh extension install github/gh-aw --pin v0.75.0 --force
  4. Verify:
    gh extension list

Actual Behavior

The command upgrades to latest (for example v0.76.1) and prints upgrade-style output such as:

[aw]: upgraded from v0.74.8 to v0.76.1
✓ Successfully checked extension upgrades

Result: installed version is latest, not the pinned version.

Expected Behavior

When --pin is provided, it should be honored even if --force is also set and the extension is already installed.

Workaround

Removing first, then installing pinned works:

gh extension remove gh-aw
gh extension install github/gh-aw --pin v0.75.0

This correctly installs the pinned version.

Additional Context

This seems to happen because install with --force on an already-installed extension takes the upgrade path, and that path ignores pin for binary extensions (uses latest).

Activity

  1. nicolewhite-msft commented on May 29, 2026

    @nicolewhite-msft

    Another option might be to add a --pin flag to gh extension upgrade?

    gh extension upgrade gh-aw --pin v0.75.0
    
  2. added
    bugSomething isn't working
    gh-extensionrelating to the gh extension command
    priority-2Affects more than a few users but doesn't prevent core functions
    on Jun 5, 2026
  3. beanscg commented on Jun 10, 2026

    @beanscg
  4. added a commit that references this issue on Jul 3, 2026
    1e09cbf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggh-extensionrelating to the gh extension commandpriority-2Affects more than a few users but doesn't prevent core functions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions