Skip to content

Automate homebrew formula releases and ignore private memos - #137

Merged
yourconscience merged 1 commit into
mainfrom
chore/release-plumbing
Aug 21, 2026
Merged

Automate homebrew formula releases and ignore private memos#137
yourconscience merged 1 commit into
mainfrom
chore/release-plumbing

Conversation

@yourconscience

@yourconscience yourconscience commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Automates what is currently a manual step and keeps private memos out of the public repo.

  • goreleaser now publishes the formula to yourconscience/homebrew-tap on every tag (requires HOMEBREW_TAP_TOKEN secret: PAT with repo scope on the tap). First automated release overwrites the hand-written Formula/dotagents.rb; desc/homepage/license match it.
  • gitignore SPEC.md, GROWTH-PLAN.md, ANYWHERE-AGENTS-ANALYSIS.md (private strategy memos).

Part of phase 1 in SPEC.md (untracked).

Summary by Sourcery

Automate Homebrew tap releases and keep private planning documents out of the public repository.

Enhancements:

  • Automate Homebrew formula publishing for tagged releases with the tap metadata managed by GoReleaser.

CI:

  • Pass the Homebrew tap authentication token to the release workflow.

Chores:

  • Exclude private strategy and planning memos from version control.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sourcery-ai

sourcery-ai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Configures GoReleaser to automatically publish a Homebrew formula to the yourconscience/homebrew-tap repository on every tagged release, and updates gitignore to exclude several private strategy/plan documents from version control.

Sequence diagram for automated Homebrew formula release via GoReleaser

sequenceDiagram
  actor Developer
  participant GitHub
  participant GitHubActions_release_workflow
  participant GoReleaser
  participant HomebrewTapRepo

  Developer->>GitHub: push tag
  GitHub->>GitHubActions_release_workflow: trigger release.yml
  GitHubActions_release_workflow->>GoReleaser: release --clean
  GitHubActions_release_workflow->>GoReleaser: set HOMEBREW_TAP_TOKEN
  GoReleaser->>HomebrewTapRepo:
Loading

File-Level Changes

Change Details Files
Wire HOMEBREW_TAP_TOKEN into the release GitHub Actions workflow so GoReleaser can publish to the Homebrew tap.
  • Add HOMEBREW_TAP_TOKEN secret to the release job environment alongside GITHUB_TOKEN so it is available during goreleaser execution
.github/workflows/release.yml
Configure GoReleaser to build and publish a Homebrew formula to the yourconscience/homebrew-tap repository.
  • Add a brews section specifying the target tap repository owner/name and the token environment variable to authenticate pushes
  • Set the Homebrew formula directory to Formula and define description, homepage, and license metadata consistent with the existing hand-written formula
.goreleaser.yaml
Ignore private planning/strategy documents so they are not committed to the public repository.
  • Add SPEC.md, GROWTH-PLAN.md, and ANYWHERE-AGENTS-ANALYSIS.md to .gitignore
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 2 issues, and left some high level feedback:

  • Consider adding an explicit check or early failure in the release workflow when HOMEBREW_TAP_TOKEN is unset so that missing credentials surface as a clear, actionable error instead of a generic goreleaser failure.
  • Hardcoding the Homebrew tap owner/name in .goreleaser.yaml makes forking or reusing this config harder; you might want to derive these from environment variables or Git metadata to make the setup more portable.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding an explicit check or early failure in the release workflow when HOMEBREW_TAP_TOKEN is unset so that missing credentials surface as a clear, actionable error instead of a generic goreleaser failure.
- Hardcoding the Homebrew tap owner/name in .goreleaser.yaml makes forking or reusing this config harder; you might want to derive these from environment variables or Git metadata to make the setup more portable.

## Individual Comments

### Comment 1
<location path=".github/workflows/release.yml" line_range="30" />
<code_context>
           args: release --clean
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
</code_context>
<issue_to_address>
**🚨 suggestion (security):** Consider constraining the token scope and documenting its expected permissions

Because this token will push to `homebrew-tap`, it likely needs `contents: write` (and possibly `workflow` if that repo uses workflows). Please ensure the secret is a fine‑grained PAT with only the minimum required scopes and access restricted to that repo to limit impact if it’s ever leaked.
</issue_to_address>

### Comment 2
<location path=".goreleaser.yaml" line_range="26-27" />
<code_context>
+  - repository:
+      owner: yourconscience
+      name: homebrew-tap
+      token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
+    directory: Formula
+    description: "Sync skills, MCP servers, hooks, and roles across coding agents"
</code_context>
<issue_to_address>
**suggestion:** Handle missing `HOMEBREW_TAP_TOKEN` more explicitly to fail fast

If `HOMEBREW_TAP_TOKEN` is unset, goreleaser will use an empty token and only fail later with a confusing Git push error. Consider adding an explicit pre-check (in the workflow or via goreleaser `env`/`before` hooks) to assert this env var is set and non-empty so failures are immediate and clearer.

```suggestion
env:
  - HOMEBREW_TAP_TOKEN={{ .Env.HOMEBREW_TAP_TOKEN | mustEnv "HOMEBREW_TAP_TOKEN" }}

checksum:
  name_template: checksums.txt
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚨 suggestion (security): Consider constraining the token scope and documenting its expected permissions

Because this token will push to homebrew-tap, it likely needs contents: write (and possibly workflow if that repo uses workflows). Please ensure the secret is a fine‑grained PAT with only the minimum required scopes and access restricted to that repo to limit impact if it’s ever leaked.

Comment thread .goreleaser.yaml
Comment on lines 26 to 27
checksum:
name_template: checksums.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: Handle missing HOMEBREW_TAP_TOKEN more explicitly to fail fast

If HOMEBREW_TAP_TOKEN is unset, goreleaser will use an empty token and only fail later with a confusing Git push error. Consider adding an explicit pre-check (in the workflow or via goreleaser env/before hooks) to assert this env var is set and non-empty so failures are immediate and clearer.

Suggested change
checksum:
name_template: checksums.txt
env:
- HOMEBREW_TAP_TOKEN={{ .Env.HOMEBREW_TAP_TOKEN | mustEnv "HOMEBREW_TAP_TOKEN" }}
checksum:
name_template: checksums.txt

@yourconscience
yourconscience merged commit f25c134 into main Aug 21, 2026
4 checks passed
@yourconscience
yourconscience deleted the chore/release-plumbing branch August 21, 2026 16: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.

1 participant