Skip to content

Commit

Permalink
fix: don't prompt auth on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
vlasy committed Jan 7, 2020
1 parent d3cd41b commit 60ba483
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"glob": "7.1.6",
"gradle-to-js": "2.0.0",
"inversify": "5.0.1",
"is-travis": "^2.0.0",
"js-yaml": "3.13.1",
"lodash": "4.17.15",
"moment": "2.24.0",
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import updateNotifier from 'update-notifier';
import { ScanningStrategyDetectorUtils } from './detectors/utils/ScanningStrategyDetectorUtils';
import { PracticeImpact } from './model';
import { ServiceType } from './detectors/ScanningStrategyDetector';
import isTravis from 'is-travis';

class DXScannerCommand extends Command {
static description = 'Scan your project for possible DX recommendations.';
Expand Down Expand Up @@ -60,7 +61,7 @@ class DXScannerCommand extends Command {

let scanResult: ScanResult;
scanResult = await scanner.scan();
if (scanResult.needsAuth) {
if (scanResult.needsAuth && !isTravis) {
if (ScanningStrategyDetectorUtils.isGitHubPath(scanPath) || scanResult.serviceType === ServiceType.github) {
authorization = await cli.prompt('Insert your GitHub personal access token. https://github.com/settings/tokens\n', {
type: 'hide',
Expand Down
4 changes: 4 additions & 0 deletions types/is-travis/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module 'is-travis' {
const isTravis: boolean;
export = isTravis;
}

0 comments on commit 60ba483

Please sign in to comment.