Release: https://github.com/cross-platform-actions/action/tree/v1.1.0/
Previously, something like this was working fine:
- name: Set up and build
uses: cross-platform-actions/action@v1.1.0
env:
CC: gcc13
with:
operating_system: freebsd
version: '13.2'
environment_variables: CC
shell: sh
run: |
echo "CC: $CC"
But, now with v1.1.0 and shell: cpa.sh {0}, this doesn't work anymore:
- name: Set up FreeBSD
uses: cross-platform-actions/action@v1.1.0
env:
CC: gcc13
with:
operating_system: freebsd
version: '13.2'
environment_variables: CC
shell: sh
- name: Build
shell: cpa.sh {0}
run: |
echo "CC: $CC" ## CC is not available here
Also, with shell: cpa.sh {0}, the env context from the step itself is also not being propagated:
- name: Set up FreeBSD
uses: cross-platform-actions/action@v1.1.0
env:
CC: gcc13
with:
operating_system: freebsd
version: '13.2'
# environment_variables: CC ## commented (works if uncommented)
shell: sh
- name: Build
env:
CC: gcc13
shell: cpa.sh {0}
run: |
echo "CC: $CC" ## CC is not available here
For above, it would be great if the env context is automatically propagated to cpa.sh without mentioning in environment_variables.
Solution
Leverage env command from cpa.sh to filter and propagate specific env vars.
Proposed Solution 1: via --env-vars '<space-separated-list>' option
shell: cpa.sh {0} --env-vars "VAR_1 VAR_2 MY_VAR_* VAR_*_TEST_*"
Already implemented and demonstrated in #146.
Proposed Solution 2: via CPA_ENV_VARS env var
shell: cpa.sh {0}
env:
CPA_ENV_VARS: >-
VAR_1
VAR_2
MY_VAR_*
VAR_*_TEST_*
Release: https://github.com/cross-platform-actions/action/tree/v1.1.0/
Previously, something like this was working fine:
But, now with v1.1.0 and
shell: cpa.sh {0}, this doesn't work anymore:Also, with
shell: cpa.sh {0}, theenvcontext from the step itself is also not being propagated:For above, it would be great if the
envcontext is automatically propagated tocpa.shwithout mentioning inenvironment_variables.Solution
Leverage
envcommand fromcpa.shto filter and propagate specific env vars.Proposed Solution 1: via
--env-vars '<space-separated-list>'optionAlready implemented and demonstrated in #146.
Proposed Solution 2: via
CPA_ENV_VARSenv var