actions / actions/runner

Differentiate between input parameter empty or not present

Open
#924 13 comments 82 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug papercut Runner Bug
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:

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.