name: bun-homebrew
on:
  release:
    types:
      - published
jobs:
  docker:
    runs-on: ubuntu-latest
    if: github.repository_owner == 'oven-sh'
    steps:
      - id: checkout
        name: Checkout
        uses: actions/checkout@v3
        with:
          repository: oven-sh/homebrew-bun
          token: ${{ env.HOMEBREW_TOKEN }}
      - id: setup-ruby
        name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: '2.6'
      - id: update-tap
        name: Update Tap
        run: ruby scripts/release.rb "${{ github.event.release.tag_name }}"
      - id: commit-tap
        name: Commit Tap
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Release ${{ github.event.release.tag_name }}
