【发布时间】:2021-09-01 14:17:59
【问题描述】:
以下是我的 GitHub 工作流程
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' }}"
问题:test1 和 test2 根据我的提交消息,作业是有条件的,但通知 slack 需要 test1 或 test2。我不能同时放两者,因为如果其中一个作业跳过notify-slack 也会跳过。如何使这项工作?
【问题讨论】:
标签: github-actions