A GitHub action that appends a variable to a dotenv file.
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.