Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/actions/amplify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 3 additions & 1 deletion lib/actions/pullRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down
Loading