How to debug a problem with the home-brew release? #1686
-
I'm having the problem below:
This is my config file:
Everything is working fine, the app is being compiled, the release is generated at GitHub but it fails at the homebrew part. The repository exists and both repositories are private. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This looks like an authentication/authorization issue where the tap repository is private - hence the API returns 404? Is it possible that the tap repo the formula gets published into requires permissions/scope which the GitHub token passed to GoReleaser doesn't have? GitHub Actions get a token generated automatically - but that token only has access to the repo where the Action runs. Because explicit PATs are associated with users by their nature - it may be necessary to create a dedicated "bot" account, generate PAT for that account and give the account push access to the tap repo, because PATs by themselves don't have repo-based scopes sadly. I kind of wish we could power Homebrew publishing with repo-level deploy keys, but that takes the API out of the equation and so that would require some significant refactoring + I'm not too excited about the idea of shelling out to git. I'm just secretly hoping that GitHub will eventually improve token handling for GitHub Actions so that one could just grant permissions between repos without having to maintain bot accounts. FYI - you can also pass a separate token for Homebrew publishing via tap:
owner: repo-owner
name: homebrew-tap
# Optionally a token can be provided, if it differs from the token provided to GoReleaser
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" |
Beta Was this translation helpful? Give feedback.
This looks like an authentication/authorization issue where the tap repository is private - hence the API returns 404?
Is it possible that the tap repo the formula gets published into requires permissions/scope which the GitHub token passed to GoReleaser doesn't have? GitHub Actions get a token generated automatically - but that token only has access to the repo where the Action runs.
Because explicit PATs are associated with users by their nature - it may be necessary to create a dedicated "bot" account, generate PAT for that account and give the account push access to the tap repo, because PATs by themselves don't have repo-based scopes sadly.
I kind of wish we could power Homebrew publ…