fix(build): fix curl data and gha statuses/expressions

This commit is contained in:
Arthur Meyre
2021-09-09 09:51:07 +02:00
parent fcaa141d2e
commit e13347affc
2 changed files with 5 additions and 9 deletions

View File

@@ -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

View File

@@ -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