@htekdev/actions-debugger 1.0.118 → 1.0.120

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,103 @@
1
+ id: yaml-syntax-073
2
+ title: "setup-python 'python-version: 3.10' Parsed as YAML Float 3.1 — Wrong Python Version Installed"
3
+ category: yaml-syntax
4
+ severity: silent-failure
5
+ tags:
6
+ - setup-python
7
+ - yaml-float
8
+ - python-version
9
+ - version-mismatch
10
+ - silent-failure
11
+ patterns:
12
+ - regex: 'Version 3\.1 with arch .{0,20} not found'
13
+ flags: 'i'
14
+ - regex: "Installed Python 3\\.1\\."
15
+ flags: 'i'
16
+ - regex: 'python.version.*3\.10.*3\.1|3\.10.*yaml.*float'
17
+ flags: 'i'
18
+ error_messages:
19
+ - "Version 3.1 with arch x64 not found in the local, remote file."
20
+ - "Version 3.1 with arch x64 not found"
21
+ - "Installed Python 3.1.5"
22
+ - "Error: Version 3.1 was not found in the local cache"
23
+ root_cause: |
24
+ When 'python-version' is specified as a bare unquoted decimal like 3.10
25
+ in a workflow YAML file, the YAML parser interprets the value as a
26
+ floating-point number. The float representation of 3.10 is 3.1 (the
27
+ trailing zero is dropped during float-to-string conversion).
28
+
29
+ actions/setup-python then receives the string "3.1" and attempts to
30
+ install Python version 3.1.x. Python 3.1 is an extremely old release
31
+ from 2009 and is not available in the tool cache. The action either:
32
+
33
+ a) Fails with "Version 3.1 with arch x64 not found" — if the version
34
+ is not in the manifest (common on GitHub-hosted runners).
35
+ b) Silently installs the latest 3.1.x if one happens to be cached,
36
+ giving developers an unexpectedly old Python environment with no
37
+ warning.
38
+
39
+ Affected version strings: any Python version where the minor version
40
+ ends in zero (3.10, 3.20 if it existed, etc.) or has trailing decimal
41
+ zeros (3.10.0 → still has the problem if written unquoted as 3.10).
42
+
43
+ The same YAML float coercion affects other setup-* actions:
44
+ - setup-go with go-version: 1.20 → "1.2" (yaml-syntax-027)
45
+ - setup-node with node-version: 18.10 → "18.1"
46
+ This entry specifically covers setup-python.
47
+ fix: |
48
+ Always quote the python-version value in YAML to force the parser to
49
+ treat it as a string, not a number.
50
+ fix_code:
51
+ - language: yaml
52
+ label: "Wrong — unquoted 3.10 parsed as float 3.1"
53
+ code: |
54
+ - name: Set up Python
55
+ uses: actions/setup-python@v5
56
+ with:
57
+ python-version: 3.10 # ❌ YAML parses as float → installs 3.1.x
58
+
59
+ - language: yaml
60
+ label: "Fixed — quoted string forces correct version"
61
+ code: |
62
+ - name: Set up Python
63
+ uses: actions/setup-python@v5
64
+ with:
65
+ python-version: '3.10' # ✅ Quoted string → installs 3.10.x
66
+
67
+ - language: yaml
68
+ label: "Fixed — matrix with quoted python versions"
69
+ code: |
70
+ jobs:
71
+ test:
72
+ strategy:
73
+ matrix:
74
+ python-version: ['3.9', '3.10', '3.11', '3.12']
75
+ # ^^^^^^ ^^^^^^ ^^^^^^ ^^^^^^
76
+ # All quoted — prevents YAML float coercion for any version
77
+ steps:
78
+ - uses: actions/setup-python@v5
79
+ with:
80
+ python-version: ${{ matrix.python-version }}
81
+
82
+ - language: yaml
83
+ label: "Alternative — use python-version-file to avoid manual version strings"
84
+ code: |
85
+ - uses: actions/setup-python@v5
86
+ with:
87
+ python-version-file: '.python-version'
88
+ # .python-version file contains: 3.10.14
89
+ # File-based version is read as plain text, not YAML — no float risk
90
+
91
+ prevention:
92
+ - "Always quote python-version values in YAML: '3.10' not 3.10."
93
+ - "Use python-version-file: '.python-version' or pyproject.toml to read version from a non-YAML source."
94
+ - "Apply the same quoting rule to all setup-* version inputs: '1.20' for Go, '18.10' for Node."
95
+ - "Run actionlint — it warns about unquoted version strings in matrix definitions."
96
+ - "Check 'Set up Python' step output in the Actions log — it shows the resolved version string."
97
+ docs:
98
+ - url: "https://github.com/actions/setup-python/issues/160"
99
+ label: "actions/setup-python#160 — python-version 3.10 parsed as float 3.1 (109 reactions)"
100
+ - url: "https://yaml.org/spec/1.2.2/#floating-point-scalars"
101
+ label: "YAML spec — floating-point scalar parsing rules"
102
+ - url: "https://github.com/actions/setup-python#supported-version-syntax"
103
+ label: "actions/setup-python — supported version syntax"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htekdev/actions-debugger",
3
- "version": "1.0.118",
3
+ "version": "1.0.120",
4
4
  "description": "65+ real GitHub Actions errors, queryable by agents. CLI + MCP server + Copilot skills + error database.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",