Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/cli/workflows/test-copilot-comment-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down
21 changes: 21 additions & 0 deletions pkg/cli/workflows/test-copilot-create-code-scanning-alert.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions pkg/cli/workflows/test-copilot-dismiss-pull-request-review.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 21 additions & 0 deletions pkg/cli/workflows/test-copilot-replace-label.md
Original file line number Diff line number Diff line change
@@ -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.
24 changes: 24 additions & 0 deletions pkg/cli/workflows/test-copilot-update-issue-safe-outputs.md
Original file line number Diff line number Diff line change
@@ -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.
30 changes: 30 additions & 0 deletions pkg/workflow/compiler_safe_outputs_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading