()
| 67 | } |
| 68 | |
| 69 | async function comment() { |
| 70 | let commentBody = `\ |
| 71 | ${STICKY_MARKER} |
| 72 | ### Preview Build Available |
| 73 | |
| 74 | Preview builds have been created for this PR. You can install \`react-router\` using: |
| 75 | |
| 76 | \`\`\`sh |
| 77 | pnpm install "remix-run/react-router#${branch}&path:packages/react-router" |
| 78 | \`\`\` |
| 79 | |
| 80 | And/or install other packages via: |
| 81 | |
| 82 | \`\`\`sh |
| 83 | pnpm install "remix-run/react-router#${branch}&path:packages/react-router-dev" |
| 84 | pnpm install "remix-run/react-router#${branch}&path:packages/react-router-express" |
| 85 | pnpm install "remix-run/react-router#${branch}&path:packages/react-router-node" |
| 86 | pnpm install "remix-run/react-router#${branch}&path:packages/react-router-serve" |
| 87 | \`\`\` |
| 88 | |
| 89 | These preview builds will be updated automatically as you push new commits.`; |
| 90 | |
| 91 | // Get existing comments |
| 92 | let comments = await getPrComments(prNumber); |
| 93 | |
| 94 | // Only add a comment if one doesn't already exist |
| 95 | let stickyComment = comments.find((comment) => |
| 96 | comment.body?.includes(STICKY_MARKER), |
| 97 | ); |
| 98 | if (stickyComment) { |
| 99 | console.log("Updating preview comment on PR"); |
| 100 | await updatePrComment(stickyComment.id, commentBody); |
| 101 | } else { |
| 102 | console.log("Adding preview comment to PR"); |
| 103 | await createPrComment(prNumber, commentBody); |
| 104 | } |
| 105 | |
| 106 | // Delete cleanup comment if it exists |
| 107 | let cleanupComment = comments.find((comment) => |
| 108 | comment.body?.includes(CLEANUP_MARKER), |
| 109 | ); |
| 110 | if (cleanupComment) { |
| 111 | console.log("Deleting existing cleanup comment"); |
| 112 | await deletePrComment(cleanupComment.id); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | async function cleanup() { |
| 117 | console.log(`Deleted branch: ${branch}`); |
nothing calls this directly
no test coverage detected