Skip to content

Commit cbe67f3

Browse files
fix
Co-authored-by: Franz the Dog <franz@cutedogs.org>
1 parent 06d3171 commit cbe67f3

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/generator/workflow.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,14 @@ const DEFAULT_ALLOWED_TOOLS = [
7676
// Plan mode
7777
"EnterPlanMode",
7878
"ExitPlanMode",
79-
// Scoped Bash for git/gh
79+
// Scoped Bash for git (read-only)
8080
"Bash(git diff*)",
8181
"Bash(git log*)",
8282
"Bash(git show*)",
83-
"Bash(gh pr *)",
83+
// Scoped Bash for gh (read-only + repo-scoped comment)
84+
"Bash(gh pr view*)",
85+
"Bash(gh pr diff*)",
86+
"Bash(gh pr comment *)",
8487
];
8588

8689
function buildActionStep(

test/cli.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ describe("CLI integration", () => {
5454
const actionStep = parsed.jobs.task.steps.find(
5555
(s: any) => s.uses === "anthropics/claude-code-action@v1"
5656
);
57-
expect(actionStep.with.prompt).toBe("Review the code changes in this PR. Focus on bugs, security issues, and code quality.");
57+
expect(actionStep.with.prompt).toContain("Review the code changes in this PR. Focus on bugs, security issues, and code quality.");
58+
// Labeled event workaround suffix should be appended
59+
expect(actionStep.with.prompt).toContain("github.event.action == 'labeled'");
5860
expect(actionStep.with.claude_args).toContain("--append-system-prompt");
5961
expect(actionStep.with.claude_args).toContain("helpful code review assistant");
6062
});

test/generator/workflow.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ describe("generateWorkflow", () => {
6969
"CronCreate", "CronDelete", "CronList",
7070
"ToolSearch", "LSP", "ListMcpResourcesTool", "ReadMcpResourceTool",
7171
"EnterPlanMode", "ExitPlanMode",
72-
"Bash(git diff*)", "Bash(git log*)", "Bash(git show*)", "Bash(gh pr *)",
72+
"Bash(git diff*)", "Bash(git log*)", "Bash(git show*)",
73+
"Bash(gh pr view*)", "Bash(gh pr diff*)", "Bash(gh pr comment *)",
7374
]) {
7475
expect(tools).toContain(tool);
7576
}

0 commit comments

Comments
 (0)