Skip to content

Conversation

@HerrTopi
Copy link
Contributor

No description provided.

svc-instui and others added 27 commits November 3, 2025 17:16
remove require path, because it was used to import from the deprecated
'canvas-theme', 'canvar-high-contrast-theme' packages
remove functional theme support, it was used only for Avatar
useStyle no longer needs generateComponentTheme since this is not used by new themes

function bootstrap() {
execSync(path.resolve('scripts/clean.js'), opts)

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.

Copilot Autofix

AI 6 days ago

The fix is to avoid executing arbitrary shell commands built from dynamic path values via execSync. Instead, launch Node directly on the target script using execFileSync, passing the script path as an argument — this prevents shell expansion issues, avoids interpretation of spaces and special shell characters, and aligns with best practices. Specifically:

  • On line 68, in the bootstrap function, replace execSync(path.resolve('scripts/clean.js'), opts) with execFileSync(process.execPath, [path.resolve('scripts/clean.js')], opts). This runs the script under the Node interpreter rather than launching the script itself as a shell command.

  • Import execFileSync from child_process.

  • Optionally remove unused imports if needed (keep other code unchanged).

All changes are limited to the shown code in scripts/bootstrap.js.

Suggested changeset 1
scripts/bootstrap.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/scripts/bootstrap.js b/scripts/bootstrap.js
--- a/scripts/bootstrap.js
+++ b/scripts/bootstrap.js
@@ -24,7 +24,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-const { execSync, fork } = require('child_process')
+const { execSync, execFileSync, fork } = require('child_process')
 const path = require('path')
 
 const opts = { stdio: 'inherit' }
@@ -65,7 +65,7 @@
 }
 
 function bootstrap() {
-  execSync(path.resolve('scripts/clean.js'), opts)
+  execFileSync(process.execPath, [path.resolve('scripts/clean.js')], opts)
   buildProject()
 }
 
EOF
@@ -24,7 +24,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
const { execSync, fork } = require('child_process')
const { execSync, execFileSync, fork } = require('child_process')
const path = require('path')

const opts = { stdio: 'inherit' }
@@ -65,7 +65,7 @@
}

function bootstrap() {
execSync(path.resolve('scripts/clean.js'), opts)
execFileSync(process.execPath, [path.resolve('scripts/clean.js')], opts)
buildProject()
}

Copilot is powered by AI and may make mistakes. Always verify output.
@github-actions
Copy link

PR Preview Action v1.6.2

🚀 View preview at
https://instructure.design/pr-preview/pr-2238/

Built to branch gh-pages at 2025-11-11 13:45 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.

7 participants