From 8d7f2dbe96d97c38bdadca714e923a388594c511 Mon Sep 17 00:00:00 2001 From: Abdurrahman Rajab Date: Wed, 4 Oct 2023 02:32:34 +0300 Subject: [PATCH] ci: add comment message in tests (#26364) --- .github/workflows/intelligent-tests-pr.yml | 33 ++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/intelligent-tests-pr.yml b/.github/workflows/intelligent-tests-pr.yml index d133940967963..3e38dda88d2fd 100644 --- a/.github/workflows/intelligent-tests-pr.yml +++ b/.github/workflows/intelligent-tests-pr.yml @@ -1,7 +1,7 @@ name: intelligent-tests-pr on: workflow_dispatch: - pull_request: + pull_request_target: types: [labeled, opened, synchronize, reopened, review_requested] permissions: @@ -26,15 +26,44 @@ jobs: cat combined_test_results.txt - name: New Failures Introduced + id: ci_output run: | find . -name "new_failures_*.txt" -exec cat {} + > combined_failures.txt if [ -s combined_failures.txt ] then echo "This PR introduces the following new failing tests:" cat combined_failures.txt + { + echo 'MESSAGE<> "$GITHUB_OUTPUT" else - echo "This PR does not introduce any new test failures! Yippee!" + echo "MESSAGE=This pull request does not result in any additional test failures. Congratulations!" >> "$GITHUB_OUTPUT" fi + - name: Find Comment + uses: peter-evans/find-comment@v2 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: + + - name: Create or update comment + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + Thank you for this PR, here is the CI results: + + ------------- + ${{ steps.ci_output.outputs.MESSAGE}} + + + edit-mode: replace run_tests: runs-on: ubuntu-latest