Skip to content

Revert core shim for Node.js execution in MCP servers#16151

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/add-core-shim-for-node
Closed

Revert core shim for Node.js execution in MCP servers#16151
Copilot wants to merge 3 commits intomainfrom
copilot/add-core-shim-for-node

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

This PR reverts the core shim implementation that was initially added to handle @actions/core unavailability in Node.js environments.

Changes

  • Removed core_shim.cjs - Deleted the minimal @actions/core shim implementation
  • Removed core_shim.test.cjs - Deleted associated tests
  • Reverted MCP server changes - Restored safe_inputs_mcp_server.cjs and safe_outputs_mcp_server.cjs to original state
  • Reverted deployment config - Removed core_shim.cjs from SAFE_INPUTS_FILES and SAFE_OUTPUTS_FILES in setup.sh

Rationale

The core shim approach is not needed. Code that may run outside GitHub Actions context should use typeof core !== "undefined" checks instead of relying on a global shim. This pattern is already established in existing utility modules like path_helpers.cjs.

Example of Correct Pattern

// Use conditional checks instead of global shim
if (typeof core !== "undefined") {
  core.info("Processing workflow");
}

This approach is more flexible and doesn't create coupling to a specific shim implementation.

Original prompt

Create a shim of the actions GitHub script "core" object for node.js execution. Load shim in safe output MCP server and safe inputs (add to setup.sh file lists).

This is to prevent errors when using core.info... in both GitHub script and node env


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.



✨ PR Review Safe Output Test - Run 22074209714

💥 [THE END] — Illustrated by Smoke Claude

- Create core_shim.cjs with minimal core object implementation
- Load shim in safe-inputs and safe-outputs MCP servers
- Add core_shim.cjs to setup.sh file lists for both servers
- Add comprehensive tests for core shim

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add a shim for GitHub script core object in Node.js Add core shim for Node.js execution in MCP servers Feb 16, 2026
Copilot AI requested a review from pelikhan February 16, 2026 16:51
* Mark the action as failed with an error message
* @param {string} message - The failure message
*/
setFailed(message) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove this shim

@pelikhan
Copy link
Contributor

@copilot keep working

Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

@copilot keep working

Removed the core shim implementation in 2d750cc. The MCP servers and setup.sh have been reverted to their original state.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add core shim for Node.js execution in MCP servers Revert core shim for Node.js execution in MCP servers Feb 16, 2026
@pelikhan pelikhan closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants