name: Bump homebrew greptime version

on:
  workflow_dispatch:
    inputs:
      version:
        description: The version to bump (e.g. v1.0.0)
        required: true
        type: string

jobs:
  bump-homebrew-greptime-version:
    name: Bump homebrew greptime version
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Bump homebrew greptime version
        env:
          GITHUB_TOKEN: ${{ secrets.HOMEBREW_GREPTIME_REPO_TOKEN }}
          VERSION: ${{ inputs.version }}
        run: |
          ./.github/scripts/update-homebrew-greptme-version.sh
