aws-amplify / aws-amplify/amplify-cli

Support AMPLIFY_SKIP_APP_ID_MISMATCH_CHECK in pull command

Open Beginner friendly
#14,233 0 comments 0 reactions 0 assignees View on GitHub
feature-request
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Basic info
- How did you install the Amplify CLI?: It's automatically installed on Amplify preview build.
- Node.js version: 18
- Amplify CLI version: Tried all v12.13.1 ~ latest
- Used OS: We haven't customize OS for build
- Any manual changes added? : No

### Overview
On Nov 14, 2024 (in v12.13.1) , amplify-cli added `AMPLIFY_SKIP_APP_ID_MISMATCH_CHECK` to allow projects using multi apps to avoid `AppId mismatch` error.

Reproducive setup details: https://github.com/aws-amplify/amplify-cli/issues/13973#issuecomment-2416805163
Announcement for the fix: https://github.com/aws-amplify/amplify-cli/issues/13973#issuecomment-2476444414

It only fixed `init` command so when `amplify pull` having the same check is executed in the pipeline, it fails with the same error.

### Ask
Could you add the same fix for `pull`?

Previous fix:https://github.com/aws-amplify/amplify-cli/blob/a007ec73a201477e3c236f3e674d278dc85f1534/packages/amplify-cli/src/commands/init.ts#L37
Code which needs the same fix: https://github.com/aws-amplify/amplify-cli/blob/a007ec73a201477e3c236f3e674d278dc85f1534/packages/amplify-cli/src/commands/pull.ts#L41

### Expected behavior

`amplify pull` for app using different app backend does not fail by `AppId mismatch`.

### Reproduction steps

1. Set up app in the step of https://github.com/aws-amplify/amplify-cli/issues/13973#issuecomment-2416805163
2. Execute `amplify pull` in the CI

### Project Identifier

_No response_

### Log output

```
...
2025-06-30T15:52:23.444Z [WARNING]: Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
2025-06-30T15:52:23.466Z [INFO]: ✅
2025-06-30T15:52:24.060Z [INFO]: ## Running amplify pull to generate aws-exports.js file for frontend
2025-06-30T15:52:25.919Z [INFO]: 🛑 Amplify appId mismatch.
2025-06-30T15:52:25.923Z [INFO]: Resolution: You are currently working in the amplify project with Id d2857w28z4f4mt
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
2025-06-30T15:52:25.970Z [INFO]:
...

```

### Additional information

_No response_

### Before submitting, please confirm:

- [x] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [x] I have removed any sensitive information from my code snippets and submission.

Contributor guide

Open the contributing guide

Research direction

Start by comparing packages/amplify-cli/src/commands/init.ts around the existing AMPLIFY_SKIP_APP_ID_MISMATCH_CHECK handling with packages/amplify-cli/src/commands/pull.ts around the app ID check. Reproduce the CI amplify pull scenario described in issue 13973, then verify that the environment variable allows a pull with a different backend app to complete without an AppId mismatch failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.