name: notify-teams-on-pr
on:
  pull_request:
    types: [opened]
jobs:
  notify-teams:
    name: notify
    runs-on: ubuntu-latest
    timeout-minutes: 5
    if: github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false
    steps:
      - name: Send PR to teams channel
        uses: aliencube/microsoft-teams-actions@v0.8.0
        with:
          webhook_uri: ${{ secrets.TEAMS_PR_WEBHOOK_URI }}
          title: ${{ github.event.pull_request.title }}
          summary: ${{ github.event.pull_request.title }}
          text: ${{ github.event.pull_request.body }}
          theme_color: "009933"
          actions: '[{"@type":"OpenUri","name":"View PR","targets":[{"os":"default","uri":"${{ github.event.pull_request.html_url }}"}]},{"@type":"OpenUri","name":"View Workflows","targets":[{"os":"default","uri":"https://github.com/${{ github.repository }}/actions?query=branch%3A${{ github.head_ref }}"}]}]'
