diff --git a/CHANGELOG.md b/CHANGELOG.md index 261e4dfd58..d50ed97b0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿ› Bug fixes +- Make `eas config` command not require authentication when running in `--eas-json-only` mode. ([#2517](https://github.com/expo/eas-cli/pull/2517) by [@szdziedzic](https://github.com/szdziedzic)) + ### ๐Ÿงน Chores ## [11.0.0](https://github.com/expo/eas-cli/releases/tag/v11.0.0) - 2024-08-26 diff --git a/packages/eas-cli/src/commands/config.ts b/packages/eas-cli/src/commands/config.ts index 65e8689639..7f66f67aef 100644 --- a/packages/eas-cli/src/commands/config.ts +++ b/packages/eas-cli/src/commands/config.ts @@ -6,6 +6,7 @@ import chalk from 'chalk'; import { evaluateConfigWithEnvVarsAsync } from '../build/evaluateConfigWithEnvVarsAsync'; import EasCommand from '../commandUtils/EasCommand'; +import { createGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient'; import { EASEnvironmentFlagHidden, EasNonInteractiveAndJsonFlags } from '../commandUtils/flags'; import { toAppPlatform } from '../graphql/types/AppPlatform'; import Log from '../log'; @@ -35,7 +36,7 @@ export default class Config extends EasCommand { static override contextDefinition = { ...this.ContextOptions.DynamicProjectConfig, ...this.ContextOptions.ProjectDir, - ...this.ContextOptions.LoggedIn, + ...this.ContextOptions.SessionManagment, }; async runAsync(): Promise { @@ -43,14 +44,15 @@ export default class Config extends EasCommand { if (flags.json) { enableJsonOutput(); } - const { platform: maybePlatform, profile: maybeProfile } = flags; const { - getDynamicPublicProjectConfigAsync, - projectDir, - loggedIn: { graphqlClient }, - } = await this.getContextAsync(Config, { - nonInteractive: false, - }); + platform: maybePlatform, + profile: maybeProfile, + 'non-interactive': nonInteractive, + } = flags; + const { getDynamicPublicProjectConfigAsync, projectDir, sessionManager } = + await this.getContextAsync(Config, { + nonInteractive, + }); const accessor = EasJsonAccessor.fromProjectPath(projectDir); const profileName = @@ -87,6 +89,10 @@ export default class Config extends EasCommand { Log.log(JSON.stringify(profile, null, 2)); } } else { + const { authenticationInfo } = await sessionManager.ensureLoggedInAsync({ + nonInteractive, + }); + const graphqlClient = createGraphqlClient(authenticationInfo); const { exp: appConfig } = await evaluateConfigWithEnvVarsAsync({ flags, buildProfile: profile,