Github Action to write Github Secrets into a .env file. The action looks for variables that start with INPUT_ENV_
and creates a .env file with them.
Required Should start with INPUT_ENV_
prefix
Required Should be in the format specified in Github's documentation
Optional The name of the file to be written. Default .env
- Add it as a new step to your job.
- Add a key/value in
with:
section. - Go to your
repository -> settings -> secrets
and add secrets you want to be written into a .env file.
on:
push:
branches:
- master
jobs:
create_env_file_job:
runs-on: ubuntu-latest
steps:
- name: Create .env file
uses: ozaytsev86/create-env-file@v1
with:
INPUT_ENV_TEST_API_KEY: ${{ secrets.TEST_API_KEY }}
INPUT_ENV_ANOTHER_KEY: ${{ secrets.ANOTHER_KEY }}
NOTE: be sure that ubuntu-latest
or any other image you use has node installed.
TEST_API_KEY=1234test
ANOTHER_KEY=Super secret
This project released under the MIT License.