Skip to content

Commit 518bc31

Browse files
committed
feat: add PDF export functionality for pull request summaries
Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
1 parent 8bfd0a1 commit 518bc31

File tree

4 files changed

+472
-1
lines changed

4 files changed

+472
-1
lines changed

keploy-github-app-beta/index.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { promptUserConfig } from './src/cli.js';
1414
import { reviewPR } from './diffparser.js';
1515
import { handleLintWorkflowTrigger } from "./lint.js";
1616
import { App, Config, GithubContext } from "./types.js";
17+
import { savePrAsPdf } from "./pdf-export.js";
1718

1819
let config: Config;
1920

@@ -44,6 +45,24 @@ export default async (app: App) => {
4445
await reviewPR(context as any, app, llmOutput);
4546
// await reviewPR(context, app);
4647

48+
// Export PR data to PDF
49+
try {
50+
const { owner, repo } = context.repo();
51+
const prNumber = context.payload.pull_request.number;
52+
const pdfFilename = await savePrAsPdf(prData, owner, repo, prNumber);
53+
app.log.info(`PR exported to PDF: ${pdfFilename}`);
54+
55+
// Post comment with PDF info
56+
await context.octokit.issues.createComment({
57+
owner,
58+
repo,
59+
issue_number: prNumber,
60+
body: `📄 PR summary has been exported as PDF: ${pdfFilename}`
61+
});
62+
} catch (pdfError) {
63+
app.log.error("Failed to export PR as PDF", pdfError);
64+
}
65+
4766
// Run all workflow triggers in parallel
4867
await Promise.all([
4968
handleKeployWorkflowTrigger(context),
@@ -58,4 +77,4 @@ export default async (app: App) => {
5877
if (app.on) {
5978
app.on(["pull_request.opened", "pull_request.synchronize"], handlePrEvent);
6079
}
61-
};
80+
};

0 commit comments

Comments
 (0)