diff --git a/pkg/cli/workflows/test-copilot-comment-memory.md b/pkg/cli/workflows/test-copilot-comment-memory.md index 62ea61a9c34..4ad23f85546 100644 --- a/pkg/cli/workflows/test-copilot-comment-memory.md +++ b/pkg/cli/workflows/test-copilot-comment-memory.md @@ -10,6 +10,10 @@ tools: comment-memory: max: 1 memory-id: test-memory +safe-outputs: + comment-memory: + max: 1 + memory-id: test-memory timeout-minutes: 5 --- diff --git a/pkg/cli/workflows/test-copilot-create-code-scanning-alert.md b/pkg/cli/workflows/test-copilot-create-code-scanning-alert.md new file mode 100644 index 00000000000..001da6e0ae4 --- /dev/null +++ b/pkg/cli/workflows/test-copilot-create-code-scanning-alert.md @@ -0,0 +1,21 @@ +--- +on: + workflow_dispatch: +permissions: + contents: read + security-events: read +engine: copilot +safe-outputs: + create-code-scanning-alert: + max: 5 +--- + +# Test Copilot Create Code Scanning Alert + +Test the `create_code_scanning_alert` safe output type with the Copilot engine. + +## Task + +Create a code scanning alert (SARIF report) for the current repository identifying a test vulnerability in `src/main.go` at line 1 with rule ID "test-rule" and message "Test code scanning alert created by automated test workflow." + +Output results in JSONL format using the `create_code_scanning_alert` tool. diff --git a/pkg/cli/workflows/test-copilot-create-pull-request-review-comment.md b/pkg/cli/workflows/test-copilot-create-pull-request-review-comment.md index 40b7b527ea4..cc5532e3722 100644 --- a/pkg/cli/workflows/test-copilot-create-pull-request-review-comment.md +++ b/pkg/cli/workflows/test-copilot-create-pull-request-review-comment.md @@ -4,6 +4,9 @@ on: permissions: pull-requests: read engine: copilot +safe-outputs: + create-pull-request-review-comment: + max: 10 --- # Test Copilot Create Pull Request Review Comment diff --git a/pkg/cli/workflows/test-copilot-dismiss-pull-request-review.md b/pkg/cli/workflows/test-copilot-dismiss-pull-request-review.md new file mode 100644 index 00000000000..eca35303fd5 --- /dev/null +++ b/pkg/cli/workflows/test-copilot-dismiss-pull-request-review.md @@ -0,0 +1,21 @@ +--- +on: + workflow_dispatch: +permissions: + contents: read + pull-requests: read +engine: copilot +safe-outputs: + dismiss-pull-request-review: + max: 10 +--- + +# Test Copilot Dismiss Pull Request Review + +Test the `dismiss_pull_request_review` safe output type with the Copilot engine. + +## Task + +Dismiss the most recent pending review on pull request #1 with the message "Dismissed by automated test workflow." + +Output results in JSONL format using the `dismiss_pull_request_review` tool. diff --git a/pkg/cli/workflows/test-copilot-replace-label.md b/pkg/cli/workflows/test-copilot-replace-label.md new file mode 100644 index 00000000000..4071cbea994 --- /dev/null +++ b/pkg/cli/workflows/test-copilot-replace-label.md @@ -0,0 +1,21 @@ +--- +on: + workflow_dispatch: +permissions: + contents: read + issues: read +engine: copilot +safe-outputs: + replace-label: + max: 5 +--- + +# Test Copilot Replace Label + +Test the `replace_label` safe output type with the Copilot engine. + +## Task + +On issue #1, replace the label "in-progress" with the label "done". + +Output results in JSONL format using the `replace_label` tool. diff --git a/pkg/cli/workflows/test-copilot-update-issue-safe-outputs.md b/pkg/cli/workflows/test-copilot-update-issue-safe-outputs.md new file mode 100644 index 00000000000..f35efabbf91 --- /dev/null +++ b/pkg/cli/workflows/test-copilot-update-issue-safe-outputs.md @@ -0,0 +1,24 @@ +--- +on: + workflow_dispatch: +permissions: + contents: read + issues: read +engine: copilot +safe-outputs: + update-issue: + max: 5 + status: true + title: true + body: true +--- + +# Test Copilot Update Issue Safe Outputs + +Test the `update_issue` safe output type with the Copilot engine. + +## Task + +Update issue #1: set the title to "Updated by automated test workflow" and append the text "Updated by test." to the body. + +Output results in JSONL format using the `update_issue` tool. diff --git a/pkg/workflow/compiler_safe_outputs_config_test.go b/pkg/workflow/compiler_safe_outputs_config_test.go index a78f27d4b66..ec21db2fc62 100644 --- a/pkg/workflow/compiler_safe_outputs_config_test.go +++ b/pkg/workflow/compiler_safe_outputs_config_test.go @@ -851,6 +851,36 @@ func TestAddHandlerManagerConfigEnvVar(t *testing.T) { checkJSON: true, expectedKeys: []string{"comment_memory"}, }, + { + name: "dismiss_pull_request_review config", + safeOutputs: &SafeOutputsConfig{ + DismissPullRequestReview: &DismissPullRequestReviewConfig{ + BaseSafeOutputConfig: BaseSafeOutputConfig{ + Max: strPtr("10"), + }, + }, + }, + checkContains: []string{ + "GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG", + }, + checkJSON: true, + expectedKeys: []string{"dismiss_pull_request_review"}, + }, + { + name: "replace_label config", + safeOutputs: &SafeOutputsConfig{ + ReplaceLabel: &ReplaceLabelConfig{ + BaseSafeOutputConfig: BaseSafeOutputConfig{ + Max: strPtr("5"), + }, + }, + }, + checkContains: []string{ + "GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG", + }, + checkJSON: true, + expectedKeys: []string{"replace_label"}, + }, } for _, tt := range tests {