Skip to content
lock

GitHub Action

Variable to Dotenv

v1.1.4 Latest version

Variable to Dotenv

lock

Variable to Dotenv

Appends a variable to a dotenv file

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Variable to Dotenv

uses: TickX/var-to-dotenv@v1.1.4

Learn more about this action in TickX/var-to-dotenv

Choose a version

GitHub license

Variable to Dotenv

A GitHub action that appends a variable to a dotenv file.

Usage

steps:
  - uses: TickX/var-to-dotenv@v1.1.1
    with:
      key: 'SOME_API_URI' # [Required]
      value: ${{secrets.SOME_API_URI}} # [Required]
      default: 'https://api.alt.com' # [Optional] if `value` is empty, this is used instead
      nullable: 'false' # [Optional] if the resolved value is empty, the variable will be omitted
      envPath: '.env' # [Optional] The path to the dotenv file (defaults to `.env`)

You can use this more than once in your workflow to add multiple variables.