Skip to content

Commit 7736d93

Browse files
feat: add linear previews links [DEVOP-330] (#103)
1 parent 185a002 commit 7736d93

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/actions/amplify.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ exports.getAmplifyURIs = async function getAmplifyURI() {
2424
);
2525

2626
if (hasAtLeastOnePackageOrConfig) {
27-
return { links: Object.values(amplifyUris) };
27+
return {
28+
links: Object.entries(amplifyUris).reduce((acc, [label, url]) => {
29+
return { ...acc, label, url };
30+
}, {}),
31+
};
2832
}
2933

3034
const links = [];
3135
const hiddenLinks = [];
3236
for (const label of labels) {
3337
if (amplifyUris[label]) {
34-
links.push(amplifyUris[label]);
38+
links.push({ label, url: amplifyUris[label] });
3539
}
3640
}
3741
for (const [key, url] of Object.entries(amplifyUris)) {

lib/actions/pullRequest.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ exports.validatePR = async function validatePR({ pullRequest, issue }) {
9797
const body =
9898
"AWS Amplify live test URI:\n" +
9999
"- " +
100-
amplifyUris.join("\n- ") +
100+
amplifyUris
101+
.map((elt) => `[${elt.label?.split("/")?.pop()} preview](${elt.url})`)
102+
.join("\n- ") +
101103
hiddenAmplifyText;
102104
const previousComments = comments.filter(({ body }) =>
103105
body.match(/AWS Amplify live/)

0 commit comments

Comments
 (0)