@htekdev/actions-debugger 1.0.14 → 1.0.15

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.
Files changed (50) hide show
  1. package/dist/db/search.js +3 -1
  2. package/dist/db/search.js.map +1 -1
  3. package/dist/tools/suggest-fix.d.ts.map +1 -1
  4. package/dist/tools/suggest-fix.js +5 -1
  5. package/dist/tools/suggest-fix.js.map +1 -1
  6. package/errors/caching-artifacts/cache-key-too-long.yml +93 -0
  7. package/errors/caching-artifacts/cache-path-not-exist-skipped.yml +152 -0
  8. package/errors/caching-artifacts/docker-buildx-gha-cache-capacity.yml +107 -0
  9. package/errors/caching-artifacts/setup-ruby-bundler-ephemeral-workdir-cache-miss.yml +147 -0
  10. package/errors/caching-artifacts/upload-artifact-v3-retirement-blocked.yml +123 -0
  11. package/errors/concurrency-timing/always-cleanup-5min-forced-kill.yml +140 -0
  12. package/errors/concurrency-timing/concurrency-group-env-context-undefined.yml +99 -0
  13. package/errors/concurrency-timing/required-check-pending-path-filter-skip.yml +160 -0
  14. package/errors/concurrency-timing/wait-timer-cancel-in-progress-starvation.yml +125 -0
  15. package/errors/known-unsolved/composite-action-step-timeout-minutes-ignored.yml +146 -0
  16. package/errors/known-unsolved/reusable-workflow-no-composite-action-call.yml +116 -0
  17. package/errors/known-unsolved/schedule-trigger-default-branch-only.yml +113 -0
  18. package/errors/known-unsolved/secrets-not-allowed-in-if-conditions.yml +149 -0
  19. package/errors/permissions-auth/dependabot-pr-secrets-unavailable.yml +133 -0
  20. package/errors/permissions-auth/fine-grained-pat-deployment-write-required.yml +146 -0
  21. package/errors/permissions-auth/github-app-installation-token-new-format.yml +124 -0
  22. package/errors/permissions-auth/github-packages-read-requires-packages-permission.yml +128 -0
  23. package/errors/permissions-auth/oidc-id-token-write-permission-missing.yml +169 -0
  24. package/errors/permissions-auth/permissions-empty-block-removes-contents-read.yml +97 -0
  25. package/errors/permissions-auth/reusable-workflow-permissions-not-inherited.yml +114 -0
  26. package/errors/runner-environment/checkout-windows-ebusy-lock.yml +124 -0
  27. package/errors/runner-environment/deprecated-action-version-auto-rejected.yml +89 -0
  28. package/errors/runner-environment/github-hosted-runner-disk-space-full.yml +85 -0
  29. package/errors/runner-environment/github-path-same-step-not-found.yml +114 -0
  30. package/errors/runner-environment/github-script-v6-octokit-rest-actions-not-function.yml +87 -0
  31. package/errors/runner-environment/macos-15-mono-nuget-removed.yml +151 -0
  32. package/errors/runner-environment/macos-15-xcode-simulator-sdk-policy.yml +141 -0
  33. package/errors/runner-environment/runner-oom-exit-code-137.yml +117 -0
  34. package/errors/runner-environment/setup-go-go123-telemetry-cache-failure.yml +92 -0
  35. package/errors/runner-environment/setup-java-distribution-required.yml +108 -0
  36. package/errors/runner-environment/windows-latest-d-drive-removed.yml +104 -0
  37. package/errors/runner-environment/windows-vs2026-cuda-host-compiler-unsupported.yml +145 -0
  38. package/errors/silent-failures/event-commits-empty-on-workflow-dispatch.yml +110 -0
  39. package/errors/silent-failures/fetch-tags-depth-one-silent-no-op.yml +77 -0
  40. package/errors/silent-failures/github-env-multiline-value-truncated.yml +127 -0
  41. package/errors/silent-failures/github-sha-pr-merge-commit-not-head.yml +150 -0
  42. package/errors/silent-failures/job-output-masked-as-secret-empty.yml +147 -0
  43. package/errors/silent-failures/upload-artifact-permissions-stripped.yml +98 -0
  44. package/errors/triggers/pull-request-branches-filter-matches-base-not-head.yml +140 -0
  45. package/errors/triggers/push-event-fires-on-branch-delete.yml +129 -0
  46. package/errors/triggers/push-first-commit-before-sha-zeros.yml +160 -0
  47. package/errors/yaml-syntax/fromjson-empty-string-crash.yml +99 -0
  48. package/errors/yaml-syntax/if-bang-negation-yaml-tag.yml +145 -0
  49. package/errors/yaml-syntax/local-action-path-always-top-level.yml +142 -0
  50. package/package.json +1 -1
@@ -0,0 +1,104 @@
1
+ id: runner-environment-043
2
+ title: "windows-latest Windows Server 2025 Runner Removed D: Drive — Paths Fail"
3
+ category: runner-environment
4
+ severity: error
5
+ tags:
6
+ - windows
7
+ - runner-image
8
+ - d-drive
9
+ - path
10
+ - windows-server-2025
11
+ - breaking-change
12
+ patterns:
13
+ - regex: "The system cannot find the path specified.*D:\\\\"
14
+ flags: "i"
15
+ - regex: "D:\\\\.*No such file or directory"
16
+ flags: "i"
17
+ - regex: "Path.*D:\\\\.*does not exist"
18
+ flags: "i"
19
+ - regex: "cannot find.*'D:\\\\|D:\\\\.*not found"
20
+ flags: "i"
21
+ error_messages:
22
+ - "The system cannot find the path specified: 'D:\\a\\'"
23
+ - "D:\\a\\ : No such file or directory"
24
+ - "Cannot find path 'D:\\build' because it does not exist."
25
+ - "Error: ENOENT: no such file or directory, open 'D:\\tools\\...'"
26
+ root_cause: |
27
+ The Windows Server 2025 runner image, which became the target of `windows-latest`
28
+ and `windows-2025` starting mid-2026, **removed the D: drive** that was present
29
+ on earlier Windows runner images (Windows Server 2019 and 2022).
30
+
31
+ On Windows Server 2019/2022 runners, the D: drive was a separate disk used for
32
+ temporary build storage and tools. Some workflows hardcoded paths like
33
+ `D:\a\`, `D:\tools\`, `D:\hostedtoolcache\`, or `D:\temp\` instead of using
34
+ environment variables like `${{ runner.tool_cache }}`, `$RUNNER_TOOL_CACHE`,
35
+ or workspace-relative paths.
36
+
37
+ On Windows Server 2025 runners, only the C: drive is available. Any workflow
38
+ step that writes to or reads from an absolute `D:\` path will immediately fail
39
+ with a path-not-found error, often as a confusing "system cannot find path" error
40
+ rather than a clear "D: drive missing" message.
41
+
42
+ Root issue thread: actions/runner-images#12416 (D: drive removal discussion)
43
+ and runner-images#12677 (windows-latest → Windows Server 2025 migration).
44
+ fix: |
45
+ Replace all hardcoded `D:\` paths with environment variable references or
46
+ workspace-relative paths:
47
+
48
+ | Old (hardcoded D:) | New (portable) |
49
+ |--------------------|----------------------------------------|
50
+ | `D:\hostedtoolcache` | `${{ runner.tool_cache }}` |
51
+ | `D:\a\${{ github.repository }}` | `${{ github.workspace }}` |
52
+ | `D:\temp\` | `${{ runner.temp }}` |
53
+ | `D:\tools\` | Explicit installation to `C:\tools\` |
54
+
55
+ For existing scripts that reference `D:\` directly, either:
56
+ 1. Update all references to use RUNNER_TEMP, RUNNER_TOOL_CACHE, or GITHUB_WORKSPACE
57
+ 2. Temporarily pin `runs-on: windows-2022` while you migrate
58
+ fix_code:
59
+ - language: yaml
60
+ label: "Replace D:\\ paths with portable runner environment variables"
61
+ code: |
62
+ jobs:
63
+ build:
64
+ runs-on: windows-latest # Works on Server 2025 (no D: drive)
65
+ steps:
66
+ - uses: actions/checkout@v4
67
+
68
+ # ❌ Broken: hardcoded D: path
69
+ # - run: Copy-Item -Path "D:\hostedtoolcache\node\20.0.0\x64\bin\node.exe" -Destination "${{ github.workspace }}"
70
+
71
+ # ✅ Fixed: use runner context variables
72
+ - name: Use portable paths
73
+ run: |
74
+ echo "Workspace: ${{ github.workspace }}"
75
+ echo "Tool cache: ${{ runner.tool_cache }}"
76
+ echo "Temp dir: ${{ runner.temp }}"
77
+ # C: drive is always available on all Windows runner images
78
+ $toolsDir = "C:\tools"
79
+ New-Item -ItemType Directory -Force -Path $toolsDir
80
+ - language: yaml
81
+ label: "Temporary rollback — pin to windows-2022 while migrating"
82
+ code: |
83
+ jobs:
84
+ build:
85
+ # Pin to windows-2022 (D: drive still present) while fixing hardcoded paths
86
+ runs-on: windows-2022
87
+ steps:
88
+ - uses: actions/checkout@v4
89
+ - run: msbuild MyProject.sln
90
+ prevention:
91
+ - "Never hardcode `D:\\` paths in workflows or scripts — always use `${{ runner.tool_cache }}`, `${{ runner.temp }}`, `${{ github.workspace }}`, or `C:\\`-relative paths."
92
+ - "Audit workflows and called scripts for `D:\\` references before migrating to `windows-latest` (Windows Server 2025)."
93
+ - "Subscribe to actions/runner-images release announcements so runner image migrations do not catch you off-guard."
94
+ - "Use `windows-2022` as a temporary pin if immediate migration is not feasible; note that Server 2022 images have a defined EOL."
95
+ - "Test Windows workflows in a `windows-2025` matrix slot before the `windows-latest` migration window completes."
96
+ docs:
97
+ - url: "https://github.com/actions/runner-images/issues/12416"
98
+ label: "runner-images#12416 — D: drive removal discussion"
99
+ - url: "https://github.com/actions/runner-images/issues/12677"
100
+ label: "runner-images#12677 — windows-latest migration to Windows Server 2025"
101
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables"
102
+ label: "GitHub Docs: Default environment variables (runner.tool_cache, runner.temp)"
103
+ - url: "https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories"
104
+ label: "About GitHub-hosted runners — Windows Server 2025 specs"
@@ -0,0 +1,145 @@
1
+ id: runner-environment-046
2
+ title: "CUDA nvcc Rejects Visual Studio 2026 Host Compiler on windows-latest"
3
+ category: runner-environment
4
+ severity: error
5
+ tags:
6
+ - windows
7
+ - windows-latest
8
+ - cuda
9
+ - nvcc
10
+ - visual-studio-2026
11
+ - vs2026
12
+ - runner-image
13
+ - breaking-change
14
+ - gpu
15
+ patterns:
16
+ - regex: "unsupported Microsoft Visual Studio version.*Only the versions between 2019 and 2022"
17
+ flags: "i"
18
+ - regex: "fatal error C1189.*unsupported Microsoft Visual Studio version"
19
+ flags: "i"
20
+ - regex: "nvcc.*error.*host_config\\.h.*C1189"
21
+ flags: "i"
22
+ - regex: "CUDA.*requires Visual Studio.*2022|nvcc.*does not support.*Visual Studio 18"
23
+ flags: "i"
24
+ - regex: "error:\\s+--\\s+unsupported Microsoft Visual Studio version"
25
+ flags: "i"
26
+ error_messages:
27
+ - "fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions between 2019 and 2022 (inclusive) are supported!"
28
+ - "Error in C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v13.1\\include\\crt/host_config.h(164)"
29
+ - "nvcc fatal : Host compiler targets unsupported OS."
30
+ - "nvcc error : Failed to preprocess the host compiler properties."
31
+ root_cause: |
32
+ GitHub Actions migrated `windows-latest` (and `windows-2025`) from Visual Studio 2022 to
33
+ Visual Studio 2026 (version 18.x) beginning June 8, 2026, completing by June 15, 2026.
34
+ Additionally, some users saw the switch as early as May 5, 2026 when `windows-2025`
35
+ started serving the `windows-2025-vs2026` image label prematurely (runner-images#14004).
36
+
37
+ CUDA toolkits up to and including CUDA 13.x hard-code supported Visual Studio version
38
+ ranges inside `<CUDA_ROOT>/include/crt/host_config.h`. The file checks the `_MSC_VER`
39
+ compiler macro and rejects any version outside the explicitly listed range. Visual Studio
40
+ 2022 (MSVC 19.3x) is the last version supported by all CUDA releases through CUDA 13.x.
41
+ Visual Studio 2026 (MSVC 19.4x / VS version 18.x) falls outside these ranges and triggers
42
+ an immediate hard compiler error:
43
+
44
+ fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the
45
+ versions between 2019 and 2022 (inclusive) are supported! The nvcc flag
46
+ '-allow-unsupported-compiler' can be used to override this version check; however,
47
+ using an unsupported host compiler may cause compilation failure or incorrect run time
48
+ execution. Use at your own risk.
49
+
50
+ The error fires at the preprocessing stage — before any CUDA code is compiled — so it
51
+ affects any project that invokes `nvcc`, regardless of the CUDA source code content.
52
+
53
+ Source: actions/runner-images#14017, runner-images#14004, NVIDIA CUDA Installation Guide
54
+ fix: |
55
+ **Option 1 — Use `-allow-unsupported-compiler` flag** (quick unblock, use at own risk):
56
+ Adds a flag to nvcc that bypasses the version check. Works for many projects but NVIDIA
57
+ does not guarantee correctness with unsupported compilers.
58
+
59
+ **Option 2 — Pin to windows-2022** (safest immediate fix):
60
+ `windows-2022` still ships Visual Studio 2022. It is not yet deprecated.
61
+
62
+ **Option 3 — Upgrade to a CUDA version that supports VS 2026** (best long-term):
63
+ NVIDIA releases new CUDA toolkits that list VS 2026 in their supported compiler matrix.
64
+ Check the CUDA Toolkit Release Notes for the current supported VS version table.
65
+
66
+ **Option 4 — Use CMake's `CUDAARCHS` + VS2022 generator explicitly**:
67
+ If using CMake, pin the generator to `Visual Studio 17 2022` even on windows-latest by
68
+ specifying `-G "Visual Studio 17 2022"` in your cmake configure step. This forces CMake
69
+ to use the VS 2022 tools even if VS 2026 is the default.
70
+ fix_code:
71
+ - language: yaml
72
+ label: "Pin to windows-2022 to avoid VS 2026 entirely"
73
+ code: |
74
+ jobs:
75
+ build-cuda:
76
+ runs-on: windows-2022 # VS 2022 — supported by CUDA up to 13.x
77
+ steps:
78
+ - uses: actions/checkout@v4
79
+
80
+ - name: Build with CUDA
81
+ run: cmake --build . --config Release
82
+ - language: yaml
83
+ label: "Pass -allow-unsupported-compiler to nvcc (quick unblock)"
84
+ code: |
85
+ jobs:
86
+ build-cuda:
87
+ runs-on: windows-latest
88
+ steps:
89
+ - uses: actions/checkout@v4
90
+
91
+ # Pass flag via CMake CUDA_NVCC_FLAGS
92
+ - name: Configure CMake
93
+ run: |
94
+ cmake -B build -DCMAKE_CUDA_FLAGS="-allow-unsupported-compiler"
95
+
96
+ - name: Build
97
+ run: cmake --build build --config Release
98
+ - language: yaml
99
+ label: "Force VS 2022 CMake generator on windows-latest (VS 2026 image)"
100
+ code: |
101
+ jobs:
102
+ build-cuda:
103
+ runs-on: windows-latest
104
+ steps:
105
+ - uses: actions/checkout@v4
106
+
107
+ # Explicitly select VS 2022 generator even when VS 2026 is default
108
+ - name: Configure with VS 2022 generator
109
+ run: |
110
+ cmake -B build `
111
+ -G "Visual Studio 17 2022" `
112
+ -A x64
113
+
114
+ - name: Build
115
+ run: cmake --build build --config Release
116
+ - language: yaml
117
+ label: "Upgrade CUDA toolkit version that supports VS 2026"
118
+ code: |
119
+ jobs:
120
+ build-cuda:
121
+ runs-on: windows-latest
122
+ steps:
123
+ - uses: actions/checkout@v4
124
+
125
+ # Install a CUDA version that explicitly supports VS 2026
126
+ # (check NVIDIA release notes for the current minimum supported version)
127
+ - name: Install CUDA Toolkit
128
+ uses: Jimver/cuda-toolkit@v0.2.21
129
+ with:
130
+ cuda: '12.8.0' # Check if this version lists VS 2026 in its support matrix
131
+
132
+ - name: Build
133
+ run: cmake --build build --config Release
134
+ prevention:
135
+ - "Never assume CUDA is forward-compatible with new Visual Studio versions — CUDA hard-codes supported MSVC version ranges."
136
+ - "Pin `runs-on: windows-2022` for CUDA workflows until the CUDA version you use explicitly lists VS 2026 as supported."
137
+ - "Subscribe to runner-images#14017 and similar announcements before the windows-latest label migration date."
138
+ - "Check the CUDA Toolkit Release Notes for your version's supported host compiler table before upgrading either Visual Studio or CUDA."
139
+ docs:
140
+ - url: "https://github.com/actions/runner-images/issues/14017"
141
+ label: "runner-images#14017: windows-latest will use VS 2026 image in June 2026"
142
+ - url: "https://github.com/actions/runner-images/issues/14004"
143
+ label: "runner-images#14004: windows-2025 serving VS 2026 image prematurely (May 2026)"
144
+ - url: "https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/"
145
+ label: "NVIDIA CUDA Installation Guide — supported Visual Studio versions"
@@ -0,0 +1,110 @@
1
+ id: silent-failures-018
2
+ title: "github.event.commits and github.event.head_commit Are Null/Empty on Non-Push Triggers"
3
+ category: silent-failures
4
+ severity: silent-failure
5
+ tags:
6
+ - github-context
7
+ - workflow-dispatch
8
+ - schedule
9
+ - commits
10
+ - null-access
11
+ - push-event
12
+ - expression
13
+ patterns:
14
+ - regex: "github\\.event\\.commits\\[0\\]"
15
+ flags: "i"
16
+ - regex: "github\\.event\\.head_commit\\.(message|id|author)"
17
+ flags: "i"
18
+ - regex: "github\\.event\\.commits is not iterable|Cannot read.*commits"
19
+ flags: "i"
20
+ error_messages:
21
+ - "Error: Cannot read properties of undefined (reading 'message')"
22
+ - "Error: github.event.commits[0] is undefined"
23
+ root_cause: |
24
+ The `github.event.commits` array and `github.event.head_commit` object are ONLY populated
25
+ for `push` webhook events. They are absent (null / empty array) for all other trigger types:
26
+
27
+ - `workflow_dispatch` — manual UI or API trigger, no commit context
28
+ - `schedule` — cron-triggered run, no specific push associated
29
+ - `pull_request` / `pull_request_target` — uses github.event.pull_request instead
30
+ - `workflow_call` — reusable workflow invocation, no commit array
31
+ - `repository_dispatch` — uses github.event.client_payload, no commits key
32
+ - `release` — uses github.event.release, no commits array
33
+
34
+ When a workflow is triggered on both `push` and `workflow_dispatch` (a common pattern),
35
+ expressions like:
36
+ ${{ github.event.commits[0].message }}
37
+ ${{ github.event.head_commit.id }}
38
+
39
+ silently evaluate to empty string ('') on non-push triggers rather than raising an error.
40
+ GitHub Actions treats missing context properties as empty string, so the step runs but
41
+ with blank or wrong data — the workflow shows green while producing incorrect output.
42
+
43
+ This is a silent failure because there is no error in the logs when the empty string is
44
+ used in a step (e.g., an echo, a tag, a release title). The problem only becomes visible
45
+ when the downstream artifact or message is inspected.
46
+ fix: |
47
+ Use git directly to extract commit information — it works reliably across all trigger types
48
+ (as long as fetch-depth is not 1 / uses default full clone or depth >= 2):
49
+
50
+ git log --format=%s -1 # subject line
51
+ git log --format=%H -1 # full SHA
52
+ git log --format=%ae -1 # author email
53
+
54
+ Alternatively, guard commit-context access with an event_name check, or use the
55
+ github.sha context (which IS available on all triggers) when a commit SHA is needed.
56
+ fix_code:
57
+ - language: yaml
58
+ label: "Portable commit message extraction via git (works on all triggers)"
59
+ code: |
60
+ jobs:
61
+ release:
62
+ runs-on: ubuntu-latest
63
+ steps:
64
+ - uses: actions/checkout@v4
65
+ with:
66
+ fetch-depth: 2 # depth >= 2 required for git log on non-push
67
+
68
+ - name: Get commit message (safe for push, workflow_dispatch, schedule)
69
+ id: meta
70
+ run: |
71
+ echo "sha=${{ github.sha }}" >> $GITHUB_OUTPUT
72
+ echo "message=$(git log --format=%s -1 ${{ github.sha }})" >> $GITHUB_OUTPUT
73
+ echo "author=$(git log --format=%ae -1 ${{ github.sha }})" >> $GITHUB_OUTPUT
74
+
75
+ - name: Use commit metadata
76
+ run: |
77
+ echo "SHA: ${{ steps.meta.outputs.sha }}"
78
+ echo "Message: ${{ steps.meta.outputs.message }}"
79
+ - language: yaml
80
+ label: "Guard push-only context with event_name check"
81
+ code: |
82
+ - name: Get commit message (push only)
83
+ if: github.event_name == 'push' && github.event.commits[0] != null
84
+ run: |
85
+ echo "COMMIT_MSG=${{ github.event.commits[0].message }}" >> $GITHUB_ENV
86
+
87
+ - name: Fallback for non-push triggers
88
+ if: github.event_name != 'push'
89
+ run: |
90
+ echo "COMMIT_MSG=$(git log --format=%s -1)" >> $GITHUB_ENV
91
+ - language: yaml
92
+ label: "Debug: dump full event payload to understand what is available"
93
+ code: |
94
+ - name: Debug — dump event context
95
+ run: echo '${{ toJSON(github.event) }}'
96
+ prevention:
97
+ - "Never access github.event.commits or github.event.head_commit without first checking github.event_name == 'push'."
98
+ - "Use `git log --format=%s -1 ${{ github.sha }}` for commit message extraction — it works on all trigger types."
99
+ - "Note that github.sha IS available on all triggers and points to the relevant commit; use it as a portable substitute for github.event.head_commit.id."
100
+ - "Add a debug step early in development to dump `${{ toJSON(github.event) }}` so you can see exactly what context is available for each trigger type."
101
+ - "Test workflows by triggering them manually via workflow_dispatch to catch push-only context assumptions before they hit production."
102
+ docs:
103
+ - url: "https://docs.github.com/en/webhooks/webhook-events-and-payloads#push"
104
+ label: "GitHub docs — push event payload (includes commits array)"
105
+ - url: "https://docs.github.com/en/webhooks/webhook-events-and-payloads#workflow_dispatch"
106
+ label: "GitHub docs — workflow_dispatch event payload (no commits array)"
107
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/accessing-contextual-information-about-workflow-runs#github-context"
108
+ label: "GitHub docs — github context reference"
109
+ - url: "https://github.com/orgs/community/discussions/27058"
110
+ label: "Community discussion — github.event.commits undefined on workflow_dispatch"
@@ -0,0 +1,77 @@
1
+ id: silent-failures-022
2
+ title: "fetch-tags: true Silently Fetches No Tags When fetch-depth Is 1"
3
+ category: silent-failures
4
+ severity: silent-failure
5
+ tags:
6
+ - checkout
7
+ - fetch-tags
8
+ - shallow-clone
9
+ - fetch-depth
10
+ - git-tags
11
+ - versioning
12
+ patterns:
13
+ - regex: "No tags found|no tags found"
14
+ flags: "i"
15
+ - regex: "fatal: No names found, cannot describe anything"
16
+ flags: "i"
17
+ - regex: "CHANGELOG.*No tag found"
18
+ flags: "i"
19
+ error_messages:
20
+ - "fatal: No names found, cannot describe anything"
21
+ - "No tags found. Try unshallowing the repository"
22
+ - "CHANGELOG ERROR: No tag found on HEAD"
23
+ - "Error: No tags matching '*' found, exiting"
24
+ root_cause: |
25
+ The `fetch-tags: true` option in `actions/checkout` was introduced in v3.6.0 to restore tag
26
+ fetching after `--no-tags` was made the default for shallow clones. However, when `fetch-depth`
27
+ remains at its default value of `1` (shallow clone), the tag fetch silently produces no results.
28
+
29
+ With a shallow clone, git only downloads a single commit. Tags are only present if they point
30
+ directly to that one commit — i.e., the workflow was triggered by a tag push. In all other
31
+ cases, `fetch-tags: true` appears to succeed (no error, no warning) but `git tag -l` returns
32
+ empty results.
33
+
34
+ This silently breaks tools that depend on git tags for versioning: semantic-release,
35
+ commitizen, standard-version, cargo-smart-release, setuptools-scm, and any script using
36
+ `git describe --tags`. Builds succeed but produce wrong version numbers (often 0.0.0 or
37
+ commit-hash-only versions).
38
+ fix: |
39
+ Pair `fetch-tags: true` with `fetch-depth: 0` to fetch the full history including all tags.
40
+ On very large repositories, use `filter: tree:0` for a blobless partial clone that still
41
+ includes complete tag history. As a targeted workaround, add a second step to fetch only
42
+ tags after a shallow checkout.
43
+ fix_code:
44
+ - language: yaml
45
+ label: "Recommended: full history with all tags"
46
+ code: |
47
+ - uses: actions/checkout@v4
48
+ with:
49
+ fetch-depth: 0 # full history required for tags
50
+ fetch-tags: true # fetch all tags
51
+ - language: yaml
52
+ label: "Large repos: blobless filter (faster, still includes tags)"
53
+ code: |
54
+ - uses: actions/checkout@v4
55
+ with:
56
+ fetch-depth: 0
57
+ filter: tree:0 # blobless clone — avoids downloading file blobs
58
+ fetch-tags: true
59
+ - language: yaml
60
+ label: "Workaround: shallow checkout + separate tag fetch step"
61
+ code: |
62
+ - uses: actions/checkout@v4
63
+ with:
64
+ fetch-depth: 1
65
+ - name: Fetch all tags
66
+ run: git fetch --prune --unshallow --tags
67
+ prevention:
68
+ - "Always pair `fetch-tags: true` with `fetch-depth: 0` unless the workflow is only triggered by tag pushes"
69
+ - "Add `git tag -l` as a debug step in release workflows to verify tags are present after checkout"
70
+ - "If using semantic-release or similar, test your version script locally with a shallow clone to catch this early"
71
+ docs:
72
+ - url: "https://github.com/actions/checkout/issues/1471"
73
+ label: "actions/checkout#1471 — fetch-tags: true doesn't actually fetch any tags (126 reactions)"
74
+ - url: "https://github.com/actions/checkout/issues/1467"
75
+ label: "actions/checkout#1467 — related: no-tags default behavior"
76
+ - url: "https://github.com/actions/checkout#usage"
77
+ label: "actions/checkout — fetch-tags and fetch-depth inputs documentation"
@@ -0,0 +1,127 @@
1
+ id: silent-failures-019
2
+ title: "GITHUB_ENV Multiline Values Silently Truncate Without Heredoc Delimiter Format"
3
+ category: silent-failures
4
+ severity: silent-failure
5
+ tags:
6
+ - GITHUB_ENV
7
+ - environment-variable
8
+ - multiline
9
+ - heredoc
10
+ - truncation
11
+ - env-file
12
+ patterns:
13
+ - regex: "GITHUB_ENV.*multiline|multiline.*GITHUB_ENV"
14
+ flags: "i"
15
+ - regex: "Invalid format '.*\\n'"
16
+ flags: "i"
17
+ - regex: "Error: Failed to parse environment file"
18
+ flags: "i"
19
+ error_messages:
20
+ - "Error: Failed to parse environment file"
21
+ - "Invalid format 'MY_VAR=line1\nline2'"
22
+ - "Warning: Environment file exporting failed"
23
+ root_cause: |
24
+ When setting an environment variable with `$GITHUB_ENV` that contains **newline
25
+ characters**, naïvely echoing the value produces an invalid environment file entry
26
+ that is silently truncated or causes a parse error.
27
+
28
+ The environment file format used by GitHub Actions expects single-line `KEY=VALUE`
29
+ entries. If a value contains a literal newline, the runner cannot parse it and
30
+ typically:
31
+ - Silently truncates the value at the first newline (the variable gets only the
32
+ first line)
33
+ - In strict runner versions: fails with "Error: Failed to parse environment file"
34
+
35
+ **Common incorrect pattern:**
36
+ ```yaml
37
+ run: echo "MY_CERT=${{ secrets.CERT }}" >> $GITHUB_ENV
38
+ # If CERT contains newlines, the env file entry is broken
39
+ ```
40
+
41
+ **Why it's a silent failure:**
42
+ - The step succeeds with exit code 0
43
+ - No obvious error message appears in the logs
44
+ - Downstream steps see a truncated, incomplete variable value
45
+ - Certificate/JSON/SSH key values are commonly multi-line and hit this silently
46
+
47
+ This is separate from the `$GITHUB_OUTPUT` multiline issue (which uses the same
48
+ heredoc syntax fix) — the root cause and pattern are identical but the environment
49
+ file (`GITHUB_ENV`) is a distinct file from the output file (`GITHUB_OUTPUT`).
50
+
51
+ Sources: GitHub Community #160171, GitHub Docs workflow commands
52
+ fix: |
53
+ Use the **heredoc delimiter format** for multiline values in `$GITHUB_ENV`:
54
+
55
+ ```
56
+ KEY<<DELIMITER
57
+ value-line-1
58
+ value-line-2
59
+ DELIMITER
60
+ ```
61
+
62
+ The delimiter can be any string that does not appear in the value. `EOF` is the
63
+ conventional choice. The delimiter must appear on its own line both as the opening
64
+ marker and the closing marker.
65
+
66
+ This same pattern applies to `$GITHUB_OUTPUT` for multiline step outputs.
67
+ fix_code:
68
+ - language: yaml
69
+ label: "Broken — newline in value breaks the env file silently"
70
+ code: |
71
+ # ❌ BROKEN: Secret or cert value with newlines truncates silently
72
+ - name: Set multiline env var
73
+ run: echo "MY_CERT=${{ secrets.TLS_CERT }}" >> $GITHUB_ENV
74
+ # Result: MY_CERT contains only the first line of the certificate
75
+ - language: yaml
76
+ label: "Fixed — heredoc delimiter format for multiline GITHUB_ENV values"
77
+ code: |
78
+ # ✅ FIXED: Use heredoc delimiter syntax
79
+ - name: Set multiline env var
80
+ run: |
81
+ echo "MY_CERT<<EOF" >> $GITHUB_ENV
82
+ echo "${{ secrets.TLS_CERT }}" >> $GITHUB_ENV
83
+ echo "EOF" >> $GITHUB_ENV
84
+ - language: yaml
85
+ label: "Fixed — multiline JSON body in GITHUB_ENV"
86
+ code: |
87
+ # ✅ FIXED: Multi-line JSON stored as env var using heredoc format
88
+ - name: Set JSON config variable
89
+ run: |
90
+ echo "APP_CONFIG<<EOF" >> $GITHUB_ENV
91
+ cat config/settings.json >> $GITHUB_ENV
92
+ echo "EOF" >> $GITHUB_ENV
93
+ - language: yaml
94
+ label: "Fixed — same pattern applies to GITHUB_OUTPUT for multiline outputs"
95
+ code: |
96
+ # ✅ SAME PATTERN for step outputs (GITHUB_OUTPUT)
97
+ - name: Set multiline output
98
+ id: generate
99
+ run: |
100
+ echo "report<<EOF" >> $GITHUB_OUTPUT
101
+ cat test-results.txt >> $GITHUB_OUTPUT
102
+ echo "EOF" >> $GITHUB_OUTPUT
103
+ - language: yaml
104
+ label: "Fixed — PowerShell equivalent for Windows runners"
105
+ code: |
106
+ # ✅ FIXED (Windows/PowerShell): Use Out-File -Append with heredoc-style writes
107
+ - name: Set multiline env var on Windows
108
+ shell: pwsh
109
+ run: |
110
+ @"
111
+ MY_CERT<<EOF
112
+ ${{ secrets.TLS_CERT }}
113
+ EOF
114
+ "@ | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
115
+ prevention:
116
+ - "Always use the `KEY<<DELIMITER ... DELIMITER` heredoc format for any env var value that may contain newlines (certs, JWTs, JSON, SSH keys)."
117
+ - "Never use a single `echo KEY=VALUE >> $GITHUB_ENV` for values sourced from secrets or file contents — they are likely to contain newlines."
118
+ - "The same heredoc pattern applies to `$GITHUB_OUTPUT` — treat them identically for multiline values."
119
+ - "Validate that downstream steps receive the full value: `run: echo \"MY_CERT=$MY_CERT\"` — a truncated cert will be obviously short."
120
+ - "Use `echo 'key<<EOF' >> $GITHUB_ENV` (single quotes around key<<EOF) to avoid accidental shell expansion of the delimiter line."
121
+ docs:
122
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#multiline-strings"
123
+ label: "GitHub Docs: Workflow commands — Multiline strings in environment files"
124
+ - url: "https://github.com/orgs/community/discussions/160171"
125
+ label: "GitHub Community #160171 — GITHUB_ENV multiline values"
126
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable"
127
+ label: "GitHub Docs: Setting an environment variable (GITHUB_ENV format)"