From b89c173f7a5ecca1094b9ddf4a83a2e4c8df946b Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Thu, 27 Feb 2025 15:05:22 +1100 Subject: [PATCH] Fix API test slack notification --- .github/workflows/api.yml | 1 + .github/workflows/notify_slack.yml | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index 40edc531..5ef923e6 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -105,6 +105,7 @@ jobs: needs: [api] secrets: inherit with: + state: ${{ needs.api.result }} workflow_name: BE API workflow_id: ${{ inputs.id }} workflow_reusable_name: "run_api_be" diff --git a/.github/workflows/notify_slack.yml b/.github/workflows/notify_slack.yml index 1217aadc..25a87565 100644 --- a/.github/workflows/notify_slack.yml +++ b/.github/workflows/notify_slack.yml @@ -40,15 +40,26 @@ on: description: Name of the report file type: string required: true + state: + description: Check state to set + type: string + required: false + default: "" jobs: slack_notify: name: sdp-test-report runs-on: ubuntu-latest if: always() steps: + - name: Set explicitly provided workflow state + if: ${{ inputs.state != '' }} + run: | + echo "WORKFLOW_CONCLUSION=${{ inputs.state }}" >> $GITHUB_ENV - name: Wait 15s for previous jobs to conclude + if: ${{ inputs.state == '' }} run: sleep 15 - uses: dpc-sdp/workflow-conclusion-action@main + if: ${{ inputs.state == '' }} with: JOB_ID: ${{ inputs.workflow_id }} REUSABLE_WORKFLOW_NAME: ${{ inputs.workflow_reusable_name }}