File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,7 +139,13 @@ jobs:
139139 const commitUrl = sha
140140 ? `https://github.com/${context.repo.owner}/${context.repo.repo}/commit/${sha}`
141141 : `https://github.com/${context.repo.owner}/${context.repo.repo}`;
142- const actor = workflowRun.actor ?? 'workflow_run';
142+ const actorLogin = typeof workflowRun.actor === 'string'
143+ ? workflowRun.actor
144+ : workflowRun.actor?.login;
145+ const actor = actorLogin ?? context.actor ?? 'workflow_run';
146+ const actorLink = workflowRun.actor?.html_url || (actorLogin ? `https://github.com/${actorLogin}` : null);
147+ const actorDisplay = actor.startsWith('@') ? actor : `@${actor}`;
148+ const triggeredBy = actorLink ? `[${actorDisplay}](${actorLink})` : actorDisplay;
143149
144150 const body = [
145151 commentTag,
@@ -149,9 +155,9 @@ jobs:
149155 '| --- | --- |',
150156 `| Branch | \`${branch}\` |`,
151157 `| Commit | [${shortSha}](${commitUrl}) |`,
152- `| Preview | [Open preview]( ${previewUrl}) |`,
158+ `| Preview | <a href=" ${previewUrl}" target="_blank" rel="noopener noreferrer">Open preview</a> |`,
153159 '',
154- `_Triggered by @${actor }_`
160+ `_Triggered by ${triggeredBy }_`
155161 ].join('\n');
156162
157163 const comments = await github.paginate(github.rest.issues.listComments, {
You can’t perform that action at this time.
0 commit comments