Skip to content

A lightweight, macOS-style dock for Windows 11, with glass visuals, smooth magnification, and Genie effect.

feat(hero): simplify download button layout and enhance styling fix(winget): improve error message for fine-grained PAT restrictions test(winget): track API call counts and validate token handling in tests

CristianOlivera104fac03e6ca3
diff --git a/muelle/src/components/sections/Hero.astro b/muelle/src/components/sections/Hero.astro
index d614561..6ea40d1 100644
--- a/muelle/src/components/sections/Hero.astro
+++ b/muelle/src/components/sections/Hero.astro
@@ -29,18 +29,16 @@ import { site } from "@/data/site";
</p>
<div data-h class="flex flex-wrap items-center justify-center gap-3">
- <div class="inline-flex items-center gap-2">
- <Button href={site.download}>
- Download for Windows
- <Icon name="arrow-right" size={18} />
- </Button>
+ <Button href={site.download}>
+ Download for Windows
<span
data-installer-download-count
aria-label="Total installer downloads"
- class="font-mono text-sm font-semibold text-mute"
+ class="rounded-full bg-ink/10 px-2 py-0.5 font-mono text-xs font-semibold"
hidden
></span>
- </div>
+ <Icon name="arrow-right" size={18} />
+ </Button>
<Button href="#dock" variant="secondary">Take a look</Button>
</div>
diff --git a/scripts/Submit-WingetManifest.ps1 b/scripts/Submit-WingetManifest.ps1
index ba66e22..2a8c8ab 100644
--- a/scripts/Submit-WingetManifest.ps1
+++ b/scripts/Submit-WingetManifest.ps1
@@ -12,6 +12,11 @@ $sha256 = [regex]::Match($installer, '(?m)^\s+InstallerSha256: ([A-Fa-f0-9]{64})
if (-not $version -or -not $sha256 -or $installer -notmatch '(?m)^PackageIdentifier: CrafterStation\.Muelle\s*$') {
throw 'Expected a generated, validated CrafterStation.Muelle installer manifest.'
}
+# WinGetCreate does not support fine-grained PATs, including ones that can
+# read all public repositories. They cannot perform this cross-repository flow.
+if ($env:WINGET_CREATE_GITHUB_TOKEN -clike 'github_pat_*') {
+ throw 'WINGET_TOKEN is a fine-grained PAT, which WinGetCreate does not support. Create a token under GitHub Settings > Developer settings > Personal access tokens > Tokens (classic), select public_repo, replace the WINGET_TOKEN Actions secret, and rerun this same published version with Submit enabled. See https://github.com/settings/tokens/new and FIRMA-DE-CODIGO.md.'
+}
$headers = @{ Accept = 'application/vnd.github+json'; 'User-Agent' = 'Muelle-WinGet' }
$lookupToken = if ($env:WINGET_CREATE_GITHUB_TOKEN) { $env:WINGET_CREATE_GITHUB_TOKEN } else { $env:GH_TOKEN }
if ($lookupToken) { $headers.Authorization = "Bearer $lookupToken" }
@@ -63,7 +68,7 @@ try {
}
& $tool submit --no-open --prtitle "${kind}: $id version $version" $ManifestDirectory
if ($LASTEXITCODE) {
- throw "WinGetCreate submission failed (exit $LASTEXITCODE). Check the token permissions/expiry and Microsoft CLA; the validated artifact remains available."
+ throw "WinGetCreate submission failed (exit $LASTEXITCODE). Check the client output above. For token permission errors, use a classic PAT with public_repo, check expiry/SSO authorization, replace the WINGET_TOKEN Actions secret and rerun this same published version. The validated artifact remains available."
}
Write-Result "Submitted $id $version to microsoft/winget-pkgs. Microsoft review and catalog indexing are still required."
} finally {
diff --git a/scripts/Test-WingetAutomation.ps1 b/scripts/Test-WingetAutomation.ps1
index a8b4027..d4fdcff 100644
--- a/scripts/Test-WingetAutomation.ps1
+++ b/scripts/Test-WingetAutomation.ps1
@@ -11,6 +11,7 @@ $savedSummary = $env:GITHUB_STEP_SUMMARY
$savedExitCode = $global:LASTEXITCODE
$state = @{}
$state.downloads = 0
+$state.apiCalls = 0
$state.validationExit = 0
$state.productVersion = '0.1.16'
$state.signatureStatus = 'NotSigned'
@@ -27,6 +28,7 @@ $state.fixture = [pscustomobject]@{
}
function Invoke-RestMethod {
param($Uri, $Headers, $TimeoutSec)
+ $state.apiCalls++
if ($Uri -like 'https://api.github.com/repos/crafter-station/Muelle/releases/*') { return $state.fixture }
if ($Uri -like 'https://api.github.com/repos/microsoft/winget-pkgs/contents/*') { return $state.catalog }
if ($Uri -like 'https://api.github.com/search/issues?*') { return @{ items = $state.openPrs } }
@@ -106,6 +108,13 @@ try {
$state.validationExit = 0
$beforeSubmit = $state.downloads
Assert-Rejected 'missing submission token' { & $submit -ManifestDirectory $manifest.Directory } 'WINGET_TOKEN is missing*'
+ $env:WINGET_CREATE_GITHUB_TOKEN = 'github_pat_fixture_not_a_real_token'
+ $beforeTokenCheck = $state.apiCalls
+ Assert-Rejected 'fine-grained PAT rejected before API access or tool download' { & $submit -ManifestDirectory $manifest.Directory } 'WINGET_TOKEN is a fine-grained PAT*'
+ if ($state.apiCalls -ne $beforeTokenCheck -or $state.downloads -ne $beforeSubmit) {
+ throw 'Unsupported credentials reached a network or executable download boundary.'
+ }
+ $env:WINGET_CREATE_GITHUB_TOKEN = ''
$state.catalog = @{ content = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("InstallerSha256: $hash`n")) }
& $submit -ManifestDirectory $manifest.Directory
Write-Host 'PASS: accepted version is not resubmitted'