Skip to content

Automate Homebrew tap sync on release #21

Description

@mesrikanthreddy

Problem

`release.yml` patches `homebrew/kshield.rb` inside the `kshield` repo itself (version + checksums), but nothing pushes that file to the separate `YTT-Global/homebrew-tap` repo, which is what `brew install ytt-global/tap/kshield` actually reads from.

For v1.1.0 this had to be fixed by hand: the tap repo was still on v1.0.0 pointing at the dead `YTTGlobalServices` org, and it will drift again on every future release unless this is automated.

Proposed fix

Add a step to the `publish` job (or a new job) in `release.yml` that, after computing the correct checksums:

  1. Checks out (or clones) `YTT-Global/homebrew-tap`
  2. Overwrites `kshield.rb` with the freshly-patched formula
  3. Commits and pushes to `main`

Needs a token with write access to `homebrew-tap` (the default `GITHUB_TOKEN` only has access to the repo the workflow runs in) — a fine-grained PAT or a GitHub App installation token stored as a secret (e.g. `HOMEBREW_TAP_PUSH_TOKEN`).

Related

Also depends on PR #16 (checksums-collision fix) being merged first, since that's what makes the computed checksums trustworthy again.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions