From e16c72eeed5986e224089eb2c1edec9a0aa88a75 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 19:29:02 +0000 Subject: [PATCH] Add missing safe-output test coverage for set-issue-field and dispatch_repository - Created test-copilot-set-issue-field.md workflow to test set_issue_field safe output type - Added dispatch_repository Go compiler test case to compiler_safe_outputs_config_test.go - Note: test-copilot-dispatch-repository.md already existed with correct dispatch_repository YAML key This completes test coverage for all safe-output types in SafeOutputsConfig. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../workflows/test-copilot-set-issue-field.md | 27 +++++++++++++++++++ .../compiler_safe_outputs_config_test.go | 21 +++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 pkg/cli/workflows/test-copilot-set-issue-field.md diff --git a/pkg/cli/workflows/test-copilot-set-issue-field.md b/pkg/cli/workflows/test-copilot-set-issue-field.md new file mode 100644 index 00000000000..8070d71941e --- /dev/null +++ b/pkg/cli/workflows/test-copilot-set-issue-field.md @@ -0,0 +1,27 @@ +--- +on: + workflow_dispatch: +permissions: + contents: read + issues: read +engine: copilot +safe-outputs: + set-issue-field: + max: 5 +timeout-minutes: 5 +--- + +# Test Copilot Set Issue Field + +Test the `set_issue_field` safe output type with the Copilot engine. + +## Task + +Set a custom field on issue #1 in the current repository. + +Use the following parameters: +- **issue_number**: 1 +- **field_name**: "Status" +- **value**: "In Progress" + +Output results in JSONL format using the `set_issue_field` tool. diff --git a/pkg/workflow/compiler_safe_outputs_config_test.go b/pkg/workflow/compiler_safe_outputs_config_test.go index 92176f0b239..cefc6b43a1d 100644 --- a/pkg/workflow/compiler_safe_outputs_config_test.go +++ b/pkg/workflow/compiler_safe_outputs_config_test.go @@ -450,6 +450,27 @@ func TestAddHandlerManagerConfigEnvVar(t *testing.T) { checkJSON: true, expectedKeys: []string{"dispatch_workflow"}, }, + { + name: "dispatch_repository config", + safeOutputs: &SafeOutputsConfig{ + DispatchRepository: &DispatchRepositoryConfig{ + Tools: map[string]*DispatchRepositoryToolConfig{ + "example_tool": { + Description: "Test dispatch", + Workflow: "test-workflow", + EventType: "test_event", + Repository: "github/example", + Max: strPtr("1"), + }, + }, + }, + }, + checkContains: []string{ + "GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG", + }, + checkJSON: true, + expectedKeys: []string{"dispatch_repository"}, + }, { name: "update_discussion config", safeOutputs: &SafeOutputsConfig{