name: Create prefect-helm release

on:
  # As soon as this repo creates an official release, we will
  # create a corresponding release in the helm chart repo
  release:
    types: [released]

jobs:
  create_helm_release:
    if: startsWith(github.ref, 'refs/tags/3.')
    runs-on: ubuntu-latest
    steps:
      - name: Create prefect-helm release
        run: |
          gh workflow run helm-release.yaml \
            --repo PrefectHQ/prefect-helm \
            --ref main
        env:
          GH_TOKEN: ${{ secrets.PREFECT_HELM_ACTIONS_RW }}
