diff --git a/.github/actions/acc_test/action.yaml b/.github/actions/acc_test/action.yaml index 614e186f..9a80b0ed 100644 --- a/.github/actions/acc_test/action.yaml +++ b/.github/actions/acc_test/action.yaml @@ -71,7 +71,7 @@ outputs: description: "the output of the tests" status: - value: ${{ steps.testrun.status }} + value: ${{ steps.status.status }} description: "the status of the tests" runs: @@ -239,10 +239,9 @@ runs: echo "Test failed, see acc_test_run.log for details" res=$(cat acc_test_run.log | grep -v "=== RUN" | grep -v "\-\-\- PASS" | grep -v "=== CONT" | grep -v "=== PAUSE") echo "result=FAIL: ${res}" >> "$GITHUB_OUTPUT" - echo "status=FAILED" >> "$GITHUB_OUTPUT" exit 1 else - echo "status=SUCCESS" >> "$GITHUB_OUTPUT" + echo "result=no FAIL detected" >> "$GITHUB_OUTPUT" fi echo "::endgroup::" env: @@ -254,6 +253,13 @@ runs: TF_ACC_KEK_KEY_VERSION: ${{ inputs.tf_acc_kek_key_version }} TF_ACC_KEK_SERVICE_ACCOUNT: ${{ inputs.tf_acc_kek_service_account }} + - name: Set status output variable + if: always() + id: status + shell: bash + run: | + echo "status=${{ steps.testrun.outcome == 'success' && 'SUCCESS' || 'FAILURE' }}" >> "$GITHUB_OUTPUT" + - name: Upload test log artifact if: always() uses: actions/upload-artifact@v3 diff --git a/.github/actions/notify/action.yaml b/.github/actions/notify/action.yaml index d365ac1c..fe1fc703 100644 --- a/.github/actions/notify/action.yaml +++ b/.github/actions/notify/action.yaml @@ -84,7 +84,7 @@ runs: PAYLOAD=$(jq -n -r \ --arg header "${{ inputs.title }}" \ - --arg subtitle "${{ inputs.subtitle || '' }}" \ + --arg subtitle "${{ inputs.subtitle }}" \ --arg imgurl "https://cdn.simpleicons.org/${{ inputs.image_slug }}/${{ steps.status.outputs.color }}" \ --arg title "${{ inputs.event_title || 'no event title given' }}" \ --arg body "${{ inputs.event_body || 'no event body given' }}" \ diff --git a/.github/workflows/tf-acc-test.yaml b/.github/workflows/tf-acc-test.yaml index dcade21b..d7175145 100644 --- a/.github/workflows/tf-acc-test.yaml +++ b/.github/workflows/tf-acc-test.yaml @@ -93,7 +93,7 @@ jobs: subtitle: "${{ forgejo.event_name == 'workflow_dispatch' && steps.manual_run.outputs.status || steps.automatic_run.outputs.status }}" event_title: ${{ forgejo.event_name }} event_author: ${{ forgejo.actor }} - event_body: "${{ steps.automatic_run.outputs.result || steps.manual_run.outputs.result }}" + event_body: "${{ forgejo.event_name == 'workflow_dispatch' && steps.manual_run.outputs.result || steps.automatic_run.outputs.result }}" event_number: ${{ forgejo.event.id }} event_url: "https://tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/actions/runs/${{ forgejo.run_number }}" status: "${{ forgejo.event_name == 'workflow_dispatch' && steps.manual_run.outputs.status || steps.automatic_run.outputs.status }}"