Skip to content

โš™๏ธ Use this action to export GitHub defined secrets and vars to the runner environment variables and a specified file. ๐Ÿ“Œ

License

Notifications You must be signed in to change notification settings

jakubcieslik99/secrets-vars-to-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

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Export GitHub secrets & vars to environment variables & specified file โš™๏ธ

๐Ÿ“Œ Use this action to export GitHub defined secrets and vars to the runner environment variables and a specified file.

GitHub top language GitHub repo size

Inputs

secrets

Required

JSON representation of the GitHub secrets (${{ toJSON(secrets) }}), use provided placeholder or a boolean false value to skip.

vars

Required

JSON representation of the GitHub vars (${{ toJSON(vars) }}), use provided placeholder or a boolean false value to skip.

hydrate-env

Boolean indicating whether to fill GitHub runner environment variables with the GitHub secrets & vars, default: true.

generate-file

File name to export GitHub secrets & vars to, e.g.: .env, if not provided, will export to .env. If set to false, will not generate the file.

include

Optional comma-separated list of secrets & vars to fill/export, e.g.: MYSQL_USER, MYSQL_PASSWORD.

exclude

Optional comma-separated list of secrets & vars to skip filling/exporting, e.g.: POSTGRES_USER, POSTGRES_PASSWORD.

overwrite-script-envs

Boolean indicating whether to overwrite existing environment variables defined directly in your GitHub Actions script in case of any match, default: true.

append-script-envs

Optional comma-separated list of GitHub runner environment variables defined directly in your GitHub Actions script to export to the file, e.g.: ENV, DIR.

secrets-prefix

Optional prefix for the secrets, e.g.: SECRET_, default: no prefix.

vars-prefix

Optional prefix for the vars, e.g.: VAR_, default: no prefix.

Example usage

uses: jakubcieslik99/secrets-vars-to-env-file-action@main
with:
  secrets: ${{ toJSON(secrets) }}
  vars: ${{ toJSON(vars) }}

Feedback

If you have any feedback, please reach out to me at โœ‰๏ธ [email protected]

Authors