Skip to content

dev-five-git/action-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Action Tools

Actions

Collect Env

This GitHub Action allows you to collect environment variables with a specific prefix and write them to a file. It is useful when you want to extract environment variables that match a certain pattern and save them to a .env file for deployment or configuration purposes.

Usage

- name: Collect environment variables
  uses: ./action-tools/collect-env
  with:
    prefix: 'API_'
    output: '.env.api'
    remove-prefix: true

Inputs

Name Description Required Default
prefix The prefix to filter environment variables by true -
output The output file to write the collected variables to true -
remove-prefix Whether to remove the prefix from variable names in the output false false

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: ./action-tools/overwrite-env-file
  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]

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: ./actions/overwrite-env-file
        with:
          input: .env.development
          output: .env.production

About

devfive cicd action tools

Resources

Stars

Watchers

Forks

Packages

No packages published