Skip to content

How to send notification on matrix runs #191

@kachar

Description

@kachar

At the moment the matrix runs are triggering a notification for each run and the steps: ${{ toJson(steps) }} ends up having many steps marked 🚫 and only the specific matrix run with ✔️

image

Any idea how to filter and only report the current path in the slack notification.

name: Build packages

on:
  workflow_dispatch:
  push:
    tags:
      - '*'

jobs:

  build-packages:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        image-name:
          - cake-api
          - frontend
          - chatapp
          - landing
          - nginx-proxy

    env:
      IMAGE_NAME: ${{ matrix.image-name }}
      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

    steps:
    - uses: actions/checkout@v2

    - name: Build frontend
      id: build-frontend
      if: ${{ matrix.image-name == 'frontend' }}
      run: docker build ./web/frontend/ --file ./web/frontend/Dockerfile

    - name: Build chatapp
      id: build-chatapp
      if: ${{ matrix.image-name == 'chatapp' }}
      run: docker build ./web/chatapp/ --file ./web/chatapp/Dockerfile

#   ...

    - name: Push image to GitHub Container Registry
      id: push-images-container-registry
      run: 

    - uses: act10ns/slack@v1
      with:
        status: ${{ job.status }}
        steps: ${{ toJson(steps) }}
      if: always()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions