name: Homebrew
on:
  release:
    types: [published]

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
    - name: Notify Homebrew Repo 🙋🏾‍♀️
      uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
      with:
        github-token: ${{ secrets.GH_PAT }}
        script: |
          await github.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', {
            owner: 'jandedobbeleer',
            repo: 'homebrew-oh-my-posh',
            workflow_id: 'release.yml',
            ref: 'main',
            inputs: {"version": process.env.GITHUB_REF.replace('refs/tags/v', '')}
          })
