| 
44 | 44 |            run_id: ${{ github.event.workflow_run.id }}  | 
45 | 45 |            path: artifacts  | 
46 | 46 | 
 
  | 
47 |  | -      - name: Report test status - In Progress  | 
48 |  | -        id: report_test_status  | 
49 |  | -        uses: actions/github-script@v7  | 
50 |  | -        with:  | 
51 |  | -          script: |  | 
52 |  | -            const check_run = await github.rest.checks.create({  | 
53 |  | -              owner: context.repo.owner,  | 
54 |  | -              repo: context.repo.repo,  | 
55 |  | -              name: "Summarize test report",  | 
56 |  | -              head_sha: "${{ github.event.workflow_run.head_commit.id }}",  | 
57 |  | -              status: "in_progress",  | 
58 |  | -              conclusion: "neutral",  | 
59 |  | -              output: {  | 
60 |  | -                title: "Test Summary",  | 
61 |  | -                summary: "Test report is currently being processed."  | 
62 |  | -              }  | 
63 |  | -            });  | 
64 |  | -            return check_run.data.id;  | 
65 |  | -
  | 
66 | 47 |       - name: Set Test Run URL  | 
67 | 48 |         id: set_test_run_url  | 
68 | 49 |         run: echo "test_run_url=${{ github.event.workflow_run.html_url }}" >> $GITHUB_OUTPUT  | 
@@ -117,33 +98,20 @@ jobs:  | 
117 | 98 | 
 
  | 
118 | 99 |       - name: Complete report test status  | 
119 | 100 |         if: always()  | 
120 |  | -        id: update_parent_workflow_status  | 
121 |  | -        run: |  | 
122 |  | -          # Path to the summary file (from the previous step output)  | 
123 |  | -          summary_file="${{ steps.summarize_test_results.outputs.summary_file }}"  | 
124 |  | -          echo "Contents of the summary file:"  | 
125 |  | -          cat "$summary_file"  | 
126 |  | -
  | 
127 |  | -          # Get the parent workflow ID from the current workflow_run context  | 
128 |  | -          parent_workflow_run_id="${{ github.event.workflow_run.id }}"  | 
129 |  | -
  | 
130 |  | -          # Log the parent workflow run ID for debugging  | 
131 |  | -          echo "Updating parent workflow run ID: $parent_workflow_run_id"  | 
132 |  | -
  | 
133 |  | -          # Update the parent workflow run with the summary content  | 
134 |  | -          echo "Updating the parent workflow run with the test report summary."  | 
135 |  | -
  | 
136 |  | -          curl -X PATCH \  | 
137 |  | -            -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \  | 
138 |  | -            -d @- \  | 
139 |  | -            https://api.github.com/repos/${{ github.repository }}/actions/runs/$parent_workflow_run_id \  | 
140 |  | -            <<EOF  | 
141 |  | -          {  | 
142 |  | -            "status": "completed",  | 
143 |  | -            "conclusion": "${{ job.status }}",  | 
144 |  | -            "output": {  | 
145 |  | -              "title": "Test Results Summary",  | 
146 |  | -              "summary": "$(cat "$summary_file" | sed 's/"/\\"/g' | sed 's/\n/\\n/g')"  | 
147 |  | -            }  | 
148 |  | -          }  | 
149 |  | -          EOF  | 
 | 101 | +        id: report_test_status  | 
 | 102 | +        uses: actions/github-script@v7  | 
 | 103 | +        with:  | 
 | 104 | +          script: |  | 
 | 105 | +            const check_run = await github.rest.checks.create({  | 
 | 106 | +              owner: context.repo.owner,  | 
 | 107 | +              repo: context.repo.repo,  | 
 | 108 | +              name: "Summarize test report",  | 
 | 109 | +              head_sha: "${{ github.event.workflow_run.head_commit.id }}",  | 
 | 110 | +              status: "completed",  | 
 | 111 | +              conclusion: "${{ job.status }}",  | 
 | 112 | +              output: {  | 
 | 113 | +                title: "Test Summary",  | 
 | 114 | +                summary: "$(cat "${{ steps.summarize_test_results.outputs.summary_file }}" | sed 's/"/\\"/g' | sed 's/\n/\\n/g')"  | 
 | 115 | +              }  | 
 | 116 | +            });  | 
 | 117 | +            return check_run.data.id;  | 
0 commit comments