Below is my GitHub workflow
name: APP Build
on:
push:
branches:
- feature/test
jobs:
test-1:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && contains( github.event.head_commit.message, 'test1') }}
steps:
- name: test-fail
run: echo "test1"
test-2:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && contains( github.event.head_commit.message, 'test2') }}
steps:
- name: test-fail
run: echo "test1"
notify-slack:
name: Slack Notification
runs-on: ubuntu-latest
needs: [test-1, test-2]
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2.2.0
env:
SLACK_CHANNEL: alert
SLACK_COLOR: "${{ job.status == 'success' && 'good' || 'danger' }}"
Question: test1 and test2 job is conditional as per my commit message but notify slack need either test1 or test2. I can't put both because if either the job skip notify-slack will skip as well. How to make this work?