|
| 1 | +/* |
| 2 | + * The CodeQL CLI is the source of truth for language aliases. However, in some parts of the |
| 3 | + * Action it is practical to resolve language aliases before the CodeQL CLI has been installed. |
| 4 | + * Therefore we accept some duplication and store a snapshot of the known language aliases in |
| 5 | + * `src/known-language-aliases.json`. |
| 6 | + * |
| 7 | + * This module handles downloading and extracting a CodeQL bundle, running the CLI to resolve |
| 8 | + * language aliases, and writing the result back to `src/known-language-aliases.json`. |
| 9 | + */ |
| 10 | + |
1 | 11 | import { execFileSync } from 'child_process'; |
2 | 12 | import * as fs from 'fs'; |
3 | 13 | import * as os from 'os'; |
@@ -27,6 +37,8 @@ const KNOWN_LANGUAGE_ALIASES_PATH = path.resolve( |
27 | 37 | export function assertSupportedPlatform( |
28 | 38 | platform: NodeJS.Platform = process.platform |
29 | 39 | ): void { |
| 40 | + // We'll only ever run this on Linux in CI, but it's useful to support macOS too |
| 41 | + // for local testing. |
30 | 42 | if (platform !== 'linux' && platform !== 'darwin') { |
31 | 43 | throw new Error( |
32 | 44 | `The update-bundle script must run on Linux or macOS. Current platform: ${platform}.` |
@@ -140,7 +152,7 @@ export async function updateKnownLanguageAliasesFromRelease( |
140 | 152 | }); |
141 | 153 |
|
142 | 154 | const codeqlCliPath = path.join(extractDir, 'codeql', 'codeql'); |
143 | | - console.log('Resolving language aliases using bundled CodeQL CLI'); |
| 155 | + console.log('Resolving language aliases using CodeQL CLI'); |
144 | 156 | const output = execFileSync( |
145 | 157 | codeqlCliPath, |
146 | 158 | ['resolve', 'languages', '--format=betterjson', '--extractor-include-aliases'], |
|
0 commit comments