Skip to content

Workbrew/sync-brewfiles-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

Sync Brewfiles to Workbrew

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.

How it works

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:

  1. Target all devices
# device_serial_numbers: all
brew "curl"
cask "1password"
  1. Target a device group
# device_group_id: e6c10d0-0b13-554c-b976-a05d8a18f0cc
brew "curl"
cask "1password"
  1. Target specific devices by serial numbers1
# device_serial_numbers: AB3456DG90,1234567890
brew "curl"
cask "1password"
  1. Default behavior (no targeting)
brew "curl"
cask "1password"

When no device targeting directive is specified, the action treats it as # device_serial_numbers: "none".

Repository structure

your-repo/
├─ brewfiles/
│  ├─ Brewfile-developers
│  ├─ Brewfile-marketing
├─ .github/
│  ├─ workflows/
│  │  ├─ sync-brewfiles.yml

GitHub Actions workflow (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: brewfiles

Important You do not copy the action.yml file from this repository. That file defines the Action itself. Your workflow file (sync-brewfiles.yml) uses the Action via:

- uses: workbrew/[email protected]

Why this trigger?

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.

Footnotes

  1. You can get device serial numbers from either the API (Pro & Enterprise) or by manually exporting on the Device Groups page (Enterprise only).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •