How do I specify or change an environment variable as part of a job matrix?
For example, here I want my job to echo "Two" and "Three" instead of "One", but github completely ignores the definition or change of the environment variable in the matrix:
name: test-test-test on: push: branches: [ main, develop ] pull_request: branches: [ main, develop ] env: MY_VAR: One jobs: test: runs-on: ubuntu-latest strategy: matrix: include: - env: MY_VAR: Two - env: MY_VAR: Three steps: - run: echo "$MY_VAR2"
echo "One" and
echo "One" in both jobs.
Use this context to access information about environment variables that have been set in a workflow, step, or job. Note that you cannot use the env context in the value of the id and uses keys within a step. An example is
GitHub provides extensive documentation about contexts at