Differentiate between input parameter empty or not present
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 1.4k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 24
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: https://github.com/actions/toolkit/issues/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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the difference using the linked Dockerfile, action.yml, and .github/workflows/notset.yml, then compare the workflow output for an unset input. Trace how the runner maps action inputs to INPUT_PARAMNAME and verify that an omitted input is distinguishable from an explicitly empty or defaulted value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, docker, github-actions
- Domain
- ci-cd
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100