Skip to content

Commit

Permalink
fix(core): nx migrate should not prompt if on CI server (#15256)
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Feb 27, 2023
1 parent ee3413b commit 0a9c200
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/nx/src/command-line/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import { messages, recordStat } from '../utils/ab-testing';
import { nxVersion } from '../utils/versions';
import { existsSync } from 'fs';
import { workspaceRoot } from '../utils/workspace-root';
import { isCI } from '../utils/is-ci';

export interface ResolvedMigrationConfiguration extends MigrationsJson {
packageGroup?: ArrayPackageGroup;
Expand Down Expand Up @@ -1108,7 +1109,8 @@ async function generateMigrationsJsonAndUpdatePackageJson(
try {
if (
['nx', '@nrwl/workspace'].includes(opts.targetPackage) &&
(await isMigratingToNewMajor(from, opts.targetVersion))
(await isMigratingToNewMajor(from, opts.targetVersion)) &&
!isCI
) {
const useCloud = await connectToNxCloudCommand(
messages.getPromptMessage('nxCloudMigration')
Expand Down Expand Up @@ -1137,7 +1139,7 @@ async function generateMigrationsJsonAndUpdatePackageJson(
fetch: createFetcher(),
from: opts.from,
to: opts.to,
interactive: opts.interactive,
interactive: opts.interactive && !isCI,
excludeAppliedMigrations: opts.excludeAppliedMigrations,
});

Expand Down

1 comment on commit 0a9c200

@vercel
Copy link

@vercel vercel bot commented on 0a9c200 Feb 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx.dev
nx-five.vercel.app

Please sign in to comment.