@htekdev/actions-debugger 1.0.91 → 1.0.92
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.
- package/errors/runner-environment/windows-max-path-260-npm-build-failure.yml +87 -0
- package/errors/silent-failures/pull-request-branches-filter-not-inherited.yml +73 -0
- package/errors/triggers/delete-event-fires-branch-and-tag.yml +75 -0
- package/errors/triggers/pull-request-review-all-types-default.yml +69 -0
- package/package.json +1 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
id: runner-environment-158
|
|
2
|
+
title: 'Windows MAX_PATH 260-character limit causes npm and build tool failures'
|
|
3
|
+
category: runner-environment
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- windows
|
|
7
|
+
- max-path
|
|
8
|
+
- npm
|
|
9
|
+
- node_modules
|
|
10
|
+
- path-length
|
|
11
|
+
- enoent
|
|
12
|
+
- build
|
|
13
|
+
patterns:
|
|
14
|
+
- regex: 'The filename or extension is too long'
|
|
15
|
+
flags: 'i'
|
|
16
|
+
- regex: 'ENOENT.*node_modules.*node_modules'
|
|
17
|
+
flags: 'i'
|
|
18
|
+
- regex: 'error MSB3095.*path.*too long'
|
|
19
|
+
flags: 'i'
|
|
20
|
+
- regex: 'The system cannot find the path specified'
|
|
21
|
+
flags: 'i'
|
|
22
|
+
error_messages:
|
|
23
|
+
- "The filename or extension is too long."
|
|
24
|
+
- "ENOENT: no such file or directory, open 'C:\\Users\\runner\\work\\..."
|
|
25
|
+
- "error MSB3095: Invalid argument. 'path' is too long."
|
|
26
|
+
- "npm ERR! path C:\\Users\\runner\\work\\..."
|
|
27
|
+
root_cause: |
|
|
28
|
+
Windows enforces a 260-character maximum path length (MAX_PATH) inherited from
|
|
29
|
+
the Win32 API. Deep node_modules dependency trees easily exceed this limit: the
|
|
30
|
+
GitHub-hosted runner workspace is already at
|
|
31
|
+
C:\Users\runner\work\<repository>\<repository>\ (~50 characters) before any
|
|
32
|
+
source files are added. A typical transitive npm dependency path like
|
|
33
|
+
node_modules\pkg\node_modules\sub\node_modules\deep\index.js can push the total
|
|
34
|
+
well past 260 characters. MSBuild, Java build tools, and other Windows toolchains
|
|
35
|
+
have the same limitation.
|
|
36
|
+
|
|
37
|
+
GitHub-hosted Windows runners (windows-2022, windows-latest) have the
|
|
38
|
+
LongPathsEnabled registry key set to 1 at the OS level, but Git must still be
|
|
39
|
+
separately configured with core.longpaths = true, and some Node.js internal APIs
|
|
40
|
+
call the legacy Win32 CreateFile path which ignores the registry opt-in unless
|
|
41
|
+
the application explicitly declares long-path awareness in its executable manifest.
|
|
42
|
+
The result is ENOENT or "path too long" failures that appear to indicate missing
|
|
43
|
+
files rather than a path-length limit.
|
|
44
|
+
fix: |
|
|
45
|
+
Option 1 (most effective): Use a short path: in actions/checkout to reduce the
|
|
46
|
+
base path length. path: a sets the workspace to C:\...\work\repo\a.
|
|
47
|
+
Option 2: Configure Git long paths and use --legacy-peer-deps to flatten
|
|
48
|
+
npm dependency nesting.
|
|
49
|
+
Option 3: Shorten the repository name, which directly reduces the workspace
|
|
50
|
+
path length.
|
|
51
|
+
fix_code:
|
|
52
|
+
- language: yaml
|
|
53
|
+
label: 'Use short checkout path to reduce base path length'
|
|
54
|
+
code: |
|
|
55
|
+
jobs:
|
|
56
|
+
build:
|
|
57
|
+
runs-on: windows-latest
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v4
|
|
60
|
+
with:
|
|
61
|
+
path: a # Reduces base path by ~20-30 characters vs default
|
|
62
|
+
- run: npm ci
|
|
63
|
+
working-directory: a
|
|
64
|
+
- language: yaml
|
|
65
|
+
label: 'Enable Git long paths and flatten npm tree'
|
|
66
|
+
code: |
|
|
67
|
+
jobs:
|
|
68
|
+
build:
|
|
69
|
+
runs-on: windows-latest
|
|
70
|
+
steps:
|
|
71
|
+
- name: Configure Git long paths
|
|
72
|
+
run: git config --global core.longpaths true
|
|
73
|
+
- uses: actions/checkout@v4
|
|
74
|
+
- name: Install with flattened dependencies
|
|
75
|
+
run: npm ci --legacy-peer-deps
|
|
76
|
+
prevention:
|
|
77
|
+
- 'Use path: a (or another single-char name) in actions/checkout to reduce baseline path length on Windows'
|
|
78
|
+
- 'Keep GitHub repository names short when Windows CI is required'
|
|
79
|
+
- 'Avoid deeply nested workspace directory structures'
|
|
80
|
+
- 'Run npm ci --legacy-peer-deps to reduce node_modules nesting on npm 7+ which introduced deeper trees'
|
|
81
|
+
docs:
|
|
82
|
+
- url: 'https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation'
|
|
83
|
+
label: 'Microsoft Docs: Maximum file path limitation (MAX_PATH)'
|
|
84
|
+
- url: 'https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreprotectNTFS'
|
|
85
|
+
label: 'Git: core.longpaths config'
|
|
86
|
+
- url: 'https://docs.npmjs.com/cli/v10/commands/npm-ci'
|
|
87
|
+
label: 'npm ci — clean install'
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
id: silent-failures-086
|
|
2
|
+
title: 'on.pull_request does not inherit branches filter from sibling on.push trigger'
|
|
3
|
+
category: silent-failures
|
|
4
|
+
severity: silent-failure
|
|
5
|
+
tags:
|
|
6
|
+
- pull_request
|
|
7
|
+
- push
|
|
8
|
+
- branches-filter
|
|
9
|
+
- trigger
|
|
10
|
+
- unexpected-runs
|
|
11
|
+
- filter-inheritance
|
|
12
|
+
patterns:
|
|
13
|
+
- regex: 'on:\s*\n\s*push:\s*\n\s*branches:\s*\n.*\n\s*pull_request:\s*\n(?!\s*branches:)'
|
|
14
|
+
flags: 'ms'
|
|
15
|
+
error_messages: []
|
|
16
|
+
root_cause: |
|
|
17
|
+
When a workflow defines multiple triggers under on:, each trigger's configuration
|
|
18
|
+
is fully independent — there is no filter inheritance between sibling triggers.
|
|
19
|
+
A common pattern is to restrict on.push to specific branches (e.g., main,
|
|
20
|
+
release/**) while adding on.pull_request with no branches: key, expecting the
|
|
21
|
+
PR trigger to respect the same branch scope.
|
|
22
|
+
|
|
23
|
+
In YAML mapping semantics, on.push.branches: [main] applies exclusively to push
|
|
24
|
+
events. on.pull_request with no branches: key means "trigger for pull requests
|
|
25
|
+
targeting ANY branch in the repository." This causes the workflow to run on every
|
|
26
|
+
PR opened against feature branches, release candidates, or any other branch —
|
|
27
|
+
running expensive CI on PRs the developer intended to exclude.
|
|
28
|
+
|
|
29
|
+
The GitHub Actions UI shows these runs as triggered by pull_request with no
|
|
30
|
+
indication that the branches: filter was missing. The behavior appears correct
|
|
31
|
+
(workflow ran) but occurs on unintended PRs.
|
|
32
|
+
fix: |
|
|
33
|
+
Explicitly add a branches: filter to on.pull_request that defines the target
|
|
34
|
+
branches for which CI should run. Note that on.pull_request.branches matches the
|
|
35
|
+
BASE branch (the branch the PR targets), not the head/feature branch.
|
|
36
|
+
fix_code:
|
|
37
|
+
- language: yaml
|
|
38
|
+
label: 'Explicit branches filter on both triggers'
|
|
39
|
+
code: |
|
|
40
|
+
on:
|
|
41
|
+
push:
|
|
42
|
+
branches: [main, 'release/**']
|
|
43
|
+
pull_request:
|
|
44
|
+
branches: [main, 'release/**'] # Required — NOT inherited from on.push
|
|
45
|
+
jobs:
|
|
46
|
+
ci:
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- run: npm test
|
|
50
|
+
- language: yaml
|
|
51
|
+
label: 'Common mistake — missing branches on pull_request'
|
|
52
|
+
code: |
|
|
53
|
+
# WRONG — pull_request triggers for ALL target branches
|
|
54
|
+
on:
|
|
55
|
+
push:
|
|
56
|
+
branches: [main]
|
|
57
|
+
pull_request: # No branches filter — triggers for every PR
|
|
58
|
+
# CORRECT
|
|
59
|
+
on:
|
|
60
|
+
push:
|
|
61
|
+
branches: [main]
|
|
62
|
+
pull_request:
|
|
63
|
+
branches: [main] # Only PRs targeting main
|
|
64
|
+
prevention:
|
|
65
|
+
- 'Review each trigger block independently — on.push and on.pull_request filters are never shared'
|
|
66
|
+
- 'Add an explicit branches: under on.pull_request whenever you use branches: under on.push'
|
|
67
|
+
- 'Remember: on.pull_request.branches matches the BASE branch of the PR, not the feature branch'
|
|
68
|
+
- 'Use actionlint to validate trigger configurations before committing'
|
|
69
|
+
docs:
|
|
70
|
+
- url: 'https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#using-filters'
|
|
71
|
+
label: 'GitHub Docs: Using filters — each trigger is configured independently'
|
|
72
|
+
- url: 'https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore'
|
|
73
|
+
label: 'GitHub Actions: pull_request branches filter matches base branch'
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
id: triggers-061
|
|
2
|
+
title: 'on.delete fires for branch and tag deletion — no ref_type filter at trigger level'
|
|
3
|
+
category: triggers
|
|
4
|
+
severity: silent-failure
|
|
5
|
+
tags:
|
|
6
|
+
- delete
|
|
7
|
+
- ref_type
|
|
8
|
+
- branch
|
|
9
|
+
- tag
|
|
10
|
+
- unexpected-runs
|
|
11
|
+
patterns:
|
|
12
|
+
- regex: 'on:\s*\n\s*delete:'
|
|
13
|
+
flags: 'ms'
|
|
14
|
+
error_messages: []
|
|
15
|
+
root_cause: |
|
|
16
|
+
The on.delete event fires whenever any branch or tag is deleted in the repository.
|
|
17
|
+
Unlike some events that support a types: activity filter, on.delete has no types
|
|
18
|
+
option — there is no trigger-level way to restrict it to branch deletions only or
|
|
19
|
+
tag deletions only. Workflows that perform branch-specific cleanup (removing
|
|
20
|
+
temporary deployment environments, rotating secrets, updating external project
|
|
21
|
+
boards, or archiving feature branch artifacts) run for EVERY tag deletion as well,
|
|
22
|
+
unless an explicit runtime condition is added inside the workflow.
|
|
23
|
+
|
|
24
|
+
The on.create event has the same dual-fire behavior (documented separately). Both
|
|
25
|
+
events expose github.event.ref_type in the workflow context as either 'branch' or
|
|
26
|
+
'tag', but this value is only available inside the workflow body — it cannot be
|
|
27
|
+
used as a trigger-level filter.
|
|
28
|
+
|
|
29
|
+
A common scenario: a workflow cleans up branch-specific cloud environments on
|
|
30
|
+
delete. When a developer deletes the release tag v1.2.3, the workflow fires
|
|
31
|
+
unexpectedly — potentially tearing down a production environment that was deployed
|
|
32
|
+
from that tag.
|
|
33
|
+
fix: |
|
|
34
|
+
Add an if: condition using github.event.ref_type to guard jobs or steps that
|
|
35
|
+
should only execute for one type of deletion. Use 'branch' or 'tag' as the
|
|
36
|
+
comparison value.
|
|
37
|
+
fix_code:
|
|
38
|
+
- language: yaml
|
|
39
|
+
label: 'Guard cleanup by ref_type at the job level'
|
|
40
|
+
code: |
|
|
41
|
+
on:
|
|
42
|
+
delete:
|
|
43
|
+
jobs:
|
|
44
|
+
cleanup-branch-environment:
|
|
45
|
+
# Only run for branch deletions — skip tag deletions
|
|
46
|
+
if: github.event.ref_type == 'branch'
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- name: Remove branch-specific deployment
|
|
50
|
+
run: echo "Cleaning up env for branch ${{ github.event.ref }}"
|
|
51
|
+
- language: yaml
|
|
52
|
+
label: 'Separate jobs for branch vs tag deletion'
|
|
53
|
+
code: |
|
|
54
|
+
on:
|
|
55
|
+
delete:
|
|
56
|
+
jobs:
|
|
57
|
+
cleanup-branch:
|
|
58
|
+
if: github.event.ref_type == 'branch'
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
steps:
|
|
61
|
+
- run: echo "Branch deleted ${{ github.event.ref }}"
|
|
62
|
+
cleanup-tag:
|
|
63
|
+
if: github.event.ref_type == 'tag'
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
steps:
|
|
66
|
+
- run: echo "Tag deleted ${{ github.event.ref }}"
|
|
67
|
+
prevention:
|
|
68
|
+
- 'Always guard on.delete workflow jobs with if: github.event.ref_type == ''branch'' or ''tag'''
|
|
69
|
+
- 'Be aware that on.create has the same behavior — both create and delete fire for branches and tags'
|
|
70
|
+
- 'Test delete workflows by deleting both a branch and a tag to verify they behave as expected'
|
|
71
|
+
docs:
|
|
72
|
+
- url: 'https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#delete'
|
|
73
|
+
label: 'GitHub Docs: delete event — fires for branches and tags'
|
|
74
|
+
- url: 'https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/contexts#github-context'
|
|
75
|
+
label: 'GitHub Docs: github.event.ref_type context'
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
id: triggers-062
|
|
2
|
+
title: 'on.pull_request_review fires for all review types (submitted, edited, dismissed) when types is omitted'
|
|
3
|
+
category: triggers
|
|
4
|
+
severity: silent-failure
|
|
5
|
+
tags:
|
|
6
|
+
- pull_request_review
|
|
7
|
+
- review
|
|
8
|
+
- types
|
|
9
|
+
- dismissed
|
|
10
|
+
- submitted
|
|
11
|
+
- unexpected-runs
|
|
12
|
+
patterns:
|
|
13
|
+
- regex: 'on:\s*\n\s*pull_request_review:\s*\n(?!\s*types:)'
|
|
14
|
+
flags: 'ms'
|
|
15
|
+
error_messages: []
|
|
16
|
+
root_cause: |
|
|
17
|
+
The pull_request_review event fires for three activity types:
|
|
18
|
+
- submitted: a new review is posted (approved, changes_requested, or commented)
|
|
19
|
+
- edited: a reviewer edits their review comment text
|
|
20
|
+
- dismissed: an existing approval or changes_requested review is dismissed
|
|
21
|
+
|
|
22
|
+
When on.pull_request_review: is specified without a types: filter, GitHub fires
|
|
23
|
+
the workflow for ALL three activity types. Developers typically use this event to
|
|
24
|
+
trigger a deployment or notification on PR approval. Without types: [submitted],
|
|
25
|
+
the workflow also runs when a reviewer edits their comment spelling or when an
|
|
26
|
+
approval is dismissed by a maintainer — often causing incorrect or failed workflow
|
|
27
|
+
runs in contexts where the PR is no longer in an approved state.
|
|
28
|
+
|
|
29
|
+
This behavior mirrors on.pull_request without types: (which fires for opened,
|
|
30
|
+
synchronize, and reopened by default) but is arguably more surprising because
|
|
31
|
+
"editing a review comment" and "dismissing a review" are far less common
|
|
32
|
+
developer actions than submitting a new review.
|
|
33
|
+
fix: |
|
|
34
|
+
Add types: [submitted] to restrict the trigger to new review submissions.
|
|
35
|
+
If you only want to react to approvals specifically, also add an if: condition
|
|
36
|
+
checking github.event.review.state == 'approved'.
|
|
37
|
+
fix_code:
|
|
38
|
+
- language: yaml
|
|
39
|
+
label: 'Restrict to submitted reviews only'
|
|
40
|
+
code: |
|
|
41
|
+
on:
|
|
42
|
+
pull_request_review:
|
|
43
|
+
types: [submitted] # Only new review submissions — not edited or dismissed
|
|
44
|
+
jobs:
|
|
45
|
+
notify-on-review:
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
steps:
|
|
48
|
+
- run: echo "Review state ${{ github.event.review.state }}"
|
|
49
|
+
- language: yaml
|
|
50
|
+
label: 'Trigger only on PR approvals'
|
|
51
|
+
code: |
|
|
52
|
+
on:
|
|
53
|
+
pull_request_review:
|
|
54
|
+
types: [submitted]
|
|
55
|
+
jobs:
|
|
56
|
+
deploy-on-approval:
|
|
57
|
+
if: github.event.review.state == 'approved'
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
steps:
|
|
60
|
+
- run: echo "PR approved — proceeding with staging deploy"
|
|
61
|
+
prevention:
|
|
62
|
+
- 'Always specify types: [submitted] under on.pull_request_review unless dismissed or edited is explicitly needed'
|
|
63
|
+
- 'Combine types: [submitted] with if: github.event.review.state == ''approved'' for approval-gated workflows'
|
|
64
|
+
- 'Test pull_request_review workflows by also dismissing reviews to ensure unexpected runs are avoided'
|
|
65
|
+
docs:
|
|
66
|
+
- url: 'https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request_review'
|
|
67
|
+
label: 'GitHub Docs: pull_request_review event — activity types'
|
|
68
|
+
- url: 'https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request_review'
|
|
69
|
+
label: 'GitHub Webhooks: pull_request_review payload — review.state values'
|
package/package.json
CHANGED