Skip to content

loadenv-action

Actions
GitHub Action for loading environment variables
v0.0.1
Latest
Star (1)

LoadEnv GitHub Action

Examples

jobs:
  simple:
    runs-on: ubuntu-latest
    steps:
      - uses: akefirad/loadenv-action@naun
      - run: echo $FOO $BAR # FOO and BAR are defined in <root>/.env file

  complex:
    runs-on: ubuntu-latest
    steps:
      - uses: akefirad/loadenv-action@main
        id: loadenv
        name: Loads `./path/to/.env`, expands, checks, and export variables
        with:
          files: ./path/to/.env
          strict: true      # default true
          expand-vars: true # default true
          export-vars: true # default true
          additional-vars: "${{ toJSON(vars) }}" # to make them available while expanding!!!
      - name: Use output variables
        run: echo  ${{ steps.loadenv.FOO }} ${{ steps.loadenv.BAR }}
      - name: Use exported variables
        run: echo $FOO $BAR

See tests.yml file for more examples.

API

See action.yml file for full API.

loadenv-action 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

GitHub Action for loading environment variables
v0.0.1
Latest

loadenv-action 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.