Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

How can I encrypt just the values of a .env file?

$
0
0

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:

ACCESS_KEY = mykeysecret123

ANOTHER_KEY = key2secret

.env-file

And like this (encrypted) in the GitHub repo:

ACCESS_KEY = f4d5dfa6f5da4f6as5dfsdhgzxcvr4

ANOTHER_KEY = dhjdujfk5f64f8ghjdj5j56jhjh4jhf

.env-file-encrypted

Very similar to what transcrypt 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:

import { ACCESS_KEY, ANOTHER_KEY} from 'react-native-dotenv'

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.


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>