Skip to content

Fix: Pass WINGET_GITHUB_TOKEN and AUR_SSH_KEY to GoReleaser#157

Merged
wkoszek merged 1 commit intomainfrom
fix-env-vars
Nov 25, 2025
Merged

Fix: Pass WINGET_GITHUB_TOKEN and AUR_SSH_KEY to GoReleaser#157
wkoszek merged 1 commit intomainfrom
fix-env-vars

Conversation

@wkoszek
Copy link
Copy Markdown
Contributor

@wkoszek wkoszek commented 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:

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

Add missing environment variables to GoReleaser release step.
GitHub secrets exist but weren't being passed as env vars to
GoReleaser, causing template errors.

Added:
- WINGET_GITHUB_TOKEN
- AUR_SSH_KEY

These join the existing:
- GITHUB_TOKEN
- TAP_GITHUB_TOKEN
- CHOCOLATEY_API_KEY
@wkoszek wkoszek merged commit 3a361c7 into main Nov 25, 2025
2 checks passed
@wkoszek wkoszek deleted the fix-env-vars branch November 25, 2025 08:44
@claude
Copy link
Copy Markdown

claude bot commented Nov 25, 2025

Critical Issue

The skip conditions from PR #156 are hardcoded to false. This PR only adds env vars but doesn't solve the template error when secrets are missing.

.goreleaser.yaml:66, :235, :212

skip_upload: false          # AUR - will still fail without AUR_SSH_KEY
skip_upload: false          # winget - will still fail without WINGET_GITHUB_TOKEN  
skip_publish: false         # chocolatey - will still fail without CHOCOLATEY_API_KEY

Fix

Change to conditional skips:

skip_upload: '{{ not (env "AUR_SSH_KEY") }}'
skip_upload: '{{ not (env "WINGET_GITHUB_TOKEN") }}'
skip_publish: '{{ not (env "CHOCOLATEY_API_KEY") }}'

This way GoReleaser skips publishers when secrets aren't set, rather than failing on template evaluation.

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