From 0e2c1f13ec6bb653f632aa34cd91f38473b9a74a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 10:00:31 +0000 Subject: [PATCH 1/5] Initial plan From f4da22879e5af29a364a971729bd4e86513b6b73 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 10:13:36 +0000 Subject: [PATCH 2/5] Remove references to obsolete setup-safe-inputs and setup-safe-outputs actions - Remove dependency mappings from getActionDependencies() - Remove buildSetupSafeOutputsAction() function - Remove special handling in buildAction() - Remove special cleaning logic in ActionsCleanCommand() - Update actions/README.md - Update specs/actions.md with current architecture - All tests passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/README.md | 14 +---- pkg/cli/actions_build_command.go | 77 +------------------------ specs/actions.md | 99 +++++++++++++++++++------------- 3 files changed, 63 insertions(+), 127 deletions(-) diff --git a/actions/README.md b/actions/README.md index 6a0da3a4aa5..519bab4772e 100644 --- a/actions/README.md +++ b/actions/README.md @@ -23,18 +23,6 @@ Copies workflow script files to the agent environment. This action embeds all ne [Documentation](./setup/README.md) -### setup-safe-outputs - -Copies safe-outputs MCP server files to the agent environment. This action embeds all necessary JavaScript files for the safe-outputs MCP server and copies them to a specified destination directory. - -[Documentation](./setup-safe-outputs/README.md) - -### setup-safe-inputs - -Copies safe-inputs MCP server files to the agent environment. This action embeds all necessary JavaScript files for the safe-inputs MCP server and copies them to a specified destination directory. - -[Documentation](./setup-safe-inputs/README.md) - ### noop Processes noop safe output - a fallback output type that logs messages for transparency without taking any GitHub API actions. @@ -264,7 +252,7 @@ Test actions locally by: 1. Creating a test workflow in `.github/workflows/` 2. Using the action with a local path: ```yaml - - uses: ./actions/setup-safe-outputs + - uses: ./actions/setup with: destination: /tmp/test ``` diff --git a/pkg/cli/actions_build_command.go b/pkg/cli/actions_build_command.go index e2d2e89275c..65b1c48eeb9 100644 --- a/pkg/cli/actions_build_command.go +++ b/pkg/cli/actions_build_command.go @@ -105,8 +105,8 @@ func ActionsCleanCommand() error { cleanedCount := 0 for _, actionName := range actionDirs { - // Clean index.js for actions that use it (except setup-safe-outputs and setup) - if actionName != "setup-safe-outputs" && actionName != "setup" { + // Clean index.js for actions that use it (except setup) + if actionName != "setup" { indexPath := filepath.Join(actionsDir, actionName, "index.js") if _, err := os.Stat(indexPath); err == nil { if err := os.Remove(indexPath); err != nil { @@ -117,18 +117,6 @@ func ActionsCleanCommand() error { } } - // Clean js/ directory for setup-safe-outputs - if actionName == "setup-safe-outputs" { - jsDir := filepath.Join(actionsDir, actionName, "js") - if _, err := os.Stat(jsDir); err == nil { - if err := os.RemoveAll(jsDir); err != nil { - return fmt.Errorf("failed to remove %s: %w", jsDir, err) - } - fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf(" ✓ Removed %s/js/", actionName))) - cleanedCount++ - } - } - // For setup action, both js/ and sh/ directories are source of truth (NOT generated) // Do not clean them } @@ -219,11 +207,6 @@ func buildAction(actionsDir, actionName string) error { return err } - // Special handling for setup-safe-outputs: copy files instead of embedding - if actionName == "setup-safe-outputs" { - return buildSetupSafeOutputsAction(actionsDir, actionName) - } - // Special handling for setup: build shell script with embedded files if actionName == "setup" { return buildSetupAction(actionsDir, actionName) @@ -287,43 +270,6 @@ func buildAction(actionsDir, actionName string) error { return nil } -// buildSetupSafeOutputsAction builds the setup-safe-outputs action by copying JavaScript files -func buildSetupSafeOutputsAction(actionsDir, actionName string) error { - actionPath := filepath.Join(actionsDir, actionName) - jsDir := filepath.Join(actionPath, "js") - - // Get dependencies for this action - dependencies := getActionDependencies(actionName) - fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf(" ✓ Found %d dependencies", len(dependencies)))) - - // Get all JavaScript sources - sources := workflow.GetJavaScriptSources() - - // Create js directory if it doesn't exist - if err := os.MkdirAll(jsDir, 0755); err != nil { - return fmt.Errorf("failed to create js directory: %w", err) - } - - // Copy each dependency file to the js directory - copiedCount := 0 - for _, dep := range dependencies { - if content, ok := sources[dep]; ok { - destPath := filepath.Join(jsDir, dep) - if err := os.WriteFile(destPath, []byte(content), 0644); err != nil { - return fmt.Errorf("failed to write %s: %w", dep, err) - } - fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf(" - %s", dep))) - copiedCount++ - } else { - fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf(" ⚠ Warning: Could not find %s", dep))) - } - } - - fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf(" ✓ Copied %d files to js/", copiedCount))) - - return nil -} - // buildSetupAction builds the setup action by checking that source files exist. // Note: Both JavaScript and shell scripts are source of truth in actions/setup/js/ and actions/setup/sh/ // They get synced to pkg/workflow/js/ and pkg/workflow/sh/ during the build process via Makefile targets. @@ -376,25 +322,6 @@ func getActionDependencies(actionName string) []string { // Static dependencies for other actions dependencyMap := map[string][]string{ - "setup-safe-outputs": { - "safe_outputs_mcp_server.cjs", - "safe_outputs_bootstrap.cjs", - "safe_outputs_tools_loader.cjs", - "safe_outputs_config.cjs", - "safe_outputs_handlers.cjs", - "mcp_server_core.cjs", - "mcp_logger.cjs", - "messages.cjs", - }, - "setup-safe-inputs": { - "safe_inputs_mcp_server.cjs", - "safe_inputs_bootstrap.cjs", - "safe_inputs_config_loader.cjs", - "safe_inputs_tool_factory.cjs", - "safe_inputs_validation.cjs", - "mcp_server_core.cjs", - "mcp_logger.cjs", - }, "noop": { "load_agent_output.cjs", }, diff --git a/specs/actions.md b/specs/actions.md index a512ce3514f..208afcea1cc 100644 --- a/specs/actions.md +++ b/specs/actions.md @@ -94,12 +94,14 @@ Create a custom actions system that: ┌─────────────────────────────────────────────────────────┐ │ actions/ Directory │ │ ┌────────────────────────────────────────────────────┐ │ -│ │ setup-safe-inputs/ setup-safe-outputs/ │ │ -│ │ ├── action.yml ├── action.yml │ │ -│ │ ├── index.js ├── index.js │ │ -│ │ ├── src/ ├── src/ │ │ -│ │ │ └── index.js │ └── index.js │ │ -│ │ └── README.md └── README.md │ │ +│ │ setup/ │ │ +│ │ ├── action.yml │ │ +│ │ ├── setup.sh │ │ +│ │ ├── js/ │ │ +│ │ │ └── *.cjs (copied from pkg/workflow/js/) │ │ +│ │ ├── sh/ │ │ +│ │ │ └── *.sh (source of truth) │ │ +│ │ └── README.md │ │ │ └────────────────────────────────────────────────────┘ │ └─────────────────────────────────────────────────────────┘ ```text @@ -149,18 +151,36 @@ gh-aw/ │ │ ├── sh/ # Shell scripts (SOURCE OF TRUTH) │ │ │ └── *.sh # Manually edited shell scripts │ │ └── README.md # Action-specific docs -│ ├── setup-safe-inputs/ # Safe inputs MCP server setup +│ ├── noop/ # Noop safe output action +│ │ ├── action.yml # Action metadata +│ │ ├── index.js # Bundled output (committed) +│ │ ├── src/ # Source files +│ │ │ └── index.js # Source that references FILES constant +│ │ └── README.md # Action-specific docs +│ ├── minimize_comment/ # Minimize comment action +│ │ ├── action.yml # Action metadata +│ │ ├── index.js # Bundled output (committed) +│ │ ├── src/ # Source files +│ │ │ └── index.js # Source that references FILES constant +│ │ └── README.md # Action-specific docs +│ ├── close_issue/ # Close issue action +│ │ ├── action.yml # Action metadata +│ │ ├── index.js # Bundled output (committed) +│ │ ├── src/ # Source files +│ │ │ └── index.js # Source that references FILES constant +│ │ └── README.md # Action-specific docs +│ ├── close_pull_request/ # Close pull request action +│ │ ├── action.yml # Action metadata +│ │ ├── index.js # Bundled output (committed) +│ │ ├── src/ # Source files +│ │ │ └── index.js # Source that references FILES constant +│ │ └── README.md # Action-specific docs +│ ├── close_discussion/ # Close discussion action │ │ ├── action.yml # Action metadata │ │ ├── index.js # Bundled output (committed) │ │ ├── src/ # Source files │ │ │ └── index.js # Source that references FILES constant │ │ └── README.md # Action-specific docs -│ └── setup-safe-outputs/ # Safe outputs MCP server setup -│ ├── action.yml # Action metadata -│ ├── index.js # Bundled output (committed) -│ ├── src/ # Source files -│ │ └── index.js # Source that references FILES constant -│ └── README.md # Action-specific docs ├── pkg/ │ ├── cli/ │ │ └── actions_build_command.go # Build system implementation @@ -319,25 +339,31 @@ Currently uses manual mapping in `getActionDependencies()`: ```go func getActionDependencies(actionName string) []string { + // For setup, use the dynamic script discovery + // This ensures all .cjs files are included automatically + if actionName == "setup" { + return workflow.GetAllScriptFilenames() + } + + // Static dependencies for other actions dependencyMap := map[string][]string{ - "setup-safe-outputs": { - "safe_outputs_mcp_server.cjs", - "safe_outputs_bootstrap.cjs", - "safe_outputs_tools_loader.cjs", - "safe_outputs_config.cjs", - "safe_outputs_handlers.cjs", - "mcp_server_core.cjs", - "mcp_logger.cjs", - "messages.cjs", + "noop": { + "load_agent_output.cjs", + }, + "minimize_comment": { + "load_agent_output.cjs", + }, + "close_issue": { + "close_entity_helpers.cjs", }, - "setup-safe-inputs": { - "safe_inputs_mcp_server.cjs", - "safe_inputs_bootstrap.cjs", - "safe_inputs_config_loader.cjs", - "safe_inputs_tool_factory.cjs", - "safe_inputs_validation.cjs", - "mcp_server_core.cjs", - "mcp_logger.cjs", + "close_pull_request": { + "close_entity_helpers.cjs", + }, + "close_discussion": { + "generate_footer.cjs", + "get_repository_url.cjs", + "get_tracker_id.cjs", + "load_agent_output.cjs", }, } @@ -449,15 +475,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Safe Inputs - uses: ./actions/setup-safe-inputs - with: - destination: /tmp/safe-inputs - - - name: Setup Safe Outputs - uses: ./actions/setup-safe-outputs + - name: Setup Workflow Scripts + uses: ./actions/setup with: - destination: /tmp/safe-outputs + destination: /tmp/scripts ```text ### Creating a New Action @@ -727,7 +748,7 @@ The custom GitHub Actions build system provides a foundation for migrating from ✅ **Go-based build system** reusing workflow bundler infrastructure ✅ **Makefile integration** for action management ✅ **CI validation** ensuring actions stay buildable -✅ **Two initial actions** (setup-safe-inputs, setup-safe-outputs) +✅ **Multiple custom actions** (setup, noop, minimize_comment, close_issue, close_pull_request, close_discussion) ✅ **Comprehensive documentation** for future development The system is production-ready and extensible, with clear paths for enhancement and migration of existing inline scripts. From 0fc3e9de09bf391cdbaa9bdcbe76597b02e79977 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 10:17:39 +0000 Subject: [PATCH 3/5] Remove remaining references to obsolete actions - Remove .gitignore entry for actions/setup-safe-outputs/js/ - Update developer instructions with current action structure Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../instructions/developer.instructions.md | 21 +++++++++++++++++-- .gitignore | 1 - 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/instructions/developer.instructions.md b/.github/instructions/developer.instructions.md index 0185cd9e8e8..f000bc34f11 100644 --- a/.github/instructions/developer.instructions.md +++ b/.github/instructions/developer.instructions.md @@ -364,11 +364,28 @@ The custom actions build system is **entirely implemented in Go** in `pkg/cli/ac **Directory Structure**: ``` actions/ -├── setup-safe-inputs/ +├── setup/ +│ ├── action.yml +│ ├── setup.sh +│ ├── js/ +│ └── sh/ +├── noop/ +│ ├── action.yml +│ ├── index.js +│ └── src/ +├── minimize_comment/ +│ ├── action.yml +│ ├── index.js +│ └── src/ +├── close_issue/ +│ ├── action.yml +│ ├── index.js +│ └── src/ +├── close_pull_request/ │ ├── action.yml │ ├── index.js │ └── src/ -├── setup-safe-outputs/ +├── close_discussion/ │ ├── action.yml │ ├── index.js │ └── src/ diff --git a/.gitignore b/.gitignore index bde4394300d..14da4517762 100644 --- a/.gitignore +++ b/.gitignore @@ -139,7 +139,6 @@ trivy-results.sarif # Note: If workflows fail due to missing js/ files, these may need to be committed # The js/ directories contain compiled JavaScript from pkg/workflow/js/*.cjs # and are generated by 'make actions-build' -actions/setup-safe-outputs/js/ # License compliance reports licenses.csv From f3b349f04df0df640a8d688d7047206eb8578030 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 10:28:28 +0000 Subject: [PATCH 4/5] Remove non-existent action references Only actions/setup exists, remove references to noop, minimize_comment, close_issue, close_pull_request, and close_discussion from dependency mapping and developer instructions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../instructions/developer.instructions.md | 30 ++++--------------- pkg/cli/actions_build_command.go | 25 ---------------- 2 files changed, 5 insertions(+), 50 deletions(-) diff --git a/.github/instructions/developer.instructions.md b/.github/instructions/developer.instructions.md index f000bc34f11..239eccaf7e4 100644 --- a/.github/instructions/developer.instructions.md +++ b/.github/instructions/developer.instructions.md @@ -364,31 +364,11 @@ The custom actions build system is **entirely implemented in Go** in `pkg/cli/ac **Directory Structure**: ``` actions/ -├── setup/ -│ ├── action.yml -│ ├── setup.sh -│ ├── js/ -│ └── sh/ -├── noop/ -│ ├── action.yml -│ ├── index.js -│ └── src/ -├── minimize_comment/ -│ ├── action.yml -│ ├── index.js -│ └── src/ -├── close_issue/ -│ ├── action.yml -│ ├── index.js -│ └── src/ -├── close_pull_request/ -│ ├── action.yml -│ ├── index.js -│ └── src/ -├── close_discussion/ -│ ├── action.yml -│ ├── index.js -│ └── src/ +└── setup/ + ├── action.yml + ├── setup.sh + ├── js/ + └── sh/ ``` **Implementation**: See specs/actions.md and `pkg/cli/actions_build_command.go` diff --git a/pkg/cli/actions_build_command.go b/pkg/cli/actions_build_command.go index 65b1c48eeb9..14dad0c1000 100644 --- a/pkg/cli/actions_build_command.go +++ b/pkg/cli/actions_build_command.go @@ -320,30 +320,5 @@ func getActionDependencies(actionName string) []string { return workflow.GetAllScriptFilenames() } - // Static dependencies for other actions - dependencyMap := map[string][]string{ - "noop": { - "load_agent_output.cjs", - }, - "minimize_comment": { - "load_agent_output.cjs", - }, - "close_issue": { - "close_entity_helpers.cjs", - }, - "close_pull_request": { - "close_entity_helpers.cjs", - }, - "close_discussion": { - "generate_footer.cjs", - "get_repository_url.cjs", - "get_tracker_id.cjs", - "load_agent_output.cjs", - }, - } - - if deps, ok := dependencyMap[actionName]; ok { - return deps - } return []string{} } From ce4684f98fa00ce26868355bba670163fe46129f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 10:40:46 +0000 Subject: [PATCH 5/5] Remove remaining non-existent action references from specs/actions.md - Remove directory layout entries for noop, minimize_comment, close_issue, close_pull_request, close_discussion - Update dependency mapping example to match actual code - Update summary section to reflect only setup action exists Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- specs/actions.md | 57 +----------------------------------------------- 1 file changed, 1 insertion(+), 56 deletions(-) diff --git a/specs/actions.md b/specs/actions.md index 208afcea1cc..4d590620fe0 100644 --- a/specs/actions.md +++ b/specs/actions.md @@ -151,36 +151,6 @@ gh-aw/ │ │ ├── sh/ # Shell scripts (SOURCE OF TRUTH) │ │ │ └── *.sh # Manually edited shell scripts │ │ └── README.md # Action-specific docs -│ ├── noop/ # Noop safe output action -│ │ ├── action.yml # Action metadata -│ │ ├── index.js # Bundled output (committed) -│ │ ├── src/ # Source files -│ │ │ └── index.js # Source that references FILES constant -│ │ └── README.md # Action-specific docs -│ ├── minimize_comment/ # Minimize comment action -│ │ ├── action.yml # Action metadata -│ │ ├── index.js # Bundled output (committed) -│ │ ├── src/ # Source files -│ │ │ └── index.js # Source that references FILES constant -│ │ └── README.md # Action-specific docs -│ ├── close_issue/ # Close issue action -│ │ ├── action.yml # Action metadata -│ │ ├── index.js # Bundled output (committed) -│ │ ├── src/ # Source files -│ │ │ └── index.js # Source that references FILES constant -│ │ └── README.md # Action-specific docs -│ ├── close_pull_request/ # Close pull request action -│ │ ├── action.yml # Action metadata -│ │ ├── index.js # Bundled output (committed) -│ │ ├── src/ # Source files -│ │ │ └── index.js # Source that references FILES constant -│ │ └── README.md # Action-specific docs -│ ├── close_discussion/ # Close discussion action -│ │ ├── action.yml # Action metadata -│ │ ├── index.js # Bundled output (committed) -│ │ ├── src/ # Source files -│ │ │ └── index.js # Source that references FILES constant -│ │ └── README.md # Action-specific docs ├── pkg/ │ ├── cli/ │ │ └── actions_build_command.go # Build system implementation @@ -345,31 +315,6 @@ func getActionDependencies(actionName string) []string { return workflow.GetAllScriptFilenames() } - // Static dependencies for other actions - dependencyMap := map[string][]string{ - "noop": { - "load_agent_output.cjs", - }, - "minimize_comment": { - "load_agent_output.cjs", - }, - "close_issue": { - "close_entity_helpers.cjs", - }, - "close_pull_request": { - "close_entity_helpers.cjs", - }, - "close_discussion": { - "generate_footer.cjs", - "get_repository_url.cjs", - "get_tracker_id.cjs", - "load_agent_output.cjs", - }, - } - - if deps, ok := dependencyMap[actionName]; ok { - return deps - } return []string{} } ```text @@ -748,7 +693,7 @@ The custom GitHub Actions build system provides a foundation for migrating from ✅ **Go-based build system** reusing workflow bundler infrastructure ✅ **Makefile integration** for action management ✅ **CI validation** ensuring actions stay buildable -✅ **Multiple custom actions** (setup, noop, minimize_comment, close_issue, close_pull_request, close_discussion) +✅ **Setup action** for workflow script management ✅ **Comprehensive documentation** for future development The system is production-ready and extensible, with clear paths for enhancement and migration of existing inline scripts.