title: How can I encrypt just the values of a .env file?
body: <p>I need the names of the keys for a build pipeline in GitHub actions, the values of the keys encrypted in the repo but decrypted in my local environment.
  Example:
  I need the .env file like this (decrypted) in my local environment:</p>
  <p>ACCESS_KEY = mykeysecret123</p>
  <p>ANOTHER_KEY = key2secret</p>
  <p><a href="https://i.stack.imgur.com/MN1V3.png" rel="nofollow noreferrer">.env-file</a></p>
  <p>And like this (encrypted) in the GitHub repo:</p>
  <p>ACCESS_KEY = f4d5dfa6f5da4f6as5dfsdhgzxcvr4</p>
  <p>ANOTHER_KEY = dhjdujfk5f64f8ghjdj5j56jhjh4jhf</p>
  <p><a href="https://i.stack.imgur.com/3HCof.png" rel="nofollow noreferrer">.env-file-encrypted</a></p>
  <p>Very similar to what <a href="https://github.com/elasticdog/transcrypt" rel="nofollow noreferrer">transcrypt</a> does, but transcypt encrypts the whole file, and I need the key names of the file to be not-encrypted, so when the build runs in Github actions it can find the names of the variables. The build does not need the actual secret values. It's failing becase I have a config file with:</p>
  <pre><code>import { ACCESS_KEY, ANOTHER_KEY} from 'react-native-dotenv'
  </code></pre>
  <p>And when the build looks for those names in the .env file, it can't find them if the file is encrypted with transcrypt or git-crypt or any other encrypting tool that encrypts the whole file.</p>