This action creates a secrets file (e.g. .env) by taking environment keys from github secrets.
uses: du5rte/create-secrets-file@v1
with:
secrets: |
API_KEY=${{ secrets.API_KEY }}
SECRET_KEY=${{ secrets.SECRET_KEY }}
DB_URI=${{ secrets.DB_URI }}
# optionals
# file: .env
# mode: dotenv
# path: srcNote!
By default the action dirname would be /home/runner/work/_actions/du5rte/create-secrets-file/v1 instead it saves it 3 scopes bellow to be accessible to other actions /home/runner/work/.env.
If you need a simple secrets handler for Node.js 🗝️, checkout secrets
import 'secrets'Also works with babel
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['secrets/babel-plugin-secrets'],
}
To create secrets .env file on demands on your github actions checkout du5rte/create-secrets-file
Required The environment keys you wish to save to the file
Optional The file name it will save it to. Default .env.
It should output what keys were parsed and the file
Found ".env" in "/":
{
API_KEY: ***
SECRET_KEY: ***
DB_URI: ***
}
It should then
API_KEY: 9j39j39j39j39j3
SECRET_KEY: 0k30k30k30k30k30k3
DB_URI: mongodb+srv://cluster-6f36f36f3.mongodb.net