diff --git a/.github/workflows/dev-containers.yml b/.github/workflows/dev-containers.yml index b8abfb0fc..f1dd10c49 100644 --- a/.github/workflows/dev-containers.yml +++ b/.github/workflows/dev-containers.yml @@ -155,7 +155,9 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + # macOS runners are not available in all org/repo configurations. + # Keep this matrix to universally available hosted runners. + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 diff --git a/build/sanitize-env.js b/build/sanitize-env.js new file mode 100644 index 000000000..ddaec268d --- /dev/null +++ b/build/sanitize-env.js @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +const { spawnSync } = require('child_process'); + +const [, , command, ...args] = process.argv; + +if (!command) { + console.error('Usage: node build/sanitize-env.js [args...]'); + process.exit(1); +} + +const env = { ...process.env }; +delete env.CONFIGURATION; + +const result = spawnSync(command, args, { + stdio: 'inherit', + env, + shell: process.platform === 'win32', +}); + +if (typeof result.status === 'number') { + process.exit(result.status); +} + +process.exit(1); diff --git a/package.json b/package.json index 4cb903c1e..a95a6424f 100644 --- a/package.json +++ b/package.json @@ -18,14 +18,14 @@ "node": ">=20.0.0" }, "scripts": { - "compile": "npm-run-all clean-dist compile-dev", - "watch": "npm-run-all clean-dist compile-watch", - "package": "npm-run-all clean-dist compile-prod store-packagejson patch-packagejson npm-pack restore-packagejson", + "compile": "node build/sanitize-env.js npm-run-all clean-dist compile-dev", + "watch": "node build/sanitize-env.js npm-run-all clean-dist compile-watch", + "package": "node build/sanitize-env.js npm-run-all clean-dist compile-prod store-packagejson patch-packagejson npm-pack restore-packagejson", "store-packagejson": "copyfiles package.json build-tmp/", "patch-packagejson": "node build/patch-packagejson.js", "restore-packagejson": "copyfiles --up 1 build-tmp/package.json .", - "type-check": "npm-run-all clean-built tsc-b", - "type-check-watch": "npm-run-all clean-built tsc-b-w", + "type-check": "node build/sanitize-env.js npm-run-all clean-built tsc-b", + "type-check-watch": "node build/sanitize-env.js npm-run-all clean-built tsc-b-w", "compile-prod": "node esbuild.js --production", "compile-dev": "node esbuild.js", "compile-watch": "node esbuild.js --watch",