Automate your Brewfiles using GitOps workflow. Use this GitHub Action to keep your Brewfiles in sync with your Workbrew workspace. Push changes to your repo, and your Brewfiles follow—no manual steps, no drift.
This Action treats your repository as the source of truth. The action fetches all Brewfiles from Workbrew and compares them to the files in your repo. If a Brewfile is new or changed, it updates Workbrew. If a Brewfile is gone from your repo, it deletes it from Workbrew.
Device targeting is automatic: add a comment at the top of your Brewfile to target a device group or serial numbers. If you don’t, it defaults to no devices. Example Brewfiles:
- Target all devices
# device_serial_numbers: all
brew "curl"
cask "1password"- Target a device group
# device_group_id: e6c10d0-0b13-554c-b976-a05d8a18f0cc
brew "curl"
cask "1password"- Target specific devices by serial numbers1
# device_serial_numbers: AB3456DG90,1234567890
brew "curl"
cask "1password"- Default behavior (no targeting)
brew "curl"
cask "1password"When no device targeting directive is specified, the action treats it as # device_serial_numbers: "none".
your-repo/
├─ brewfiles/
│ ├─ Brewfile-developers
│ ├─ Brewfile-marketing
├─ .github/
│ ├─ workflows/
│ │ ├─ sync-brewfiles.yml
To keep your Brewfiles synced automatically, you’ll create a GitHub Actions workflow in your own repository.
Where to put it Create a file at:
.github/workflows/sync-brewfiles.yml
Below is a complete example workflow you can use as-is.
This workflow runs every time you push changes to files inside your brewfiles/ directory.
name: Sync Brewfiles
on:
push:
branches:
- main
paths:
- 'brewfiles/**'
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: workbrew/[email protected]
with:
api-token: ${{ secrets.WORKBREW_API_TOKEN }}
workspace-name: ${{ secrets.WORKBREW_WORKSPACE_NAME }}
brewfiles-dir: brewfilesImportant You do not copy the
action.ymlfile from this repository. That file defines the Action itself. Your workflow file (sync-brewfiles.yml) uses the Action via:- uses: workbrew/[email protected]
You can run this Action on any GitHub Actions trigger (manually, on a schedule, etc.). For most teams, the setup above is ideal because:
- It only runs when a Brewfile actually changes
- It applies changes immediately after you merge to
main - It keeps your Workbrew Brewfiles in sync with your repo with zero manual steps
By using this software, you agree to the Workbrew Terms of Service and Privacy Policy.
Are you a Workbrew customer struggling to implement this action? Contact your account manager and we're happy to help. Not a Workbrew customer yet? Reach out to talk about becoming one.