diff --git a/.github/workflows/cron_api.yml b/.github/workflows/cron_api.yml index 56b5530bf7..7b2d5f4f81 100644 --- a/.github/workflows/cron_api.yml +++ b/.github/workflows/cron_api.yml @@ -59,29 +59,24 @@ jobs: working-directory: build run: make -k 2>&1 | tee build.log - - name: Process Log - if: failure() - run: | - FILE=".github/ISSUE_TEMPLATE/cron_comment_template.md" - python3 .github/workflows/scripts/process_compiler_error_log.py build/build.log >> ${FILE} - - name: Create comment body - if: failure() id: comment-body run: | - FILE=".github/ISSUE_TEMPLATE/cron_comment_template.md" - URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" - sed -i "s@{{ build }}@${{ matrix.build }}@" $FILE - sed -i "s@{{ compiler }}@${{ matrix.compiler }}@" $FILE - sed -i "s@{{ url }}@$URL@" $FILE - echo "body<> $GITHUB_OUTPUT - cat $FILE >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - - name: Create comment body - if: success() - id: comment-body - run: echo "body=Success ${{ matrix.build }} on ${{ matrix.compiler }}" >> $GITHUB_OUTPUT + if [[ "${{ job.status }}" == "success" ]]; then + echo "body=Success ${{ matrix.build }} on ${{ matrix.compiler }}" >> $GITHUB_OUTPUT + else + FILE=".github/ISSUE_TEMPLATE/cron_comment_template.md" + python3 .github/workflows/scripts/process_compiler_error_log.py build/build.log >> ${FILE} + echo "body=Failure ${{ matrix.compiler }}" + fi >> $GITHUB_OUTPUT + URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" + sed -i "s@{{ build }}@${{ matrix.build }}@" $FILE + sed -i "s@{{ compiler }}@${{ matrix.compiler }}@" $FILE + sed -i "s@{{ url }}@$URL@" $FILE + echo "body<> $GITHUB_OUTPUT + cat $FILE >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + fi - name: Reopen issue if: failure()