From 7d2201561f743da83899ffda366f803fc1020b47 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Tue, 6 Jun 2023 22:45:57 -0700 Subject: [PATCH] chore(devops): add check status for report merger to PRs (#23564) The check summary has a link to the report and a link to the merge workflow run. Otherwise it's very hard to tell which merge workflow corresponds to given PR. --- .github/workflows/create_test_report.yml | 27 ++++++++++++------------ 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/create_test_report.yml b/.github/workflows/create_test_report.yml index 71edcd3bd0..c9c544f7bd 100644 --- a/.github/workflows/create_test_report.yml +++ b/.github/workflows/create_test_report.yml @@ -99,17 +99,16 @@ jobs: }); core.info('Posted comment: ' + response.html_url); - if (context.payload.workflow_run.event === 'push') { - const check = await github.rest.checks.create({ - ...context.repo, - name: '${{ github.event.workflow_run.name }}', - head_sha: context.sha, - status: 'completed', - conclusion: 'success', - details_url: reportUrl, - output: { - title: '"${{ github.event.workflow_run.name }}" test results', - summary: '"${{ github.event.workflow_run.name }}" test results: ' + reportUrl, - } - }); - } + const mergeWorkflowUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; + const check = await github.rest.checks.create({ + ...context.repo, + name: 'Merge report (${{ github.event.workflow_run.name }})', + head_sha: '${{ github.event.workflow_run.head_sha }}', + status: 'completed', + conclusion: 'success', + details_url: reportUrl, + output: { + title: 'Merged test results (${{ github.event.workflow_run.name }})', + summary: `Created [report](${reportUrl}). Merge [workflow run](${mergeWorkflowUrl}).`, + } + });