Skip to content

WINGET_TOKEN expired — rotate to unblock winget publish for v2.0.0+ #237

Closed

Description

@thomas-stegemann

Problem

During the v2.0.0 release publish on 2026-06-21, the winget workflow failed at the wingetcreate submit step:

Manifest validation succeeded with warnings.
Manifest Warning: Unknown field. [Documentation]
Warning: Using the --token argument may result in the token being logged. Consider an alternative approach https://aka.ms/winget-create-token.
Token was invalid. Please generate a new GitHub token and try again.

The manifest itself is fine — wingetcreate validated it. The fork-and-PR step against microsoft/winget-pkgs failed because the PAT in repo secret WINGET_TOKEN is expired or revoked.

A rerun on the same release was tried; same failure. So Bowire 2.0.0 is on Chocolatey but not yet on the Microsoft Store / winget catalog.

Action

  1. Generate a new GitHub Personal Access Token for the account that owns the Bowire fork of microsoft/winget-pkgs. Required scope: public_repo (push to forks, open PRs).
  2. Replace the repo secret WINGET_TOKEN at https://github.com/Kuestenlogik/Bowire/settings/secrets/actions with the new token.
  3. Re-trigger the workflow against the existing tag — does NOT need a new release:
    gh workflow run winget.yml -f tag=v2.0.0
    
  4. Watch the run; expected outcome is a PR opened against microsoft/winget-pkgs that the Microsoft moderators then merge over ~1–24 h.

Why this matters

Winget is the canonical Windows package manager for developer-tooling installs. winget install Kuestenlogik.Bowire should resolve to 2.0.0 within a day or two of the release; right now it's stuck at the previous version. The Chocolatey route also works (choco install bowire) but winget is the default modern channel.

Followup hardening (optional, separate PR)

The workflow could gh api -X GET user upfront with the WINGET_TOKEN env var before invoking wingetcreate submit; on 401, fail loud with "WINGET_TOKEN is expired or revoked — rotate at Settings → Secrets" instead of letting wingetcreate swallow the auth error into a vague "Token was invalid" message. Saves ~10 min of log-spelunking next time the PAT rotates.

Activity

  1. changed the issue type fromtoon Jun 24, 2026
  2. thomas-stegemann commented on Aug 20, 2026

    @thomas-stegemann
    MemberAuthor

    Done — the submission went through and the PR is open upstream: microsoft/winget-pkgs#421244 — KuestenLogik.Bowire version 2.4.0. Microsoft's moderators merge these within roughly a day.

    Published 2.4.0, not 2.0.0. The ticket was written against the v2.0.0 release, but every winget run since has failed the same way — 2.1.0, 2.1.1, 2.2.0, 2.2.1, 2.3.0 and 2.4.0. Re-submitting 2.0.0 would have put a version four minors old into the catalogue, so the rotated token was spent on the current release instead.

    Two causes, not one. Rotating WINGET_TOKEN fixed the authentication — Token was invalid disappeared — but the run still failed, now with:

    The forked repository could not be synced with the upstream commits.
    Sync your fork manually and try again.
    

    thomas-stegemann/winget-pkgs was 31,185 commits behind microsoft/winget-pkgs and 0 ahead, so GitHub's own fork-sync gave up. A gh repo sync (a pure fast-forward — the fork carries no commits of its own) brought it to identical, and the next run succeeded.

    The job no longer needs a human for this. Since that upstream takes thousands of commits a day, the fork would have aged back out of sync before the next release and failed identically. The publish job now syncs the fork itself before submitting (commit 0e34883). It is continue-on-error with an explicit exit-code check: a fork with no local commits cannot lose anything to a fast-forward, and if one ever did carry local work, the sync fails and the submit runs anyway — reporting the same message as before rather than discarding it.

    Still worth a follow-up: the real damage here was not the failure but that it went unnoticed for seven releases — the winget job fails quietly beside a green release. Making that failure visible (a red required check, or an auto-filed issue) is tracked separately.

  3. moved this from Backlog to Done in Bowireon Aug 20, 2026
  4. thomas-stegemann commented on Aug 25, 2026

    @thomas-stegemann
    MemberAuthor

    Verwandt: #613 — Azure DevOps schaltet am 2026-12-01 PATs mit Scope all accessible organizations ab, was vsce publish bisher verlangt. Statt einen zweiten ablaufenden Token (VSCE_PAT) neben WINGET_TOKEN zu führen, soll der Publish auf Entra ID mit föderierten Credentials über OIDC umgestellt werden. Dieses Issue hier ist dort als Präzedenz zitiert: ein abgelaufener Publish-Token, der einen Release blockiert hat. #613 prüft mit, ob WINGET_TOKEN demselben Muster folgen kann.

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

    No labels
    No labels

    Type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions