Skip to content

Commit

Permalink
Improve output for DMOJ uses
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum5 authored Oct 1, 2020
1 parent d950b71 commit b4d87de
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { context } = require('@actions/github');

function buildSlackAttachments({ status, color, github }) {
const { payload, ref, workflow, eventName } = github.context;
const { payload, ref, workflow, eventName, actor } = github.context;
const { owner, repo } = context.repo;
const event = eventName;
const branch = event === 'pull_request' ? payload.pull_request.head.ref : ref.replace('refs/heads/', '');
Expand Down Expand Up @@ -37,12 +37,14 @@ function buildSlackAttachments({ status, color, github }) {
},
referenceLink,
{
title: 'Event',
value: event,
title: 'Author',
value: `<https://github.com/${actor} | ${actor}>`,
short: true,
},
],
footer_icon: 'https://github.githubassets.com/favicon.ico',
username: 'GitHub Actions',
icon_url: '',
footer_icon: 'https://image.flaticon.com/icons/png/512/25/25231.png',
footer: `<https://github.com/${owner}/${repo} | ${owner}/${repo}>`,
ts: Math.floor(Date.now() / 1000),
},
Expand Down

0 comments on commit b4d87de

Please sign in to comment.