-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: add update-environment
input
#411
Conversation
@@ -24,7 +24,7 @@ | |||
"license": "MIT", | |||
"dependencies": { | |||
"@actions/cache": "^2.0.2", | |||
"@actions/core": "^1.2.3", | |||
"@actions/core": "^1.7.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This required to be bumped to >= 1.3.0 to get getBooleanInput
support. I bumped to the same version as what's being proposed in #406
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to explore other solutions besides adding complexity to the action.
Can you just add steps to the composite action? For example:
# Save the environment
set > env.sh
# Restore the environment
source env.sh
@brcrista, For exportVariable: For addPath, it's values are always prepended to the "current" PATH, c.f. actions/toolkit#655 |
Hi @mayeut, I have some concerns about this feature. In order to use python that is installed by action without $PATH updating you should use exact paths to the installed python in a composite action. If there are any other tools in composite action which use python implicitly, then these tools will not use the version you expect. This can lead to confusion about which python version is used in some command or tool. From my point of view an installation of python without adding to PATH may create more complications than solve problems. |
This is an opt-in feature. It won't change a thing for existing users. If they choose to opt-in, they shall know the implications. As said in an earlier comment, it's just impossible to restore the environment as it was before running |
@mayeut, ok, I see. Since the AzDev |
2d144fe
to
48426e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll defer to @vsafonkin on this
action.yml
Outdated
no-environment-update: | ||
description: 'Set this option if you want the action not to update environment variables.' | ||
default: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no-environment-update: | |
description: 'Set this option if you want the action not to update environment variables.' | |
default: false | |
update-environment: | |
description: 'Set this option if you want the action to update environment variables.' | |
default: true |
Putting boolean inputs in positive terms is usually easier for people to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
This option allows to specify if the action shall update environment variables (default) or not. This allows to use the setup-python action in a composite action without side effect (except downloading/installing python if version is missing).
no-environment-update
inputupdate-environment
input
disallow actions/setup-python from changing environment variables; see: actions/runner#781 actions/setup-python#411
Description:
This option allows to specify if the action shall update environment variables (default) or not.
This allows to use the
setup-python
action in a composite action without side effect (except downloading/installing python if version is missing).Related issue:
fix #410
Check list: