Documentation bug: expression numbers are mis-documented
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github-actions, javascript
- Domain
- documentation
Research direction
Start with the “Literals” section of the GitHub Actions expression syntax page and compare the Free, Pro, and Teams, GHES, and GHEC versions. Review the referenced parser source at expressions/src/data/string.ts lines 14–16 and the linked Number coercion rules. Done means the documentation accurately describes accepted number literals across all affected pages.
Written by the indexing model from the issue text.
Description
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
The "Literals" section of the GitHub Actions expression syntax page:
https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#literals
That link is for the "Free, Pro, and Teams" page, but the GHES and GHEC pages are also affected.
What part(s) of the article would you like to see updated?
The number literal is documented as "Any number format supported by JSON." However, in reality, the GitHub Actions expression parser takes a much larger set of literals, which it coerces to numbers.
For example, neither hex nor octal literals are valid in JSON, but GitHub Actions accepts them. For example:
${{ 0xff }}
${{ 0o777 }}
More generally, GitHub Actions appears to support any number literal that the JavaScript Number(...) constructor can coerce a string from. Those coercion rules are documented here:
This can be seen in the official GitHub Actions expression parser, which appears to use the Number(...) constructor when turning a StringData lexeme into a number:
Additional information
Yes, this is trivially reproducible in any GitHub Actions workflow or action definition.
See https://github.com/zizmorcore/zizmor/pull/1628 for a related downstream report.
- Dominant language
- TypeScript
- Stars
- 20.9k
- Forks
- 68.8k
- Avg merge
- 15h 4m
- Merged PRs (30d)
- 103
Contributor guide
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.
More from github/docs
-
builder persona content
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
localization
Difficulty 2/5 1-2 days Newbie friendliness 72/100
-
builder persona
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
content localization
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
content localization
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·