Skip to content

Commit

Permalink
[eas-cli] pass server env when resolving fingerprint runtime version (#…
Browse files Browse the repository at this point in the history
…2867)

# Why

receiving an issue for a customer who uses eas environment and continuous-deploy-fingerprint github action. they have build variants setup in their app.config.ts. the app id, scheme and some other properties are determined by their `APP_VARIANT` variable. the `APP_VARIANT` is from eas server environment.

when continuous-deploy-fingerprint first calculates fingerprint, it uses `eas env:exec` for the `npx expo-updates fingerprint:generate` call. the `APP_VARIANT` is correctly passed.
then for `eas update` call, it doesn't pass the `APP_VARIANT` env and generates an inconsistent fingerprint.

# How

pass server env to the `getRuntimeVersionInfoObjectsAsync()` (`npx expo-updates runtimeversion:resolve`)
  • Loading branch information
Kudo authored Feb 4, 2025
1 parent be9fb59 commit 28f3a92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This is the log of notable changes to EAS CLI and related packages.

### 🐛 Bug fixes

- Fixed EAS server environment variables does not pass to `npx expo-updates runtimeversion:resolve` call. ([#2867](https://github.com/expo/eas-cli/pull/2867) by [@kudo](https://github.com/kudo))

### 🧹 Chores

## [15.0.2](https://github.com/expo/eas-cli/releases/tag/v15.0.2) - 2025-02-04
Expand Down
12 changes: 6 additions & 6 deletions packages/eas-cli/src/commands/update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ export default class UpdatePublish extends EasCommand {
jsonFlag,
});

const maybeServerEnv = environment
? { ...(await getServerSideEnvironmentVariablesAsync()), EXPO_NO_DOTENV: '1' }
: {};

// build bundle and upload assets for a new publish
if (!skipBundler) {
const bundleSpinner = ora().start('Exporting...');
Expand All @@ -247,11 +251,7 @@ export default class UpdatePublish extends EasCommand {
exp,
platformFlag: requestedPlatform,
clearCache,
extraEnv: {
...(environment
? { ...(await getServerSideEnvironmentVariablesAsync()), EXPO_NO_DOTENV: '1' }
: {}),
},
extraEnv: maybeServerEnv,
});
bundleSpinner.succeed('Exported bundle(s)');
} catch (e) {
Expand Down Expand Up @@ -393,7 +393,7 @@ export default class UpdatePublish extends EasCommand {
...workflows,
web: Workflow.UNKNOWN,
},
env: undefined,
env: maybeServerEnv,
});
const runtimeToPlatformsAndFingerprintInfoMapping =
getRuntimeToPlatformsAndFingerprintInfoMappingFromRuntimeVersionInfoObjects(
Expand Down

0 comments on commit 28f3a92

Please sign in to comment.