Skip to content

A GitHub action that transfers secrets to environment variables

Notifications You must be signed in to change notification settings

Firenza/secrets-to-env

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

fa25c79 · Apr 17, 2024

History

36 Commits
Apr 17, 2024
Oct 18, 2021
Oct 18, 2021
Oct 15, 2021
Apr 17, 2024
Apr 17, 2024
Oct 18, 2021
Oct 18, 2021
Oct 18, 2021
Apr 17, 2024

Repository files navigation

secrets-to-env

Copies the specified secrets from the repository into environment variables. This can be useful when you have tools like Terraform that automatically take env var inputs of a certain prefix (E.G. TF_VAR_) and you want to avoid having to update your workflow files to map each secret to an env var.

Usage

Copy all secrets

uses: Firenza/secrets-to-env@v1.3.0
with:
    secrets: ${{ toJSON(secrets) }}

Only copy secrets with names starting with TF_VAR_

uses: Firenza/secrets-to-env@v1.3.0

with:
    secrets: ${{ toJSON(secrets) }}
    secret_filter_regex: TF_VAR_*

Only copy secrets with names starting with TF_VAR_ and have the copied environment variable names have everything after TF_VAR_ be lowercase.

uses: Firenza/secrets-to-env@v1.3.0
with:
    secrets: ${{ toJSON(secrets) }}
    secret_filter_regex: TF_VAR_*
    env_var_name_lower_case_regex: (?<=TF_VAR_).*