Open
Description
Current behavior:
- If an input parameter is defined in action.yml (without default value), GitHub will set the INPUT_PARAMNAME environment variable to an empty value if the parameter is not present in the workflow
Expected behavior:
- If an input parameter is defined in action.yml (without default value), GitHub should not set the INPUT_PARAMNAME environment variable to an empty value if the parameter is not present in the workflow
Possibly related issue for JavaScript actions: actions/toolkit#272
Resources that illustrate this issue:
- Dockerfile: https://github.com/rsenden/test-empty-var-action/blob/master/Dockerfile
- GitHub Action for this Docker image: https://github.com/rsenden/test-empty-var-action/blob/master/action.yml
- Sample workflow that invokes this Docker image both directly and through the action, with the test input parameter not set: https://github.com/rsenden/test-empty-var-action/blob/master/.github/workflows/notset.yml
- Workflow output: https://github.com/rsenden/test-empty-var-action/runs/1707506513?check_suite_focus=true
As can be seen in the workflow output, results are different between running the Docker image directly or through the GitHub Action.
This can cause issues if a Docker image (or other action implementation) differentiates between 'empty' and 'not set'. If an action wants to set an empty value as the default value, then this should be done using the default property in the action definition.
Can you please get this fixed?
Activity