Skip to content

Publish to the tap and bucket with deploy keys - #50

Merged
imanimanyara merged 2 commits into
mainfrom
feat/release-deploy-keys
Oct 19, 2026
Merged

imanimanyara merged 2 commits into
mainfrom
feat/release-deploy-keys

Conversation

@imanimanyara

Copy link
Copy Markdown
Member

Lets releases publish the Homebrew cask and the Scoop manifest with a write deploy key on each package repository, instead of a personal access token (TAP_GITHUB_TOKEN). Each deploy key reaches its one repository and nothing else.

  • src/.goreleaser.yaml: homebrew_casks and scoops take a git: block. Its URL renders only when HOMEBREW_TAP_DEPLOY_KEY / SCOOP_BUCKET_DEPLOY_KEY is set. With a key, GoReleaser clones, commits and pushes over SSH. Without one, the URL is empty and the existing token path runs unchanged.
  • release.yml: passes the two key secrets next to TAP_GITHUB_TOKEN.
  • The cask's skip_upload also counts the deploy key, so a keyed release is not skipped.
  • Fixes a latent failure: the cask and bucket tokens used envOrDefault, which GoReleaser does not define in token:. The release passed until now only because the cask was skipped (no tap token set); it would have failed as soon as one was. They are .Env now, and the comment explains why.

simtabi/homebrew-tap requires a pull request on main; its ruleset gets Deploy keys as a bypass actor (an owner step), so a release key push lands directly. scoop-bucket has no rules. Nothing changes until the keys exist (created with the deploy-key setup script, on the personal login).

Verified locally with GoReleaser 2.18.3 (the version CI's latest resolves to):

  • goreleaser check passes.
  • In a throwaway project pushing to a local bare repository: with the key set, the cask is cloned, written and pushed; with it unset, the git path is not taken.
  • envOrDefault is not defined inside token: ("function envOrDefault not defined"), so the token stays {{ .Env.TAP_GITHUB_TOKEN }}. That form fails only when the variable is entirely unset and no key is given, which CI never does.

actionlint shows only the two known stale create-github-app-token@v3 findings, where they apply.

HOMEBREW_TAP_DEPLOY_KEY and SCOOP_BUCKET_DEPLOY_KEY each reach one
repository. Set, GoReleaser pushes with them over git; unset, the git URL
renders empty and the existing token path runs. Token fields stay .Env:
GoReleaser 2.18.3 does not define envOrDefault there.
Copilot AI balanced review requested due to automatic review settings October 19, 2026 15:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@imanimanyara
imanimanyara merged commit 17da538 into main Oct 19, 2026
9 checks passed
@imanimanyara
imanimanyara deleted the feat/release-deploy-keys branch October 21, 2026 10:01
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.

2 participants