Add bundler validation to prevent mixing Node.js and GitHub Script runtime modes - #5944
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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 validation for runtime script conflicts in bundler
Add bundler validation to prevent mixing Node.js and GitHub Script runtime modes
Dec 9, 2025
pelikhan
marked this pull request as ready for review
December 9, 2025 13:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bundler was allowing scripts with incompatible runtime APIs to be bundled together, causing runtime failures when Node.js-only APIs like
execSyncwere used in GitHub Script contexts or vice versa.Changes
Runtime mode detection (
bundler_validation.go)validateNoRuntimeMixing()- Validates all required files use compatible runtime APIsdetectRuntimeMode()- Detects Node.js-only APIs (execSync,spawnSync) vs GitHub Script APIs (core.*,github.*)Bundler integration (
bundler.go)BundleJavaScriptWithMode()before bundling startsTest coverage (
bundler_runtime_mode_test.go)child_processto use Node.js modeExample
Error message:
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/user/usr/bin/gh gh api user --jq .login tags/v5 g/gateway/gateway_test.go ache/go/1.25.0/x64/pkg/tool/linu--systemd-cgroup GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -c it/ref/tags/v5 GOPROXY 1715067/b351=> GOSUMDB GOWORK 64/pkg/tool/linu"mcp-server-playwright" --help sh(http block)/usr/bin/gh gh api user --jq .login .git GOPROXY(http block)/usr/bin/gh gh api user --jq .login 40/add_labels.js x_amd64/asm 1ccd0cd1a20d3a3bf5b6236ffb3d5bcd6cd/log.json c4de662e6b74d780gh sh 64/pkg/tool/linuuser 1715067/b358/par--jq 1/x6�� t0 ../../**/*.json 1/x64/bin/node --ignore-path /dev/null 64/pkg/tool/linumoby /opt/hostedtoolc-address(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 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.