Skip to content
Discussion options

You must be logged in to vote

Hey @zdary,

Please find here with below sample script for sourcing env vars from .env.dev file.

      - name: fetch env vars from
        script: |
          BRANCH_ENV_FILE=".env.${CM_BRANCH}"
          echo $BRANCH_ENV_FILE
          if [ -f "$BRANCH_ENV_FILE" ]; then
            source "$BRANCH_ENV_FILE"
            echo "FOO=$FOO" >> $CM_ENV
            echo $FOO
          else
            echo "Environment file for branch ${CM_BRANCH} not found."
          fi

Currently, the script name and workflow name resolve to a string value rather than dynamically fetching it from an env var and setting it when you run the workflow. This is expected.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@zdary
Comment options

@himesh-cm
Comment options

@himesh-cm
Comment options

Answer selected by zdary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants