name: Post message to Zulip

on:
  workflow_dispatch:
    inputs:
      message:
        description: 'Message to post to Zulip'
        required: false
        default: 'Test Auto release notification of IPython from GitHub action'
        type: string

jobs:
  post-message:
    name: Post Message to Zulip
    runs-on: ubuntu-latest

    steps:

      - name: Send Zulip notification
        uses: zulip/github-actions-zulip/send-message@v1
        with:
          api-key: ${{ secrets.ORG_ZULIP_API_KEY }}
          email: ${{ secrets.ORG_ZULIP_EMAIL }}
          organization-url: ${{ secrets.ORG_ZULIP_ORGANIZATION_URL }}
          to: 'Releases'
          type: 'stream'
          topic: 'IPython'
          content: |
            ${{ inputs.message }}
