on:
  push:
    branches:
      - main
jobs:
  job1:
    runs-on: ubuntu-latest
    steps:
      - run: echo 'job1'
  job2:
    runs-on: ubuntu-latest
    steps:
      - run: echo 'job2'
  job3:
    runs-on: ubuntu-latest
    steps:
      - run: echo 'job3'
  notify:
    if: always()
    needs: [job1, job2, job3]
    runs-on: ubuntu-latest
    steps:
      - uses: ScribeMD/slack-templates@0
        with:
          bot-token: ${{ secrets.SLACK_TEMPLATES_BOT_TOKEN }}
          channel-id: ${{ secrets.SLACK_TEMPLATES_CHANNEL_ID }}
          template: result
          results: "${{ join(needs.*.result, ' ') }}"
