Skip to content

Secrets to environment variables

Actions
Clones the specified repository secrets into environment variables
v1.3.0
Latest
Star (0)

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_).*

Secrets to environment variables is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Clones the specified repository secrets into environment variables
v1.3.0
Latest

Secrets to environment variables is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.