From daf3d453a7d1b64716eb1af45859fe5e51db21f4 Mon Sep 17 00:00:00 2001 From: Badcuban <108198679+badcuban@users.noreply.github.com> Date: Mon, 16 Nov 2026 04:48:21 -0500 Subject: [PATCH 1/3] docs(release): WinGet token needs the workflow scope too The 0.10.0 and 0.10.1 WinGet runs failed with a CreateRef permission error: winget-pkgs changed its own workflow files, and GitHub refuses to push those to the fork without the workflow scope. Will added the scope and the 0.10.1 run then opened microsoft/winget-pkgs#481445. --- .github/workflows/winget.yml | 8 +++++--- docs/release.md | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 355903863..424f0cec4 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -9,8 +9,10 @@ run-name: WinGet ${{ inputs.version }}${{ inputs.dry_run && ' (dry run)' || '' } # exempt. Run it by hand to retry a version. # # Needs the WINGET_TOKEN secret: a classic GitHub token with the public_repo -# scope. The pull request opens from that account's fork of winget-pkgs, which -# the first run creates. That account's first pull request there also needs +# and workflow scopes (komac brings the fork up to date with winget-pkgs, whose +# own workflow files change, and GitHub refuses that push without workflow). +# The pull request opens from that account's fork of winget-pkgs, which the +# first run creates. That account's first pull request there also needs # Microsoft's CLA, agreed to once in a comment on it. on: workflow_dispatch: @@ -48,7 +50,7 @@ jobs: WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }} run: | if [[ -z "$WINGET_TOKEN" ]]; then - echo "::error::Add a WINGET_TOKEN secret (a classic GitHub token with public_repo) to send releases to winget." + echo "::error::Add a WINGET_TOKEN secret (a classic GitHub token with public_repo and workflow) to send releases to winget." exit 1 fi diff --git a/docs/release.md b/docs/release.md index 084e7dce0..8001d7d9f 100644 --- a/docs/release.md +++ b/docs/release.md @@ -319,8 +319,11 @@ version shows up in winget once a moderator merges it. The listing text Setup, once: - Add a `WINGET_TOKEN` repository secret: a classic GitHub token with the - `public_repo` scope. Pull requests open from that account's fork of - winget-pkgs, which the first run creates. + `public_repo` and `workflow` scopes. Pull requests open from that account's + fork of winget-pkgs, which the first run creates. Without `workflow`, a run + fails with "does not have the correct permissions to execute CreateRef" + whenever winget-pkgs has changed its own workflow files since the fork's + last push. - On that account's first winget-pkgs pull request, agree to Microsoft's CLA with the comment the CLA bot asks for. From b37f1fa829e4bcd9d9ed96af48487c39e2a3fc50 Mon Sep 17 00:00:00 2001 From: Badcuban <108198679+badcuban@users.noreply.github.com> Date: Mon, 16 Nov 2026 04:54:13 -0500 Subject: [PATCH 2/3] fix(release): WinGet waits while our first request is in the queue Until a moderator approves the first New package pull request, every stable release opened another one, each waiting weeks in the same queue. A new check job looks for the package in winget-pkgs and for an open New package request; while one waits, the submit job is skipped with a notice. Dry runs still run. --- .github/workflows/winget.yml | 43 ++++++++++++++++++++++++++++++++++++ docs/release.md | 8 +++++++ 2 files changed, 51 insertions(+) diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 424f0cec4..4912c4991 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -40,8 +40,51 @@ env: KOMAC_SHA256: b03b020eec98acfb0b53e284a6e21815b884be33de6785b97e7a120f0e748966 jobs: + # Until a moderator approves our first ("New package") pull request, + # Threadlines isn't in winget-pkgs and every version we send is another new + # package request that waits weeks in the same queue. So while one is open, + # skip instead of piling up more; the oldest keeps our place in line. Once + # it's approved, versions go out as normal updates. Send the newest version + # by hand that day so winget doesn't sit on the approved one. + check: + name: Check whether Threadlines is listed + runs-on: ubuntu-latest + timeout-minutes: 5 + outputs: + waiting: ${{ steps.listing.outputs.waiting }} + steps: + - name: Look for the package and a waiting request + id: listing + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + status="$(gh api --include repos/microsoft/winget-pkgs/contents/manifests/t/Threadlines/Threadlines 2> /dev/null | head -n 1 || true)" + if [[ "$status" == *" 200"* ]]; then + echo "Threadlines.Threadlines is in winget-pkgs; sending an update." + echo "waiting=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + if [[ "$status" != *" 404"* ]]; then + echo "::error::Couldn't tell whether Threadlines is in winget-pkgs (got '${status}')." + exit 1 + fi + pending="$(gh api -X GET search/issues \ + -f q='repo:microsoft/winget-pkgs is:pr is:open in:title "New package: Threadlines.Threadlines"' \ + --jq '[.items[].html_url] | join(" ")')" + if [[ -n "$pending" ]]; then + echo "::notice::Skipped: our first winget request still waits for a moderator (${pending}). Send the newest version by hand once it's approved." + echo "waiting=true" >> "$GITHUB_OUTPUT" + else + echo "No Threadlines package and no waiting request; sending a new one." + echo "waiting=false" >> "$GITHUB_OUTPUT" + fi + submit: name: Send to winget-pkgs + needs: check + # A dry run only builds and checks the manifests, so it runs either way. + if: ${{ inputs.dry_run || needs.check.outputs.waiting != 'true' }} runs-on: ubuntu-latest timeout-minutes: 20 steps: diff --git a/docs/release.md b/docs/release.md index 8001d7d9f..1d4bd1cf7 100644 --- a/docs/release.md +++ b/docs/release.md @@ -330,6 +330,14 @@ Setup, once: To retry a version, or to check the manifests without opening a pull request, run **WinGet** by hand with that version (tick "dry run" for the check). +Until a moderator approves our first pull request, Threadlines isn't in +winget-pkgs, and every version sent is another "New package" request in a +queue that takes weeks (about eight in November 2026). So while one is open, +the workflow skips with a notice instead of opening more, and the oldest +request keeps our place in line. Updates to a listed package merge within +hours. The day the first one is approved, run **WinGet** by hand with the +newest stable version. + ## Windows Publisher Name There are two different Windows publisher surfaces: From 8463fddb905f3d3060914fbc70f3bc6ee37d238d Mon Sep 17 00:00:00 2001 From: Badcuban <108198679+badcuban@users.noreply.github.com> Date: Mon, 16 Nov 2026 05:02:00 -0500 Subject: [PATCH 3/3] fix(release): only our own WinGet requests hold back a release Anyone can open a winget-pkgs pull request titled "New package: Threadlines.Threadlines". Limit the waiting check to requests authored by the WINGET_TOKEN account so a stranger's can't block our submissions (Vercel Security Review finding 21). --- .github/workflows/winget.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 4912c4991..b065867d9 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -57,6 +57,7 @@ jobs: id: listing env: GH_TOKEN: ${{ github.token }} + WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }} run: | set -euo pipefail status="$(gh api --include repos/microsoft/winget-pkgs/contents/manifests/t/Threadlines/Threadlines 2> /dev/null | head -n 1 || true)" @@ -69,8 +70,15 @@ jobs: echo "::error::Couldn't tell whether Threadlines is in winget-pkgs (got '${status}')." exit 1 fi + # Only our own requests count: anyone can open a pull request with + # this title, and a stranger's must not hold back our releases. + if [[ -z "$WINGET_TOKEN" ]]; then + echo "::error::Add a WINGET_TOKEN secret (a classic GitHub token with public_repo and workflow) to send releases to winget." + exit 1 + fi + owner="$(GH_TOKEN="$WINGET_TOKEN" gh api user --jq .login)" pending="$(gh api -X GET search/issues \ - -f q='repo:microsoft/winget-pkgs is:pr is:open in:title "New package: Threadlines.Threadlines"' \ + -f q="repo:microsoft/winget-pkgs is:pr is:open author:${owner} in:title \"New package: Threadlines.Threadlines\"" \ --jq '[.items[].html_url] | join(" ")')" if [[ -n "$pending" ]]; then echo "::notice::Skipped: our first winget request still waits for a moderator (${pending}). Send the newest version by hand once it's approved."