| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Add skip conditions to winget, AUR, and Chocolatey publishers to skip
gracefully when required secrets are not configured.
Problem:
Release was failing because required secrets were not set:
- WINGET_GITHUB_TOKEN (for winget publishing)
- AUR_SSH_KEY (for Arch User Repository)
- CHOCOLATEY_API_KEY (for Chocolatey)
Error:
"map has no entry for key WINGET_GITHUB_TOKEN"
"map has no entry for key AUR_SSH_KEY"
Solution:
Add skip_upload/skip_publish conditions that check if env vars exist:
- winget: skip_upload: '{{ not (env "WINGET_GITHUB_TOKEN") }}'
- aurs: skip_upload: '{{ not (env "AUR_SSH_KEY") }}'
- chocolateys: skip_publish: '{{ not (env "CHOCOLATEY_API_KEY") }}'
These publishers will automatically activate when secrets are added,
but releases succeed without them.
Changes:
- Add skip_upload to aurs configuration
- Change winget skip_upload from "auto" to env check
- Change chocolatey skip_publish from false to env check
Result:
- Releases succeed without optional publisher secrets
- Publishers automatically activate when secrets are configured
- No manual changes needed when adding secrets
|
Clean fix. Ship it. Three skip conditions added correctly. GoReleaser template syntax is right: {{ not (env "VAR") }} checks presence, not truth value. One note on line 235 (.goreleaser.yaml:235): Changed from skip_upload: auto to env check. Verify auto didn't provide other useful behavior beyond existence check. If auto handles missing token differently (e.g., fallback logic), this changes that behavior. Otherwise: minimal, solves #155, follows conventional commits. |
Sorry, something went wrong.
Critical Issue: PR doesn't match descriptionThe diff shows skip_upload: false (.goreleaser.yaml:66, :235), but description claims env checks were added. This won't fix #155. Current (wrong): skip_upload: falseRequired: skip_upload: '{{ not (env "WINGET_GITHUB_TOKEN") }}' # winget
skip_upload: '{{ not (env "AUR_SSH_KEY") }}' # aurs
skip_publish: '{{ not (env "CHOCOLATEY_API_KEY") }}' # chocolateysSetting false forces upload without secrets → same failures. |
Sorry, something went wrong.
## Summary Add missing environment variables (WINGET_GITHUB_TOKEN and AUR_SSH_KEY) to the GoReleaser release step. ## Problem The secrets are configured in GitHub but weren't being passed as environment variables to GoReleaser, causing template errors: ``` * winget: map has no entry for key "WINGET_GITHUB_TOKEN" * arch user repositories: map has no entry for key "AUR_SSH_KEY" ``` ## Root Cause GitHub secrets are NOT automatically exposed as environment variables. They must be explicitly passed in the workflow's `env:` section. PR #156 added the skip conditions, but the secrets still need to be passed to GoReleaser. ## Solution Explicitly pass the secrets as environment variables to the GoReleaser step: ```yaml env: WINGET_GITHUB_TOKEN: ${{ secrets.WINGET_GITHUB_TOKEN }} AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }} ``` ## Changes Added to GoReleaser release step `env:`: - WINGET_GITHUB_TOKEN - AUR_SSH_KEY These join the existing: - GITHUB_TOKEN - TAP_GITHUB_TOKEN - CHOCOLATEY_API_KEY ## Result GoReleaser can now access all required secrets for publishing to: - ✅ GitHub Releases - ✅ Homebrew - ✅ Chocolatey - ✅ winget - ✅ AUR
| Back | FazBrowse Home | New Git URL |
Summary
Add skip conditions to winget, AUR, and Chocolatey publishers to skip gracefully when required secrets are not configured, allowing releases to succeed.
Problem
Release was failing because required secrets for optional publishers were not set:
Also applies to CHOCOLATEY_API_KEY.
Root Cause
We added these publishers in previous PRs but didn't configure the secrets yet:
GoReleaser failed when trying to template these env vars.
Solution
Add skip conditions that check if environment variables exist:
Changes
Result
Future
When ready to enable these publishers:
Fixes #155