From 72c28d425917672a0c2ee601c3ae0a6cacdb7853 Mon Sep 17 00:00:00 2001 From: Quinlan Jung Date: Thu, 18 Jan 2024 13:58:43 -0800 Subject: [PATCH] [eas-cli] use branch mapping utility fn (#2186) * [eas-cli] use branch mapping utility fn * update CHANGELOG.md --- CHANGELOG.md | 2 ++ packages/eas-cli/src/commands/channel/edit.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e57f66ac36..4262ecdd87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿงน Chores +- Use branch mapping utility fn. ([#2186](https://github.com/expo/eas-cli/pull/2186) by [@quinlanj](https://github.com/quinlanj)) + ## [6.1.0](https://github.com/expo/eas-cli/releases/tag/v6.1.0) - 2024-01-18 ### ๐ŸŽ‰ New features diff --git a/packages/eas-cli/src/commands/channel/edit.ts b/packages/eas-cli/src/commands/channel/edit.ts index 6867386bbc..60e5e0359a 100644 --- a/packages/eas-cli/src/commands/channel/edit.ts +++ b/packages/eas-cli/src/commands/channel/edit.ts @@ -4,7 +4,11 @@ import { print } from 'graphql'; import gql from 'graphql-tag'; import { selectBranchOnAppAsync } from '../../branch/queries'; -import { hasEmptyBranchMap, hasStandardBranchMap } from '../../channel/branch-mapping'; +import { + getAlwaysTrueBranchMapping, + hasEmptyBranchMap, + hasStandardBranchMap, +} from '../../channel/branch-mapping'; import { selectChannelOnAppAsync } from '../../channel/queries'; import EasCommand from '../../commandUtils/EasCommand'; import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient'; @@ -124,11 +128,7 @@ export default class ChannelEdit extends EasCommand { const channel = await updateChannelBranchMappingAsync(graphqlClient, { channelId: existingChannel.id, - // todo: move branch mapping logic to utility - branchMapping: JSON.stringify({ - data: [{ branchId: branch.id, branchMappingLogic: 'true' }], - version: 0, - }), + branchMapping: JSON.stringify(getAlwaysTrueBranchMapping(branch.id)), }); if (json) {