Skip to content

Commit fa9a488

Browse files
authored
feat(code): add attribution to PR body from UI (#1433)
## Problem #1431 adds commit trailers when committing via UI, #1432 adds trailers + PR body instructions for agent now we need to add PR body footer when creating a PR via UI <!-- Who is this for and what problem does it solve? --> <!-- Closes #ISSUE_ID --> ## Changes appends "created by posthog code" to PR body when creating from UI <!-- What did you change and why? --> <!-- If there are frontend changes, include screenshots. --> ## How did you test this? <!-- Describe what you tested -- manual steps, automated tests, or both. --> <!-- If you're an agent, only list tests you actually ran. --> PostHog/posthog#53123
1 parent 18ce420 commit fa9a488

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/code/src/main/services/git/service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,13 @@ export class GitService extends TypedEventEmitter<GitServiceEvents> {
767767
body?: string,
768768
draft?: boolean,
769769
): Promise<{ success: boolean; message: string; prUrl: string | null }> {
770+
const prFooter =
771+
"\n\n---\n*Created with [PostHog Code](https://posthog.com/code?ref=pr)*";
772+
770773
const args = ["pr", "create"];
771774
if (title) {
772775
args.push("--title", title);
773-
args.push("--body", body || "");
776+
args.push("--body", (body || "") + prFooter);
774777
} else {
775778
args.push("--fill");
776779
}

0 commit comments

Comments
 (0)