Skip to content

dev-five-git/overwrite-env-file-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

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overwrite Env File

This GitHub Action allows you to overwrite the contents of an environment file with the contents of another file. It is useful when you want to promote/stage environment variables from one environment to another (for example, from a .env.development file to a .env.production file) automatically in your workflows.

Usage

- name: Overwrite production env file with development env file
  uses: dev-five-git/overwrite-env-file-action@v1
  with:
    input: .env.development
    output: .env.production

Inputs

Name Description Required Default
input The file to read from true .env.development
output The file to overwrite to true .env.production

Example Workflow

name: Promote env to production

on:
  push:
    branches: [main, dev]

jobs:
  promote-env:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Overwrite production env file with development env file
        uses: dev-five-git/overwrite-env-file-action@v1
        if: github.ref_name == 'dev'

About

Overwrite Env File

Resources

License

Stars

Watchers

Forks

Packages

No packages published