@probelabs/visor 0.1.73 → 0.1.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -244,6 +244,38 @@ Example:
244
244
  node dist/index.js --cli --check all --debug
245
245
  ```
246
246
 
247
+ Run modes
248
+
249
+ - Default is CLI mode everywhere (no auto-detection).
250
+ - For GitHub-specific behavior (comments, checks), run with `--mode github-actions` or set `with: mode: github-actions` when using the GitHub Action.
251
+
252
+ Examples:
253
+
254
+ ```bash
255
+ # Local/CI CLI
256
+ npx @probelabs/visor --config .visor.yaml --check all --output json
257
+
258
+ # GitHub Actions behavior from any shell/CI
259
+ npx @probelabs/visor --mode github-actions --config .visor.yaml --check all
260
+ ```
261
+
262
+ GitHub Action usage:
263
+
264
+ ```yaml
265
+ - uses: probelabs/visor@vX
266
+ with:
267
+ mode: github-actions
268
+ checks: all
269
+ output-format: json
270
+ ```
271
+
272
+ To force CLI mode inside a GitHub Action step, you can still use:
273
+
274
+ ```yaml
275
+ env:
276
+ VISOR_MODE: cli
277
+ ```
278
+
247
279
  Learn more: [docs/troubleshooting.md](docs/troubleshooting.md)
248
280
 
249
281
  ## 🔐 Security Defaults
package/action.yml CHANGED
@@ -6,6 +6,10 @@ branding:
6
6
  color: 'blue'
7
7
 
8
8
  inputs:
9
+ mode:
10
+ description: 'Run mode: github-actions or cli. Default: github-actions'
11
+ required: false
12
+ default: 'github-actions'
9
13
  github-token:
10
14
  description: 'GitHub token for API access (use this OR app-id/private-key)'
11
15
  required: false
@@ -159,4 +163,4 @@ outputs:
159
163
 
160
164
  runs:
161
165
  using: 'node20'
162
- main: 'dist/index.js'
166
+ main: 'dist/index.js'
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAA2B,MAAM,aAAa,CAAC;AAIlE;;GAEG;AACH,qBAAa,GAAG;IACd,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,WAAW,CAA4E;IAC/F,OAAO,CAAC,YAAY,CAA0D;;IAO9E;;OAEG;IACH,OAAO,CAAC,YAAY;IA2CpB;;OAEG;IACH,OAAO,CAAC,aAAa,CAEnB;IAEF;;OAEG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU;IAwI5C;;OAEG;IACH,OAAO,CAAC,eAAe;IAkCvB;;OAEG;IACI,WAAW,IAAI,MAAM;IAyC5B;;OAEG;IACI,UAAU,IAAI,MAAM;IAoC3B;;OAEG;IACI,eAAe,IAAI,MAAM;IAkBhC;;OAEG;IACI,QAAQ,IAAI,IAAI;IAIvB;;OAEG;IACI,WAAW,IAAI,IAAI;CAG3B"}
1
+ {"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAA2B,MAAM,aAAa,CAAC;AAIlE;;GAEG;AACH,qBAAa,GAAG;IACd,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,WAAW,CAA4E;IAC/F,OAAO,CAAC,YAAY,CAA0D;;IAO9E;;OAEG;IACH,OAAO,CAAC,YAAY;IA4CpB;;OAEG;IACH,OAAO,CAAC,aAAa,CAEnB;IAEF;;OAEG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU;IAyI5C;;OAEG;IACH,OAAO,CAAC,eAAe;IAkCvB;;OAEG;IACI,WAAW,IAAI,MAAM;IA0C5B;;OAEG;IACI,UAAU,IAAI,MAAM;IAoC3B;;OAEG;IACI,eAAe,IAAI,MAAM;IAkBhC;;OAEG;IACI,QAAQ,IAAI,IAAI;IAIvB;;OAEG;IACI,WAAW,IAAI,IAAI;CAG3B"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- process.env.VISOR_VERSION = '0.1.73';
2
+ process.env.VISOR_VERSION = '0.1.74';
3
3
  process.env.PROBE_VERSION = '0.6.0-rc117';
4
4
  /******/ (() => { // webpackBootstrap
5
5
  /******/ var __webpack_modules__ = ({
@@ -98477,6 +98477,7 @@ class CLI {
98477
98477
  .option('--no-remote-extends', 'Disable loading configurations from remote URLs')
98478
98478
  .option('--enable-code-context', 'Force include code diffs in analysis (CLI mode)')
98479
98479
  .option('--disable-code-context', 'Force exclude code diffs from analysis (CLI mode)')
98480
+ .option('--mode <mode>', 'Run mode (cli|github-actions). Default: cli')
98480
98481
  .addHelpText('after', this.getExamplesText())
98481
98482
  .exitOverride(); // Prevent automatic process.exit for better error handling
98482
98483
  // Add validation for options
@@ -98519,6 +98520,7 @@ class CLI {
98519
98520
  .option('--allowed-remote-patterns <patterns>', 'Comma-separated list of allowed URL prefixes for remote config extends (e.g., "https://github.com/,https://raw.githubusercontent.com/")')
98520
98521
  .option('--enable-code-context', 'Force include code diffs in analysis (CLI mode)')
98521
98522
  .option('--disable-code-context', 'Force exclude code diffs from analysis (CLI mode)')
98523
+ .option('--mode <mode>', 'Run mode (cli|github-actions). Default: cli')
98522
98524
  .allowUnknownOption(false)
98523
98525
  .allowExcessArguments(false) // Don't allow positional arguments
98524
98526
  .addHelpText('after', this.getExamplesText())
@@ -98649,6 +98651,7 @@ class CLI {
98649
98651
  .option('--exclude-tags <tags>', 'Exclude checks with these tags (comma-separated)')
98650
98652
  .option('--enable-code-context', 'Force include code diffs in analysis (CLI mode)')
98651
98653
  .option('--disable-code-context', 'Force exclude code diffs from analysis (CLI mode)')
98654
+ .option('--mode <mode>', 'Run mode (cli|github-actions). Default: cli')
98652
98655
  .addHelpText('after', this.getExamplesText());
98653
98656
  // Get the basic help and append examples manually if addHelpText doesn't work
98654
98657
  const basicHelp = tempProgram.helpInformation();
@@ -102594,15 +102597,31 @@ async function markCheckAsFailed(checkService, owner, repo, checkRunId, checkNam
102594
102597
  // Only execute if not in test environment
102595
102598
  if (process.env.NODE_ENV !== 'test' && process.env.JEST_WORKER_ID === undefined) {
102596
102599
  (() => {
102597
- // Simple mode detection: use GITHUB_ACTIONS env var which is always 'true' in GitHub Actions
102598
- // Also check for --cli flag to force CLI mode even in GitHub Actions environment
102599
- const isGitHubAction = process.env.GITHUB_ACTIONS === 'true' && !process.argv.includes('--cli');
102600
- if (isGitHubAction) {
102601
- // Run as GitHub Action
102600
+ // Explicit, argument-driven mode selection. No auto-detection of GitHub Actions.
102601
+ // Priority order: --mode flag > VISOR_MODE env > INPUT_MODE env > default 'cli'.
102602
+ const argv = process.argv;
102603
+ let modeFromArg;
102604
+ for (let i = 0; i < argv.length; i++) {
102605
+ const arg = argv[i];
102606
+ if (arg === '--mode' && i + 1 < argv.length) {
102607
+ modeFromArg = argv[i + 1];
102608
+ break;
102609
+ }
102610
+ else if (arg.startsWith('--mode=')) {
102611
+ modeFromArg = arg.split('=')[1];
102612
+ break;
102613
+ }
102614
+ }
102615
+ const mode = (modeFromArg || process.env.VISOR_MODE || process.env.INPUT_MODE || 'cli')
102616
+ .toString()
102617
+ .toLowerCase();
102618
+ const isGitHubMode = mode === 'github-actions' || mode === 'github';
102619
+ if (isGitHubMode) {
102620
+ // Run in GitHub Action mode explicitly
102602
102621
  run();
102603
102622
  }
102604
102623
  else {
102605
- // Import and run CLI
102624
+ // Default to CLI mode
102606
102625
  Promise.resolve().then(() => __importStar(__nccwpck_require__(10091))).then(({ main }) => {
102607
102626
  main().catch(error => {
102608
102627
  console.error('CLI execution failed:', error);
@@ -217241,7 +217260,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec
217241
217260
  /***/ ((module) => {
217242
217261
 
217243
217262
  "use strict";
217244
- module.exports = {"rE":"0.1.73"};
217263
+ module.exports = {"rE":"0.1.74"};
217245
217264
 
217246
217265
  /***/ })
217247
217266
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/visor",
3
- "version": "0.1.73",
3
+ "version": "0.1.74",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "visor": "./dist/index.js"