name: trigger-merge-to-downstream

on:
  push:
    branches:
      - main
      - release/**

permissions:
  contents: read

jobs:
  trigger-merge:
    if: github.repository == 'hashicorp/boundary'
    runs-on: ${{ fromJSON(vars.RUNNER) }}
    env:
      DOWNSTREAM_SLUG: ${{ vars.DOWNSTREAM_SLUG }}
      DOWNSTREAM_TOK: ${{ secrets.DOWNSTREAM_TOK }}
      DOWNSTREAM_WORKFLOW: ${{ vars.DOWNSTREAM_WORKFLOW }}
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
      - name: Trigger Merge
        run: |
          ./scripts/trigger-merge-to-downstream-gha ${{ github.ref_name }}
