You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
Add an option not to add/update environment variables.
Justification:
When using actions/setup-python, it will update or add PATH, PythonLocation, PKG_CONFIG environment variables.
If one is to use actions/setup-python inside a composite action, those environment variables update might conflict with a user workflow.
e.g.
- uses: actions/setup-python@v3with:
python-version: "3.7"
- uses: some/composite-action@v1 # Runs a different setup-python internally with python-version: "3.10"
- run: python --version # this will show python 3.10 while the user expects 3.7
With this proposal, some/composite-action could use:
- uses: actions/setup-python@v3id: cp310with:
python-version: "3.10"no-environment-update: true
- run: ${{ steps.cp310.outputs.python-path }} --version # this will show python 3.10 in the composite action
The user workflow will now print python 3.7 as expected.
Then using the action would have no side effects for later steps - neither the Python activation nor the required dependencies are leaked. Currently, "nice" (non-leaky) composite actions are limited by what the default Python attached to pipx is.
@panticmilos I would rename the option from no-environment-update to preserve-environment because the environment might need to be changed within the nested action and restored when the flow returns back to outer.
Moreover it would make a sense to add this option to the all actions globally.
Description:
Add an option not to add/update environment variables.
Justification:
When using
actions/setup-python
, it will update or addPATH
,PythonLocation
,PKG_CONFIG
environment variables.If one is to use
actions/setup-python
inside a composite action, those environment variables update might conflict with a user workflow.e.g.
With this proposal,
some/composite-action
could use:The user workflow will now print
python 3.7
as expected.Are you willing to submit a PR?
Yes: #411
The text was updated successfully, but these errors were encountered: