Skip to content

Clarify Actions number literal syntax - #45881

Open
kjanat wants to merge 2 commits into
github:mainfrom
kjanat:docs/actions-number-literal-syntax
Open

kjanat wants to merge 2 commits into
github:mainfrom
kjanat:docs/actions-number-literal-syntax

Conversation

@kjanat

@kjanat kjanat commented Sep 14, 2026

Copy link
Copy Markdown

Why:

Related to #43008.

The number-literal row says "Any number format supported by JSON", but the same page demonstrates hexadecimal (0xff), which JSON does not accept. Workflow authors and expression-tool implementers need an accurate description of the accepted syntax.

What's being changed:

Describe decimal integer and floating-point literals, exponent notation and hexadecimal literals explicitly, consistent with the examples already on the page.

Measurements and reproduction

On 14 September 2026, I reran the 44-expression corpus against GitHub Actions: 30 expressions were accepted and evaluated, and 14 were rejected by the expression parser with HTTP 422. The exact workflows, dispatch requests and responses, and successful-run logs are preserved.

The reference snapshot is tagged github-actions-expressions-of-concern. It contains:

For example, the measured 0x1F and 0o17 expressions both evaluate successfully, producing 31 and 15. Their uppercase-prefix counterparts, 0X1F and 0O17, are rejected. The complete table below lets reviewers inspect the accepted and rejected spellings together.

Service-side values were captured in run-name; runner-side values were captured through step environment variables. Both record the text returned by toJSON(). The capture used hosted Ubuntu runners with runner version 2.337.0. For -0, the service recorded 0 and the runner recorded -0; the other 29 accepted results agree.

All 44 expressions measured on 14 September 2026

Each evidence link points to the saved result under the reference tag.

Expression Dispatch Service toJSON() Runner toJSON() Saved evidence
+1 Accepted 1 1 literal-01
-0 Accepted 0 -0 literal-02
-1 Accepted -1 -1 literal-03
-Infinity Accepted -Infinity -Infinity literal-04
.5 Accepted 0.5 0.5 literal-05
.5e1 Accepted 5 5 literal-06
0 Accepted 0 0 literal-07
0.1 + 0.2 Rejected (HTTP 422) literal-08
00 Accepted 0 0 literal-09
0123 Accepted 123 123 literal-10
0B101 Rejected (HTTP 422) literal-11
0O17 Rejected (HTTP 422) literal-12
0X1F Rejected (HTTP 422) literal-13
0b101 Rejected (HTTP 422) literal-14
0o17 Accepted 15 15 literal-15
0o8 Rejected (HTTP 422) literal-16
0x01 Accepted 1 1 literal-17
0x0123 Accepted 291 291 literal-18
0x0e1 Accepted 225 225 literal-19
0x1F Accepted 31 31 literal-20
0xG Rejected (HTTP 422) literal-21
1 + 1 Rejected (HTTP 422) literal-22
1. Accepted 1 1 literal-23
1.0e+ Rejected (HTTP 422) literal-24
1.0e+99 Accepted 1E+99 1E+99 literal-25
1.5 Accepted 1.5 1.5 literal-26
1E+5 Accepted 100000 100000 literal-27
1_000 Rejected (HTTP 422) literal-28
1e Rejected (HTTP 422) literal-29
1e+ Rejected (HTTP 422) literal-30
1e+01 Accepted 10 10 literal-31
1e+5 == 100000 Accepted true true literal-32
1e+5 Accepted 100000 100000 literal-33
1e-0 Accepted 1 1 literal-34
1e-5 Accepted 1E-05 1E-05 literal-35
1e01 Accepted 10 10 literal-36
1e0123 Accepted 1E+123 1E+123 literal-37
1e309 Rejected (HTTP 422) literal-38
1e5 Accepted 100000 100000 literal-39
1e5e5 Rejected (HTTP 422) literal-40
2147483648 Accepted 2147483648 2147483648 literal-41
9007199254740993 Accepted 9.00719925474099E+15 9.00719925474099E+15 literal-42
Infinity Accepted Infinity Infinity literal-43
NaN Accepted NaN NaN literal-44

Validation

  • Reproduced all 44 expressions with retained evidence for every verdict.
  • The documentation patch changes the number table cell.
  • GitHub CI passed, including the documentation build, content lint, rendering and accessibility checks.

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

@github-actions github-actions Bot added the triage Do not begin working on this issue until triaged by the team label Sep 14, 2026
@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

How to review these changes 👓

Thank you for your contribution. To review these changes, choose one of the following options:

A Hubber will need to deploy your changes internally to review.

Table of review links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
actions/reference/workflows-and-actions/expressions.md fpt
ghec
ghes@ 3.22 3.21 3.20 3.19 3.18 3.17
fpt
ghec
ghes@ 3.22 3.21 3.20 3.19 3.18 3.17

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation should also cover the accepted lowercase 0o octal syntax.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates GitHub Actions expression documentation to clarify supported number literal syntax.

Changes:

  • Replaces the inaccurate JSON-based description.
  • Documents decimal, floating-point, exponent, and hexadecimal literals.
File summaries
File Summary
content/actions/reference/workflows-and-actions/expressions.md Clarifies number literal syntax. Remaining nit (3 votes): include lowercase 0o octal literals.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread content/actions/reference/workflows-and-actions/expressions.md Outdated
@kjanat kjanat changed the title docs: clarify Actions number literal syntax Clarify Actions number literal syntax Sep 15, 2026
@janiceilene

Copy link
Copy Markdown
Contributor

👋 @kjanat I'm going to triage this for the team to review, but since we don't have SME perspective on the issue yet, I'm not sure when we'll get this reviewed. Thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builder persona triage Do not begin working on this issue until triaged by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants