How do I use an env file with GitHub Actions?

a quick solution here could be having a step to manually create the .env file before you need it.

      - name: 'Create env file'
        run: |
          touch .env
          echo API_ENDPOINT="https://xxx.execute-api.us-west-2.amazonaws.com" >> .env
          echo API_KEY=${{ secrets.API_KEY }} >> .env
          cat .env

Leave a Comment