Skip to content

Commit

Permalink
cogs.utils.github: Only include failed/cancelled jobs in CI message
Browse files Browse the repository at this point in the history
  • Loading branch information
derrod committed Aug 27, 2023
1 parent 1322746 commit 3e23ac8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions obsbot/cogs/public/utils/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,10 @@ async def get_ci_results(self, event_body):
build_result = 'failed'
message = [f'All jobs failed after {minutes}m{seconds}s']

if succeeded := [job['name'] for job in jobs if job['conclusion'] == 'success']:
message.append('**Succeeded:** {}'.format(', '.join(succeeded)))
if skipped := [job['name'] for job in jobs if job['conclusion'] == 'skipped']:
message.append('**Skipped:** {}'.format(', '.join(skipped)))
if skipped := [job['name'] for job in jobs if job['conclusion'] == 'cancelled']:
message.append('**Cancelled:** {}'.format(', '.join(skipped)))
message.append('\n**Cancelled:**\n- {}'.format('\n- '.join(sorted(skipped))))
if failed := [job['name'] for job in jobs if job['conclusion'] not in {'success', 'skipped', 'cancelled'}]:
message.append('**Failed:** {}'.format(', '.join(failed)))
message.append('\n**Failed:**\n- {}'.format('\n- '.join(sorted(failed))))

artifacts = await self.get_with_retry(run['artifacts_url'])
if not artifacts:
Expand Down

0 comments on commit 3e23ac8

Please sign in to comment.