env:
  GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
  VERSION: ${{ github.event.client_payload.ref }}
  COMMIT_SHA: ${{ github.event.client_payload.commitSha }}

on:
  repository_dispatch:
    types:
      - homebrew-bump

jobs:
  homebrew:
    name: Bump Homebrew formula
    runs-on: ubuntu-latest
    steps:
      - uses: dawidd6/action-homebrew-bump-formula@v3
        with:
          token: ${{secrets.PULUMI_BOT_TOKEN}}
          formula: pulumi
          tag: v${{env.VERSION}}
          revision: ${{env.COMMIT_SHA}}
