actions / actions/toolkit

Numerical removal of trailing zeros breaks version number inputs not entered as strings

Open
#1,682 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

This issue is more general, but specifically a problem for version numbers.

Take

with:
    version: 1.10

getInput returns this as a string "1.1", whereas

with:
    version: '1.10'

getInput returns a string "1.10".

In version numbers 1.1 != 1.10, and it's not possible for the action to defend against this to tell whether the entry might have been treated as a number before being presented as a string.

Expected behavior

getInput provide a way to get the raw entry, or indicate if input has been treated as a number before being returned as a string.

Or just never drop trailing zeros..

Contributor guide

Open the contributing guide

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

Start at the getInput entry point and trace how unquoted workflow values are converted before reaching it. Reproduce the 1.10 versus '1.10' cases, then inspect any input tests; done means the API preserves enough information to distinguish them or clearly reports numeric coercion.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.