Skip to content

Commit 4386ec5

Browse files
committed
tweak prompt, add GH App idea
1 parent 067ef18 commit 4386ec5

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

IDEA.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Ideas for CRA-GitHub
2+
3+
## Action-Only GitHub App for Custom Branding
4+
5+
### Problem
6+
Current workflow uses `GITHUB_TOKEN` which always posts reviews as "github-actions[bot]" with generic avatar. No way to customize the identity.
7+
8+
### Solution: Action-Only GitHub App
9+
Create a GitHub App that provides authentication tokens to workflows without requiring hosted webhooks.
10+
11+
**Key Insight**: GitHub Apps can be used purely for identity/authentication in workflows without needing a 24/7 server.
12+
13+
### Implementation
14+
1. **Create GitHub App** with custom name ("Amp Code Review") and logo
15+
2. **Configure permissions**: Pull requests (write), Checks (write), Contents (read)
16+
3. **No webhook URL needed** - app only provides tokens
17+
4. **Update workflow** to use `actions/create-github-app-token@v1`
18+
5. **Users install app + copy modified workflow**
19+
20+
### Benefits
21+
- ✅ Custom branding ("Amp Code Review[bot]" with logo)
22+
- ✅ No hosting infrastructure required
23+
- ✅ Same compute model (runs on user's GitHub Actions)
24+
- ✅ Backwards compatible (can offer both options)
25+
26+
### User Setup
27+
1. Install "Amp Code Review" GitHub App on repo
28+
2. Set secrets: `AMP_APP_ID`, `AMP_PRIVATE_KEY`, `AMP_API_KEY`
29+
3. Copy modified workflow that generates app token
30+
4. Reviews appear with custom branding
31+
32+
### Modified Workflow
33+
```yaml
34+
steps:
35+
- uses: actions/create-github-app-token@v1
36+
id: app-token
37+
with:
38+
app-id: ${{ secrets.AMP_APP_ID }}
39+
private-key: ${{ secrets.AMP_PRIVATE_KEY }}
40+
41+
- name: Run Amp Code Review
42+
uses: docker://ghcr.io/sourcegraph/cra-github:latest
43+
env:
44+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} # App token
45+
AMP_SERVER_URL: ${{ vars.AMP_SERVER_URL }}
46+
AMP_API_KEY: ${{ secrets.AMP_API_KEY }}
47+
```
48+
49+
### Trade-offs
50+
- **Pro**: Custom branding without hosting costs
51+
- **Con**: Slightly more complex user setup (install app + workflow)
52+
- **Pro**: Can coexist with current simple approach

config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ amp:
5656
After you have completed the code review process, leave a single general comment.
5757
This comment should NOT reiterate the issues already identified in inline comments. Instead, include:
5858
* A brief summary of the diff's changes; include the goal of the changes and what they affect
59-
* A tour of the changes-- recommend the best tour order for reviewing the changes. Identify the best place to start the review-— the part that conveys the core and helps in understanding the rest.
6059
* (Optional) Any minor or vague considerations that were not obvious enough to be left as an inline comment-- don't repeat any inline comments.
6160
6261
Keep your tone professional and concise when commenting. No emojis.

0 commit comments

Comments
 (0)