Skip to content

Commit

Permalink
chore(devops): add check status for report merger to PRs (#23564)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yury-s authored Jun 7, 2023
1 parent 0b30f20 commit 7d22015
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/create_test_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}).`,
}
});

0 comments on commit 7d22015

Please sign in to comment.