A GitHub composite action to append environment variables to a dotenv file.
Inspired by: TickX/var-to-dotenv and CallePuzzle/envvar-to-dotenv-action.
jobs:
single:
name: Single
runs-on: ubuntu-latest
steps:
- name: Creating .env file
uses: fmunirdev/envvar-to-dotenv-action@v0.2.0
env:
ENV_VAR1: 'value'
with:
variableName: ENV_VAR1
jobs:
multiple:
name: Multiple
runs-on: ubuntu-latest
steps:
- name: Creating .env file
uses: fmunirdev/envvar-to-dotenv-action@v0.2.0
env:
ENV_VAR1: 'value 1'
ENV_VAR2: 'value 2'
ENV_VAR3: 'value 3'
with:
variableName: ENV_VAR1,ENV_VAR2,ENV_VAR3
jobs:
multiple:
name: Multiple
runs-on: ubuntu-latest
steps:
- name: Creating .env file
uses: fmunirdev/envvar-to-dotenv-action@v0.2.0
env:
SECRET_VAR1: ${{ secrets.SECRET_VAR1 }}
ENV_VAR: 'value'
with:
variableName: SECRET_VAR1,ENV_VAR
The created env file can be configured via target. If the target contains a folder path folders will be created automatically
jobs:
multiple:
name: Target
runs-on: ubuntu-latest
steps:
- name: Creating .env file
uses: fmunirdev/envvar-to-dotenv-action@v0.2.0
env:
ENV_VAR: 'value'
with:
variableName: ENV_VAR
target: .prod.env