Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a1cb6b47c |
@@ -329,11 +329,12 @@ All flags have environment variable equivalents:
|
|||||||
### Token Scopes Required
|
### Token Scopes Required
|
||||||
|
|
||||||
| Scope | Purpose |
|
| Scope | Purpose |
|
||||||
|-------|---------|
|
|-------|--------|
|
||||||
| `write:issue` | Post and delete reviews |
|
| `write:issue` | Post and delete reviews |
|
||||||
| `write:repository` | Read PR diffs, file content, commit statuses |
|
| `write:repository` | Read PR diffs, file content, commit statuses |
|
||||||
|
| `read:user` | Self-request as reviewer (optional but recommended) |
|
||||||
|
|
||||||
No `read:user` scope needed — the bot identifies itself from the review response.
|
Without `read:user`, the bot still works but cannot add itself to the PR's reviewer list.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
|||||||
@@ -544,9 +544,6 @@ func fetchPatterns(ctx context.Context, client *gitea.Client, patternsRepo, patt
|
|||||||
}
|
}
|
||||||
owner, repo := parts[0], parts[1]
|
owner, repo := parts[0], parts[1]
|
||||||
|
|
||||||
var repoLoadedFiles []string
|
|
||||||
var repoSkippedFiles []string
|
|
||||||
|
|
||||||
for _, path := range paths {
|
for _, path := range paths {
|
||||||
path = strings.TrimSpace(path)
|
path = strings.TrimSpace(path)
|
||||||
if path == "" {
|
if path == "" {
|
||||||
@@ -562,22 +559,11 @@ func fetchPatterns(ctx context.Context, client *gitea.Client, patternsRepo, patt
|
|||||||
for filePath, content := range files {
|
for filePath, content := range files {
|
||||||
// Only include markdown and text files as patterns
|
// Only include markdown and text files as patterns
|
||||||
if !isPatternFile(filePath) {
|
if !isPatternFile(filePath) {
|
||||||
repoSkippedFiles = append(repoSkippedFiles, filePath)
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
repoLoadedFiles = append(repoLoadedFiles, filePath)
|
|
||||||
sb.WriteString(fmt.Sprintf("### %s/%s\n\n%s\n\n", repoRef, filePath, content))
|
sb.WriteString(fmt.Sprintf("### %s/%s\n\n%s\n\n", repoRef, filePath, content))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(repoLoadedFiles) > 0 {
|
|
||||||
slog.Info("loaded pattern files", "repo", repoRef, "count", len(repoLoadedFiles), "files", repoLoadedFiles)
|
|
||||||
} else {
|
|
||||||
slog.Warn("no pattern files loaded", "repo", repoRef, "paths", paths)
|
|
||||||
}
|
|
||||||
if len(repoSkippedFiles) > 0 {
|
|
||||||
slog.Debug("skipped non-pattern files", "repo", repoRef, "count", len(repoSkippedFiles), "files", repoSkippedFiles)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return sb.String()
|
return sb.String()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user