({
owner,
repository,
issue_number,
previewDomain,
appName,
githubId,
previewDeploymentId,
}: CommentCreate)
| 165 | } |
| 166 | |
| 167 | export const createPreviewDeploymentComment = async ({ |
| 168 | owner, |
| 169 | repository, |
| 170 | issue_number, |
| 171 | previewDomain, |
| 172 | appName, |
| 173 | githubId, |
| 174 | previewDeploymentId, |
| 175 | }: CommentCreate) => { |
| 176 | const github = await findGithubById(githubId); |
| 177 | const octokit = authGithub(github); |
| 178 | |
| 179 | const runningComment = getIssueComment( |
| 180 | appName, |
| 181 | "initializing", |
| 182 | previewDomain, |
| 183 | ); |
| 184 | |
| 185 | const issue = await octokit.rest.issues.createComment({ |
| 186 | owner: owner || "", |
| 187 | repo: repository || "", |
| 188 | issue_number: Number.parseInt(issue_number), |
| 189 | body: `### Dokploy Preview Deployment\n\n${runningComment}`, |
| 190 | }); |
| 191 | |
| 192 | return await updatePreviewDeployment(previewDeploymentId, { |
| 193 | pullRequestCommentId: `${issue.data.id}`, |
| 194 | }).then((response) => response[0]); |
| 195 | }; |
| 196 | |
| 197 | /** |
| 198 | * Generate security notification message for blocked PR deployments |
no test coverage detected