From 5738878a2504b4896d8d9e93d2b7ec01862af310 Mon Sep 17 00:00:00 2001 From: Ryan Fischbach Date: Tue, 27 Jun 2023 08:23:27 -0700 Subject: [PATCH] gha: standardize build results. --- .github/workflows/build-image-result.yml | 26 +++++++++++------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-image-result.yml b/.github/workflows/build-image-result.yml index 6a5b49d..a70fec9 100644 --- a/.github/workflows/build-image-result.yml +++ b/.github/workflows/build-image-result.yml @@ -7,21 +7,19 @@ on: - build_image_error jobs: - build_success: - if: github.event.client_payload.error_msg == '' + build_result: + name: "Build Result [#${{ github.event.client_payload.run_number }}]" runs-on: ubuntu-latest + env: + RUN_URL: "[Run #${{ github.event.client_payload.run_number }}](${{ github.event.client_payload.run_url }})" steps: - - name: Display Msg + - name: "Display Error Msg" + if: github.event.client_payload.error_msg != '' run: |- - echo "::notice::${{ github.event.client_payload.name }} image built with tag [${{ github.event.client_payload.tag }}]" - #endjob build_success - - build_error: - if: github.event.client_payload.error_msg != '' - runs-on: ubuntu-latest - steps: - - name: Display Msg - run: |- - echo "${{ github.event.client_payload.error_msg }}" + echo -e "::error::${RUN_URL}%0A${{ github.event.client_payload.error_msg }}" exit 1 - #endjob build_error + - name: "Display Success Msg" + if: github.event.client_payload.build_msg != '' + run: |- + echo -e "::notice::${RUN_URL}%0A${{ github.event.client_payload.build_msg }}" + #endjob build_result