Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Add Org/Repo to Default Heading (#34)
Browse files Browse the repository at this point in the history
closes #32
closes #33
  • Loading branch information
therynamo authored May 3, 2019
1 parent e802ec5 commit 9c459c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

const { stripIndents } = require('common-tags');

const DEFAULT_HEADING = `🚀 *Deployed to production!* Related stories:\n _PRs need correct syntax to appear in the list. Problem? Please report it <https://github.com/target/captains-log/issues|here>._
const DEFAULT_HEADING = (
strings,
owner,
repo,
) => `🚀 *${owner}/${repo} deployed to production!* Related stories:\n _PRs need correct syntax to appear in the list. Problem? Please report it <https://github.com/target/captains-log/issues|here>._
`;

const EMPTY_MESSAGE = stripIndents`\n
*No Jira stories linked in this release.* 🤷‍♀️ \n
*No stories linked in this release.* 🤷‍♀️ \n
_Think something is broken? Report it <https://github.com/target/captains-log/issues|here>._
`;
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
const defaultTeam = Team();
const teamList = teams.length ? teams.map(team => Team(team)) : [];

const createAttachment = (hasMessages) => {
const createAttachment = (hasMessages, { owner, repo }) => {
let message = EMPTY_MESSAGE;
let attachments = {};

Expand All @@ -20,7 +20,7 @@ const createAttachment = (hasMessages) => {
}

// add all the PRs if there are any
message = DEFAULT_HEADING;
message = DEFAULT_HEADING`${owner}/${repo}`;
attachments = [];

const teamsToAttach = [...teamList, defaultTeam];
Expand Down Expand Up @@ -74,7 +74,7 @@ module.exports = async function App(config) {

populateMessages(defaultTeam)(teamList, sortedMessages);

const { message, attachments } = createAttachment(messages.length);
const { message, attachments } = createAttachment(messages.length, { owner, repo });

logger.info(`\n Slack Formatter Url. CMD+Click to open in your default browser \n \n ${generateSlackFormatterUrl(attachments)}`);

Expand Down

0 comments on commit 9c459c3

Please sign in to comment.