Skip to content

A GitHub composite action to append environment variables to a dotenv file.

License

Notifications You must be signed in to change notification settings

fmunirdev/envvar-to-dotenv-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

env vars to dotenv action

A GitHub composite action to append environment variables to a dotenv file.

Inspired by: TickX/var-to-dotenv and CallePuzzle/envvar-to-dotenv-action.

Usage

Single variable

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

Multiple variables

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

With GitHub Secrets

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

With target

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   

About

A GitHub composite action to append environment variables to a dotenv file.

Resources

License

Stars

Watchers

Forks

Packages

No packages published