Skip to content

Commit

Permalink
use slack url helper
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Mar 15, 2021
1 parent eaf28cb commit 24aebea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/slack/src/index.ts
@@ -1,5 +1,5 @@
import { RestEndpointMethodTypes } from "@octokit/rest";
import { githubToSlack } from "@atomist/slack-messages";
import { githubToSlack, url } from "@atomist/slack-messages";
import createHttpsProxyAgent, { HttpsProxyAgent } from "https-proxy-agent";

import {
Expand Down Expand Up @@ -331,14 +331,15 @@ export default class SlackPlugin implements IPlugin {
);
const urls = releases.map(
(release) =>
`*<${release.data.html_url}|${
`*${url(
release.data.html_url,
release.data.name || release.data.tag_name
}>*`
)}*`
);
const releaseUrl =
urls.length > 1
? urls.join(", ")
: `<${releases[0].data.html_url}|View Release>`;
: `${url(releases[0].data.html_url, 'View Release')}`;

// First add context to share link to release
messages[0].unshift(
Expand Down

0 comments on commit 24aebea

Please sign in to comment.