Skip to content

Use actions/setup-safe-outputs to copy JavaScript files instead of inline YAML#7443

Closed
Copilot wants to merge 16 commits into
mainfrom
copilot/copy-js-files-to-safeoutputs
Closed

Use actions/setup-safe-outputs to copy JavaScript files instead of inline YAML#7443
Copilot wants to merge 16 commits into
mainfrom
copilot/copy-js-files-to-safeoutputs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 23, 2025

Plan: Create setup-safe-outputs action to copy JavaScript files

Changes completed:

  • Update actions/setup-safe-outputs/copy-files.sh to work like setup action (copy from js/ directory)
  • Remove the "Write Safe Outputs JavaScript Files" step from pkg/workflow/mcp_servers.go
  • Add a call to actions/setup-safe-outputs action in the MCP setup flow
  • Add checkout of actions folder when in dev mode (only for main job with safe-outputs)
  • Keep the mcp-server.cjs entry point generation separate (it's generated, not copied)
  • Test basic compilation with sample workflow
  • Verified test failures are pre-existing (not caused by this PR)
  • Merged main branch and recompiled all workflows (multiple times)
  • Committed JavaScript files for CI
  • Fixed missing dependency file
  • Removed MCP gateway from smoke-copilot workflow
  • Latest main merge

Summary

This PR successfully implements the requested changes:

  1. Updated actions/setup-safe-outputs/copy-files.sh: Changed from hard-coded file list to dynamically copying all files from the js/ directory (built during make actions-build), matching the pattern used by actions/setup

  2. Modified pkg/workflow/mcp_servers.go: Replaced the inline "Write Safe Outputs JavaScript Files" step that wrote files directly into the workflow YAML with a call to the actions/setup-safe-outputs action

  3. Added checkout logic: When in dev mode, the workflow now checks out the actions folder before calling the setup-safe-outputs action (similar to how setup action works)

  4. Preserved entry point generation: The mcp-server.cjs entry point is still generated inline since it's a dynamic script, not a static file to be copied

  5. Committed JavaScript files: Added the actions/setup-safe-outputs/js/ files to the repository so they're available in CI (matching the pattern used by actions/setup)

  6. Removed MCP gateway configuration: Removed sandbox.mcp.port setting from smoke-copilot.md, eliminating the "Start MCP Gateway" step and awmg dependency

Latest Updates

  • Merged latest main: Successfully merged main branch updates (12 files changed)
  • Files updated: JavaScript files and tests in actions/setup/js/ and pkg/workflow/js/ directories
  • Total size: 29.3 MB across all workflows
  • Files included (10 total):
    • mcp_logger.cjs
    • mcp_server_core.cjs
    • messages.cjs
    • safe_outputs_append.cjs
    • safe_outputs_bootstrap.cjs
    • safe_outputs_config.cjs
    • safe_outputs_handlers.cjs
    • safe_outputs_mcp_server.cjs
    • safe_outputs_tools.json
    • safe_outputs_tools_loader.cjs

Test Status

The implementation compiles successfully and generates correct workflows. Some unit tests are failing, but investigation confirms these are pre-existing failures unrelated to this PR.

Example Output

Generated workflow correctly uses the action:

- name: Checkout actions folder for safe-outputs
  uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
  with:
    sparse-checkout: |
      actions
- name: Setup Safe Outputs JavaScript Files
  uses: ./actions/setup-safe-outputs
  with:
    destination: /tmp/gh-aw/safeoutputs
Original prompt

Create custom action actions/setup-safe-outputs that copies all the necessary JavaScript files for the safe output MCP server into /tmp/gh-aw/safeoutputs . Remove the step that writes those files.

Use the same logic to decide the action mode that actions/setup


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 23, 2025 21:25
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…afe-outputs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add custom action to copy JavaScript files for safe output Use actions/setup-safe-outputs to copy JavaScript files instead of inline YAML Dec 23, 2025
Copilot AI requested a review from pelikhan December 23, 2025 21:48
@pelikhan pelikhan added the smoke label Dec 23, 2025
@pelikhan pelikhan marked this pull request as ready for review December 23, 2025 21:50
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

Copilot AI and others added 2 commits December 23, 2025 22:35
…-to-safeoutputs

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 23, 2025

@copilot merge main and recompile

Done. Merged main and recompiled all workflows in commit 4d7974c.

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot the JavaScript files need to be commited. See https://github.com/githubnext/gh-aw/actions/runs/20473277430/job/58833033379#step:13:1

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 23, 2025

@copilot the JavaScript files need to be commited. See https://github.com/githubnext/gh-aw/actions/runs/20473277430/job/58833033379#step:13:1

Fixed in commit e37462d. Committed the 9 JavaScript files from actions/setup-safe-outputs/js/ directory and updated .gitignore to allow them to be tracked.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@pelikhan pelikhan added smoke and removed smoke labels Dec 24, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

🤖 ALERT: Smoke Copilot No Firewall failed. ANOMALY_DETECTED. REPAIR_REQUIRED.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

💀 Blimey! Smoke Copilot Safe Inputs failed and walked the plank! No treasure today, matey! ☠️

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

📰 DEVELOPING STORY: Smoke Copilot Playwright reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@pelikhan pelikhan added smoke and removed smoke labels Dec 24, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

📰 DEVELOPING STORY: Smoke Copilot Playwright reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

🤖 ALERT: Smoke Copilot No Firewall failed. ANOMALY_DETECTED. REPAIR_REQUIRED.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

💀 Blimey! Smoke Copilot Safe Inputs failed and walked the plank! No treasure today, matey! ☠️

@pelikhan pelikhan closed this Dec 24, 2025
@github-actions github-actions Bot deleted the copilot/copy-js-files-to-safeoutputs branch April 2, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants