expo / expo/eas-cli

`eas env:pull` does not properly escape env variables which contain a `#`

Open
#2,813 3 comments 1 reaction 1 assignee Claimed by @khamilowicz View on GitHub
eas build issue accepted
Dominant language
TypeScript
Stars
1.4k
Forks
236
Avg merge
3d 1h
Merged PRs (30d)
91

Description

### Build/Submit details page URL

_No response_

### Summary

I have an env variable which contains a hex color code, for example `#ffffff`
When pulling using eas:pull it generates an env file containing
```
ENV_VARIABLE=#99ccff
```

when parsing the env file (using dotenv) it treats the `#` as the start of a comment and ignores the rest of the line.
as per the dotenv docs the value should be wrapped in quotes if it contains a `#`
see: https://github.com/motdotla/dotenv#comments

### Managed or bare?

Bare

### Environment

expo-env-info 1.2.2 environment info:
System:
OS: macOS 15.1.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.20.5 - ~/.volta/tools/image/node/18.20.5/bin/node
Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
npm: 10.8.2 - ~/.volta/tools/image/node/18.20.5/bin/npm
Managers:
CocoaPods: 1.16.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 24.2, iOS 18.2, macOS 15.2, tvOS 18.2, visionOS 2.2, watchOS 11.2
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8512546
Xcode: 16.2/16C5032a - /usr/bin/xcodebuild
npmPackages:
expo: ^52.0.23 => 52.0.23
expo-router: ~4.0.15 => 4.0.15
react: 18.3.1 => 18.3.1
react-native: 0.76.5 => 0.76.5
Expo Workflow: bare

### Error output

_No response_

### Reproducible demo or steps to reproduce from a blank project

```
eas env:create --name TEST --value #ffffff --type string --visibility plaintext --environment development
eas env:pull --environment development
```

The generated `.env.local` will contain `TEST=#ffffff` and therefor will not properly load the env variable.
Manually correcting the variable to be wrapped in quotes, like this`TEST="#ffffff" correctly loads the env variable.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.