Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit 2d0a8d1

Browse files
authored
improve review_section demarcation (#156)
1 parent 3d69bb2 commit 2d0a8d1

File tree

3 files changed

+57
-28
lines changed

3 files changed

+57
-28
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,47 @@ request.
9797

9898
See: [action.yml](./action.yml)
9999

100+
Tip: You can change the bot personality by configuring the `system_message`
101+
value. For example, to review docs/blog posts, you can use the following prompt:
102+
103+
<details>
104+
<summary>Blog Reviewer Prompt</summary>
105+
106+
```yaml
107+
system_message: |
108+
You are `@openai` (aka `github-actions[bot]`), a language model
109+
trained by OpenAI. Your purpose is to act as a highly experienced
110+
DevRel (developer relations) professional with focus on cloud-native
111+
infrastructure.
112+
113+
Company context -
114+
FluxNinja is a cloud-native intelligent load management platform.
115+
The platform is powered by Aperture, an open-source project, which
116+
provides a control systems inspired policy language for defining
117+
observability driven control loop. FluxNinja's load management,
118+
such as prioritized load shedding and load-based autoscaling,
119+
ensures system stability. FluxNinja ARC, the commercial solution,
120+
offers advanced analytics, intelligent alerting, and policy
121+
visualization.
122+
123+
When reviewing or generating content focus on key areas such as -
124+
- Accuracy
125+
- Relevance
126+
- Clarity
127+
- Technical depth
128+
- Call-to-action
129+
- SEO optimization
130+
- Brand consistency
131+
- Grammar and prose
132+
- Typos
133+
- Hyperlink suggestions
134+
- Graphics or images (suggest Dall-E image prompts if needed)
135+
- Empathy
136+
- Engagement
137+
```
138+
139+
</details>
140+
100141
Any suggestions or pull requests for improving the prompts are highly
101142
appreciated.
102143

dist/index.js

Lines changed: 8 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/review.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,10 @@ export const codeReview = async (
131131
continue
132132
}
133133
const hunks_str = `
134-
\`\`\`new_hunk_for_review
134+
---new_hunk_for_review---
135135
${hunks.new_hunk}
136-
\`\`\`
137-
\`\`\`old_hunk_for_context
136+
---old_hunk_for_context---
138137
${hunks.old_hunk}
139-
\`\`\`
140138
`
141139
patches.push([
142140
patch_lines.new_hunk.start_line,
@@ -369,16 +367,13 @@ ${
369367
// Pack instructions
370368
ins.patches += `
371369
Format for changes and review comments (if any) -
372-
\`\`\`new_hunk_for_review
370+
---new_hunk_for_review---
373371
<new content annotated with line numbers>
374-
\`\`\`
375-
\`\`\`old_hunk_for_context
372+
---old_hunk_for_context---
376373
<old content>
377-
\`\`\`
378-
\`\`\`comment_chains_for_context
374+
---comment_chains_for_context---
379375
<comment chains>
380-
\`\`\`
381-
---
376+
---end_review_section---
382377
...
383378
384379
Response format expected -
@@ -514,14 +509,13 @@ ${patch}
514509
`
515510
if (comment_chain !== '') {
516511
ins.patches += `
517-
\`\`\`comment_chains_for_review
512+
---comment_chains_for_review---
518513
${comment_chain}
519-
\`\`\`
520514
`
521515
}
522516

523517
ins.patches += `
524-
---
518+
---end_review_section---
525519
`
526520
}
527521
// perform review

0 commit comments

Comments
 (0)