diff --git a/.github/workflows/build-and-release-stable.yml b/.github/workflows/build-and-release-stable.yml index 37f0e154d9b..a4a5113feef 100644 --- a/.github/workflows/build-and-release-stable.yml +++ b/.github/workflows/build-and-release-stable.yml @@ -191,7 +191,7 @@ jobs: email-on-failure: needs: [update-rest-api-docs, update-graphql-docs, build, ctlrelease, call-dde-release-workflow, call-helm-chart-releaser, email-meshery-release-notes-workflow, call-cncf-playground-rollout] - if: ${{ always() }} + if: ${{ failure() }} runs-on: ubuntu-latest steps: - name: Find failed jobs. @@ -199,13 +199,13 @@ jobs: curl "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" | jq -r '.jobs[] | select(.conclusion == "failure") | "\(.name): \(.steps[] | select(.conclusion == "failure") | .name)\n\(.html_url)\n"' >> output.txt # Save multi-line environment variables by using the delimiters syntex. echo "EMAIL_BODY<> $GITHUB_ENV - echo "EMAIL_BODY=$(cat ./output.txt)" >> $GITHUB_ENV + echo "$(cat ./output.txt)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: Failed jobs summary run: | echo "${{ env.EMAIL_BODY }}" - name: Send Email Notification - if: ${{ env.EMAIL_BODY != '' }} + if: env.EMAIL_BODY != '' uses: dawidd6/action-send-mail@v3 with: server_address: smtp.gmail.com