From e13347affc2363fcdc54351efac0f767bae00a86 Mon Sep 17 00:00:00 2001 From: Arthur Meyre Date: Thu, 9 Sep 2021 09:51:07 +0200 Subject: [PATCH] fix(build): fix curl data and gha statuses/expressions --- .github/workflows/continuous-integration.yaml | 7 ++----- .github/workflows/docker-env.yaml | 7 +++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 6c3a9df84..6d6d55ee1 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -106,17 +106,14 @@ jobs: path: diff-coverage.txt recreate: true - name: Trigger docker push workflow - if: ${{ github.event_name == 'repository_dispatch' && github.event.event_type == 'env-docker-preflight' }} - env: - WORKFLOW_SUCCESSFUL: toJSON(success()) + if: ${{ always() && github.event_name == 'repository_dispatch' && github.event.event_type == 'env-docker-preflight' }} run: | curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token ${{ secrets.BOT_TOKEN }}" \ https://api.github.com/repos/${{ github.repository }}/dispatches \ - -d '{"event_type":"publish-env-docker"}' \ - -d '{"client_payload": {"preflight_success":"${{ env.WORKFLOW_SUCCESSFUL }}"}}' + -d '{"event_type":"publish-env-docker","client_payload":{"preflight_status":"${{ job.status }}"}}' - name: Slack Notification if: ${{ always() }} continue-on-error: true diff --git a/.github/workflows/docker-env.yaml b/.github/workflows/docker-env.yaml index cd23ffec4..7632a18c1 100644 --- a/.github/workflows/docker-env.yaml +++ b/.github/workflows/docker-env.yaml @@ -62,8 +62,7 @@ jobs: -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token ${{ secrets.BOT_TOKEN }}" \ https://api.github.com/repos/${{ github.repository }}/dispatches \ - -d '{"event_type":"env-docker-preflight"}' \ - -d '{"client_payload": {"image":"${{ env.PREFLIGHT_IMAGE }}"}}' + -d '{"event_type":"env-docker-preflight","client_payload":{"image":"${{ env.PREFLIGHT_IMAGE }}"}}' - name: Slack Notification if: ${{ always() }} continue-on-error: true @@ -90,9 +89,9 @@ jobs: steps: - name: Check build went well with preflight image env: - CHECKS_OK: ${{ github.event.client_payload.preflight_success }} + PREFLIGHT_STATUS: ${{ github.event.client_payload.preflight_status }} run: | - if [[ "${CHECKS_OK}" == "false" ]]; then + if [[ "${PREFLIGHT_STATUS}" != "success" ]]; then echo "Build with new image failed, aborting." exit 1 fi