MCPcopy
hub / github.com/Dokploy/dokploy / createPreviewDeploymentComment

Function createPreviewDeploymentComment

packages/server/src/services/github.ts:167–195  ·  view source on GitHub ↗
({
	owner,
	repository,
	issue_number,
	previewDomain,
	appName,
	githubId,
	previewDeploymentId,
}: CommentCreate)

Source from the content-addressed store, hash-verified

165}
166
167export 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

Callers 2

deployPreviewApplicationFunction · 0.90

Calls 4

authGithubFunction · 0.90
updatePreviewDeploymentFunction · 0.90
findGithubByIdFunction · 0.85
getIssueCommentFunction · 0.85

Tested by

no test coverage detected