Skip to content

Commit

Permalink
Bugfix: Sending markdown table correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmhtr committed Dec 12, 2024
1 parent ddf3868 commit 9e22ee2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42506,7 +42506,7 @@ const { getGithubServerUrl } = __nccwpck_require__(5343);
const buildGithubLink = ({ description, path }) => `[${description}](${getGithubServerUrl()}/${path})`;

module.exports = ({
table,
markdownTable,
org,
repos,
isSponsor,
Expand All @@ -42515,7 +42515,7 @@ module.exports = ({
const sources = buildSources({ buildGithubLink, org, repos });
const message = t('table.subtitle', { sources, count: periodLength });
const footer = isSponsor ? '' : `\n\n${t('table.footer')}`;
return `## ${t('table.title')}\n${message}:\n${table}${footer}`;
return `## ${t('table.title')}\n${message}:\n${markdownTable}${footer}`;
};


Expand Down
10 changes: 5 additions & 5 deletions src/interactors/__tests__/buildComment.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Interactors | .buildComment', () => {
it('builds an environment-specific comment using this URL', () => {
process.env.GITHUB_SERVER_URL = 'https://github.example.io';
const expected = `${title}\n${message}\n${TABLE_MOCK}\n\n${FOOTER}`;
const response = buildComment({ periodLength, table: TABLE_MOCK, org: ORG });
const response = buildComment({ periodLength, markdownTable: TABLE_MOCK, org: ORG });
delete process.env.GITHUB_SERVER_URL;
expect(response).toEqual(expected);
});
Expand All @@ -34,7 +34,7 @@ describe('Interactors | .buildComment', () => {

it('builds the message in singular', () => {
const expected = `${title}\n${message}\n${TABLE_MOCK}\n\n${FOOTER}`;
const response = buildComment({ periodLength, table: TABLE_MOCK, org: ORG });
const response = buildComment({ periodLength, markdownTable: TABLE_MOCK, org: ORG });
expect(response).toEqual(expected);
});
});
Expand All @@ -45,7 +45,7 @@ describe('Interactors | .buildComment', () => {

it('builds the message in singular', () => {
const expected = `${title}\n${message}\n${TABLE_MOCK}\n\n${FOOTER}`;
const response = buildComment({ periodLength, table: TABLE_MOCK, org: ORG });
const response = buildComment({ periodLength, markdownTable: TABLE_MOCK, org: ORG });
expect(response).toEqual(expected);
});
});
Expand All @@ -57,7 +57,7 @@ describe('Interactors | .buildComment', () => {

it('builds the message in singular', () => {
const expected = `${title}\n${message}\n${TABLE_MOCK}\n\n${FOOTER}`;
const response = buildComment({ periodLength, table: TABLE_MOCK, repos });
const response = buildComment({ periodLength, markdownTable: TABLE_MOCK, repos });
expect(response).toEqual(expected);
});
});
Expand All @@ -73,7 +73,7 @@ describe('Interactors | .buildComment', () => {
isSponsor,
periodLength,
org: ORG,
table: TABLE_MOCK,
markdownTable: TABLE_MOCK,
});
expect(response).toEqual(expected);
});
Expand Down
4 changes: 2 additions & 2 deletions src/interactors/buildComment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { getGithubServerUrl } = require('../config');
const buildGithubLink = ({ description, path }) => `[${description}](${getGithubServerUrl()}/${path})`;

module.exports = ({
table,
markdownTable,
org,
repos,
isSponsor,
Expand All @@ -14,5 +14,5 @@ module.exports = ({
const sources = buildSources({ buildGithubLink, org, repos });
const message = t('table.subtitle', { sources, count: periodLength });
const footer = isSponsor ? '' : `\n\n${t('table.footer')}`;
return `## ${t('table.title')}\n${message}:\n${table}${footer}`;
return `## ${t('table.title')}\n${message}:\n${markdownTable}${footer}`;
};

0 comments on commit 9e22ee2

Please sign in to comment.