Conversation
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: One note on line 235 (.goreleaser.yaml:235): Changed from Otherwise: minimal, solves #155, follows conventional commits. |
Critical Issue: PR doesn't match descriptionThe diff shows 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 |
wkoszek
added a commit
that referenced
this pull request
Nov 25, 2025
## 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
WINGET_GITHUB_TOKEN- GitHub PAT for winget-pkgs PRsAUR_SSH_KEY- SSH key for AUR publishingCHOCOLATEY_API_KEY- API key for ChocolateyGoReleaser failed when trying to template these env vars.
Solution
Add skip conditions that check if environment variables exist:
Changes
skip_uploadto aurs configurationskip_uploadfromautoto env checkskip_publishfromfalseto env checkResult
Future
When ready to enable these publishers:
Fixes #155