diff --git a/lib/actions/amplify.js b/lib/actions/amplify.js index f5dfb24b..2be2ca78 100644 --- a/lib/actions/amplify.js +++ b/lib/actions/amplify.js @@ -24,14 +24,18 @@ exports.getAmplifyURIs = async function getAmplifyURI() { ); if (hasAtLeastOnePackageOrConfig) { - return { links: Object.values(amplifyUris) }; + return { + links: Object.entries(amplifyUris).reduce((acc, [label, url]) => { + return { ...acc, label, url }; + }, {}), + }; } const links = []; const hiddenLinks = []; for (const label of labels) { if (amplifyUris[label]) { - links.push(amplifyUris[label]); + links.push({ label, url: amplifyUris[label] }); } } for (const [key, url] of Object.entries(amplifyUris)) { diff --git a/lib/actions/pullRequest.js b/lib/actions/pullRequest.js index 8fb5bf5d..48ff605b 100644 --- a/lib/actions/pullRequest.js +++ b/lib/actions/pullRequest.js @@ -97,7 +97,9 @@ exports.validatePR = async function validatePR({ pullRequest, issue }) { const body = "AWS Amplify live test URI:\n" + "- " + - amplifyUris.join("\n- ") + + amplifyUris + .map((elt) => `[${elt.label?.split("/")?.pop()} preview](${elt.url})`) + .join("\n- ") + hiddenAmplifyText; const previousComments = comments.filter(({ body }) => body.match(/AWS Amplify live/)