Fix: Pass WINGET_GITHUB_TOKEN and AUR_SSH_KEY to GoReleaser#157
Merged
Conversation
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
Critical IssueThe skip conditions from PR #156 are hardcoded to .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_KEYFixChange 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. |
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 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:
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:
Changes
Added to GoReleaser release step
env::These join the existing:
Result
GoReleaser can now access all required secrets for publishing to: