Skip to content

ci(winget): add weekly WINGET_TOKEN expiry reminder#326

Merged
githubrobbi merged 2 commits into
mainfrom
ci/winget-token-expiry-reminder
Jun 1, 2026
Merged

ci(winget): add weekly WINGET_TOKEN expiry reminder#326
githubrobbi merged 2 commits into
mainfrom
ci/winget-token-expiry-reminder

Conversation

@githubrobbi
Copy link
Copy Markdown
Collaborator

Summary

Closes the silent-failure gap on the WinGet auto-publish token. winget-publish.yml needs a classic PAT (WINGET_TOKEN, public_repo) to fork+push to microsoft/winget-pkgs; when it expires, releases silently stop updating WinGet (the workflow fires on release: released, off the PR path, so nobody sees the red X).

What it does

A Monday 07:00 UTC (+ workflow_dispatch) job probes the token's real expiry — read from the github-authentication-token-expiration API response header, not a hard-coded date — and manages a single tracking issue:

Token state Action
< 28 days left Opens/updates issue (winget-token-expiry label, assigned githubrobbi) with rotation steps
expired / 401 / secret missing Same issue, "ACT NOW" body
healthy Auto-closes any open reminder (so rotating the token resolves it)

Probing the live header also catches early revocation, scope changes, and manual rotations — the reminder always reflects reality.

Least-privilege (contents: read, issues: write); never runs from forks. Single new workflow file; gates-drift + gen-workflow unaffected (they scope pr-fast.yml). Local lint-pre-push green.

Note: this is the "git reminder" for the token-expiry concern — version-controlled and self-verifying, rather than a calendar note.

🤖 Generated with Claude Code

winget-publish.yml's classic PAT (WINGET_TOKEN, public_repo) silently
breaks WinGet auto-publish when it expires — and since that workflow
fires on `release: released` (not the PR path), the failure goes
unnoticed until WinGet is stuck at an old version.

Add a Monday 07:00 UTC (+ workflow_dispatch) probe that reads the
token's REAL expiry from the `github-authentication-token-expiration`
API response header and:
- < 28 days left  -> opens/updates a tracking issue (labelled
  winget-token-expiry, assigned to githubrobbi) with rotation steps.
- expired / 401 / missing secret -> same issue with an ACT-NOW body.
- healthy -> auto-closes any open reminder, so a rotation resolves it.

Probing the real header (not a hard-coded date) also catches early
revocation, scope changes, and manual rotations. Least-privilege
(contents: read, issues: write); never runs from forks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@githubrobbi githubrobbi enabled auto-merge (squash) June 1, 2026 02:40
@githubrobbi githubrobbi merged commit b1f86c7 into main Jun 1, 2026
25 checks passed
@githubrobbi githubrobbi deleted the ci/winget-token-expiry-reminder branch June 1, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant