@htekdev/actions-debugger 1.0.74 → 1.0.75

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,114 @@
1
+ id: known-unsolved-047
2
+ title: "Reusable workflow uses: ./local-action resolves relative to the called repo, not the calling repo"
3
+ category: known-unsolved
4
+ severity: limitation
5
+ tags:
6
+ - reusable-workflow
7
+ - composite-action
8
+ - path-resolution
9
+ - local-action
10
+ - cross-repo
11
+ - limitation
12
+ patterns:
13
+ - regex: 'Can''t find ''action\.ya?ml'''
14
+ flags: 'i'
15
+ - regex: 'Unable to resolve action.*\.\/'
16
+ flags: 'i'
17
+ - regex: 'action\.ya?ml.*does not exist'
18
+ flags: 'i'
19
+ error_messages:
20
+ - "Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/repo/repo/local-action'"
21
+ - "Unable to resolve action `./local-action`, unable to find 'action.yaml' or 'action.yml'"
22
+ - "Error: Can't find 'action.yml' for step uses: ./shared-actions/deploy"
23
+ root_cause: |
24
+ When a reusable workflow file (stored in org/shared-workflows) contains steps that
25
+ reference local composite actions using relative paths (uses: ./path/to/action), the
26
+ path resolves relative to the CALLED (reusable) repository — not the CALLING
27
+ repository.
28
+
29
+ Resolution rule: In any workflow file, uses: ./path always resolves to the root of
30
+ the repository that CONTAINS the workflow YAML file.
31
+
32
+ So in org/shared-workflows/.github/workflows/ci.yml:
33
+ - uses: ./actions/lint → looks in org/shared-workflows/actions/lint/action.yml
34
+ - Does NOT look in org/app-repo/actions/lint/ (the calling repo)
35
+
36
+ This means teams cannot:
37
+ - Share a reusable workflow that calls composite actions defined in the CALLING repo
38
+ - Have callers "inject" local actions into a shared reusable workflow via relative paths
39
+ - Centralize reusable workflows in one repo while composite actions stay in team repos
40
+
41
+ This limitation is by design and has been acknowledged by the GitHub Actions team as
42
+ a fundamental architectural constraint. The calling repository's workspace may be
43
+ checked out during the job, but action path resolution happens at workflow evaluation
44
+ time using the workflow file's own repository root, not the runtime workspace.
45
+ fix: |
46
+ There is no direct fix — this is a platform-level path resolution limitation.
47
+
48
+ Option 1 (recommended) — Co-locate composite actions in the same repository as the
49
+ reusable workflow and reference them with uses: ./path (resolves correctly).
50
+
51
+ Option 2 — Publish shared composite actions to a dedicated standalone repository
52
+ (e.g., org/shared-actions) and reference them with the full path:
53
+ uses: org/shared-actions/path/to-action@main
54
+
55
+ Option 3 — Pass all data that the local action would have computed as inputs to the
56
+ reusable workflow, removing the need for the caller's local action inside the callee.
57
+ fix_code:
58
+ - language: yaml
59
+ label: "Co-locate composite action in the same repo as the reusable workflow"
60
+ code: |
61
+ # Repository: org/shared-workflows
62
+ # Structure:
63
+ # .github/
64
+ # workflows/
65
+ # ci.yml <- reusable workflow
66
+ # actions/
67
+ # shared-lint/
68
+ # action.yml <- composite action lives HERE (same repo)
69
+
70
+ # In org/shared-workflows/.github/workflows/ci.yml:
71
+ on:
72
+ workflow_call:
73
+ inputs:
74
+ source-directory:
75
+ type: string
76
+ required: true
77
+
78
+ jobs:
79
+ lint:
80
+ runs-on: ubuntu-latest
81
+ steps:
82
+ # Resolves to org/shared-workflows/.github/actions/shared-lint
83
+ - uses: ./.github/actions/shared-lint
84
+ with:
85
+ src-path: ${{ inputs.source-directory }}
86
+
87
+ - language: yaml
88
+ label: "Reference composite action from a standalone shared repo"
89
+ code: |
90
+ # Instead of: uses: ./local-action (broken — resolves to reusable workflow's repo)
91
+ # Use the full repo reference pointing to org/shared-actions:
92
+ jobs:
93
+ deploy:
94
+ runs-on: ubuntu-latest
95
+ steps:
96
+ - uses: org/shared-actions/deploy@v2
97
+ with:
98
+ environment: ${{ inputs.environment }}
99
+ - uses: org/shared-actions/notify@v2
100
+ with:
101
+ status: ${{ job.status }}
102
+
103
+ prevention:
104
+ - "Keep reusable workflow files and their local composite action dependencies in the same repository"
105
+ - "Publish composite actions shared across many repositories to a dedicated org/shared-actions repo"
106
+ - "Test reusable workflows by calling them from a different repository early in development"
107
+ - "Document which composite actions a reusable workflow depends on and where they must be located"
108
+ docs:
109
+ - url: "https://docs.github.com/en/actions/sharing-automations/reusing-workflows"
110
+ label: "GitHub docs — Reusing workflows"
111
+ - url: "https://docs.github.com/en/actions/sharing-automations/creating-actions/about-custom-actions#choosing-a-location-for-your-action"
112
+ label: "GitHub docs — Choosing a location for your action"
113
+ - url: "https://github.com/orgs/community/discussions/17244"
114
+ label: "GitHub Community discussion — local composite action reference from reusable workflow"
@@ -0,0 +1,98 @@
1
+ id: runner-environment-136
2
+ title: "actions/github-script require() of third-party npm packages fails with MODULE_NOT_FOUND"
3
+ category: runner-environment
4
+ severity: error
5
+ tags:
6
+ - github-script
7
+ - nodejs
8
+ - require
9
+ - npm
10
+ - module-not-found
11
+ - third-party-package
12
+ patterns:
13
+ - regex: 'Cannot find module'
14
+ flags: 'i'
15
+ - regex: 'MODULE_NOT_FOUND'
16
+ flags: ''
17
+ error_messages:
18
+ - "Error: Cannot find module 'axios'"
19
+ - "Error: Cannot find module 'lodash'"
20
+ - "Error: Cannot find module 'js-yaml'"
21
+ - "Error: Cannot find module 'semver'"
22
+ - "Cannot find module at /home/runner/work/_actions/actions/github-script/v7/lib/async-function.js:1"
23
+ root_cause: |
24
+ The actions/github-script action executes scripts in a sandboxed Node.js runtime that
25
+ only includes packages bundled with the action itself. Built-in parameters available
26
+ in the script context are:
27
+ - github — authenticated Octokit client (@octokit/rest)
28
+ - context — workflow event context
29
+ - core — @actions/core
30
+ - glob — @actions/glob
31
+ - io — @actions/io
32
+ - exec — @actions/exec
33
+ - fetch — Node.js built-in fetch (Node 18+)
34
+
35
+ Any call to require() for packages NOT in this list — such as axios, lodash, js-yaml,
36
+ semver, chalk, or any other npm package — will fail with MODULE_NOT_FOUND because the
37
+ packages are not installed in the runner environment that executes the script.
38
+
39
+ The action does NOT auto-install packages from the repo's package.json or any other
40
+ manifest. Node.js module resolution only searches paths within the bundled action's
41
+ own node_modules directory, which contains only the above built-ins.
42
+ fix: |
43
+ Option 1 (install before use) — Run npm install in a prior step and reference the
44
+ package via full path using RUNNER_TEMP or GITHUB_WORKSPACE:
45
+ - name: Install npm package
46
+ run: npm install <package-name>
47
+ working-directory: ${{ runner.temp }}
48
+ - uses: actions/github-script@v7
49
+ with:
50
+ script: |
51
+ const pkg = require(process.env.RUNNER_TEMP + '/node_modules/<package-name>')
52
+
53
+ Option 2 (use built-ins) — Refactor to use only the built-in parameters. For HTTP
54
+ requests use fetch() instead of axios; for YAML parsing use a run: step with a script
55
+ file.
56
+
57
+ Option 3 (separate Node.js script) — Move complex logic into a .js file in the repo
58
+ and run it with node in a run: step after npm install, giving full package access.
59
+ fix_code:
60
+ - language: yaml
61
+ label: "Install package before github-script and require via RUNNER_TEMP"
62
+ code: |
63
+ steps:
64
+ - uses: actions/checkout@v4
65
+
66
+ - name: Install axios for github-script
67
+ run: npm install axios
68
+ working-directory: ${{ runner.temp }}
69
+
70
+ - uses: actions/github-script@v7
71
+ with:
72
+ script: |
73
+ const axios = require(process.env.RUNNER_TEMP + '/node_modules/axios')
74
+ const { data } = await axios.get('https://api.example.com/status')
75
+ core.setOutput('api-status', data.status)
76
+
77
+ - language: yaml
78
+ label: "Replace axios with built-in fetch() (Node 18+, no require needed)"
79
+ code: |
80
+ steps:
81
+ - uses: actions/github-script@v7
82
+ with:
83
+ script: |
84
+ // fetch is built-in — no require() needed (Node 18+, github-script v7+)
85
+ const response = await fetch('https://api.example.com/status')
86
+ const data = await response.json()
87
+ core.setOutput('api-status', data.status)
88
+
89
+ prevention:
90
+ - "Check the github-script README 'Built-in variables' section before adding require() calls"
91
+ - "Use fetch() (built-in from Node 18+ / github-script v7+) instead of axios for HTTP requests"
92
+ - "For complex logic needing many npm packages, use a separate script file with a run: node step"
93
+ - "Consider caching the npm install step if packages are large or installed frequently"
94
+ docs:
95
+ - url: "https://github.com/actions/github-script?tab=readme-ov-file#built-in-variables"
96
+ label: "actions/github-script — Built-in variables (official README)"
97
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-github-script-in-a-workflow"
98
+ label: "GitHub docs — Using GitHub Script in a workflow"
@@ -0,0 +1,92 @@
1
+ id: silent-failures-071
2
+ title: "${{ env.VAR }} in a step's env: block evaluates to empty string when VAR is a sibling key in the same block"
3
+ category: silent-failures
4
+ severity: silent-failure
5
+ tags:
6
+ - env-context
7
+ - expression
8
+ - env-block
9
+ - sibling-reference
10
+ - empty-string
11
+ - configuration
12
+ patterns:
13
+ - regex: 'env\.\w+\}\}.*\{\{\s*env\.\w+'
14
+ flags: 'i'
15
+ error_messages:
16
+ - "(no error message — step runs successfully but env var is assigned an incorrect partial value)"
17
+ root_cause: |
18
+ When multiple environment variables are defined in the same step (or job) env: block
19
+ and one attempts to compose a value from a sibling key using ${{ env.X }}, the
20
+ reference silently evaluates to an EMPTY STRING.
21
+
22
+ GitHub Actions evaluates all expressions in an env: block BEFORE the step runs, using
23
+ the env context that exists at that point in time. That context includes:
24
+ - Variables defined in the workflow-level env: block
25
+ - Variables defined in the job-level env: block (jobs.<id>.env)
26
+ - Variables added by previous steps via $GITHUB_ENV
27
+
28
+ It does NOT include sibling keys defined elsewhere in the SAME env: block being
29
+ evaluated. The block is evaluated atomically — each value is expanded using only
30
+ the env context from BEFORE the block, not from within it.
31
+
32
+ Example of the mistake:
33
+ env:
34
+ BASE_URL: https://api.example.com # this is fine
35
+ FULL_URL: ${{ env.BASE_URL }}/v2 # SILENTLY wrong: evaluates to "/v2"
36
+
37
+ FULL_URL becomes "/v2" (not "https://api.example.com/v2") because BASE_URL is not
38
+ in the env context at the time the step's env: block expressions are evaluated —
39
+ it is only available AFTER the step starts executing.
40
+
41
+ This is a silent failure: no warning is produced, the step succeeds, and the
42
+ misconfigured variable is silently assigned the wrong value.
43
+ fix: |
44
+ Option 1 (recommended) — Move the "base" variable to the workflow-level or job-level
45
+ env: block so it is already in the env context when the step's env: block is evaluated.
46
+
47
+ Option 2 — Compose the derived value inside the run: step using shell variable
48
+ expansion, which operates at runtime when all variables are already set.
49
+
50
+ Option 3 — Use an expression based on inputs, vars, or secrets contexts which ARE
51
+ fully available during env: block evaluation.
52
+ fix_code:
53
+ - language: yaml
54
+ label: "Hoist base variable to workflow-level env so it's in context"
55
+ code: |
56
+ # Define BASE_URL at workflow level — it will be in the env context
57
+ env:
58
+ BASE_URL: https://api.example.com
59
+
60
+ jobs:
61
+ deploy:
62
+ runs-on: ubuntu-latest
63
+ steps:
64
+ - name: Call API
65
+ run: curl "$FULL_URL"
66
+ env:
67
+ # env.BASE_URL is available here because it's defined at workflow level
68
+ FULL_URL: ${{ env.BASE_URL }}/v2/endpoint
69
+
70
+ - language: yaml
71
+ label: "Compose the value inside run: using shell variable expansion"
72
+ code: |
73
+ steps:
74
+ - name: Call API endpoint
75
+ run: |
76
+ # Shell variable composition works at runtime when BASE_URL is already set
77
+ FULL_URL="${BASE_URL}/v2/endpoint"
78
+ curl "$FULL_URL"
79
+ env:
80
+ BASE_URL: https://api.example.com
81
+ # FULL_URL built in shell — no need to compose in env: block
82
+
83
+ prevention:
84
+ - "Define 'base' env vars at workflow or job level when they need to be referenced by step-level env: blocks"
85
+ - "Use shell variable composition inside run: steps rather than ${{ env.X }} in the same env: block"
86
+ - "Verify composed env var values by printing them with echo before use in critical steps"
87
+ - "Review GitHub Actions context availability documentation when authoring env: blocks"
88
+ docs:
89
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/variables#using-the-env-context-to-access-environment-variable-values"
90
+ label: "GitHub docs — Using the env context to access environment variable values"
91
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/contexts#context-availability"
92
+ label: "GitHub docs — Context availability table"
@@ -0,0 +1,108 @@
1
+ id: triggers-051
2
+ title: "on: create event fires for both branch and tag creation — must filter with github.ref_type"
3
+ category: triggers
4
+ severity: silent-failure
5
+ tags:
6
+ - create-event
7
+ - delete-event
8
+ - ref-type
9
+ - tag
10
+ - branch
11
+ - trigger-filter
12
+ - release
13
+ patterns:
14
+ - regex: 'on:\s*[\r\n]+\s+create:'
15
+ flags: 'i'
16
+ error_messages:
17
+ - "(no error message — workflow triggers unexpectedly on branch creation, not just tag creation)"
18
+ root_cause: |
19
+ The on: create event triggers whenever ANY ref (branch OR tag) is created in the
20
+ repository. There is no built-in filter to restrict it to only tag creation or only
21
+ branch creation.
22
+
23
+ Many developers use on: create expecting to run release or version-publish workflows
24
+ only when a version tag is pushed, but the workflow also fires for:
25
+ - Feature branches created via the GitHub UI or API
26
+ - Dependabot version update branches (dependabot/npm_and_yarn/...)
27
+ - Automated branches created by bots or scripts
28
+ - PR branches created by tooling
29
+ - Any branch creation event from any actor
30
+
31
+ The github.ref_type context variable ('branch' or 'tag') is available in the run
32
+ context but on: create has no built-in filter for it — an explicit if: condition
33
+ on the job or step must be used to restrict execution.
34
+
35
+ The same behavior applies to on: delete — it fires for both branch and tag deletion.
36
+ fix: |
37
+ Add an if: condition at the job level (or step level) to filter by github.ref_type:
38
+
39
+ jobs:
40
+ release:
41
+ if: github.ref_type == 'tag' # restrict to tag creation only
42
+
43
+ Alternative: Use on: push with a tags: filter instead of on: create.
44
+ The push event with tags: filter is more explicit, supports glob patterns,
45
+ and does not fire for branch operations at all.
46
+ fix_code:
47
+ - language: yaml
48
+ label: "Filter on: create to tags only using ref_type job condition"
49
+ code: |
50
+ on:
51
+ create:
52
+
53
+ jobs:
54
+ release:
55
+ runs-on: ubuntu-latest
56
+ # Only run for tag creation (e.g., v1.2.3), not branch creation
57
+ if: github.ref_type == 'tag'
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+ - name: Build and publish release
61
+ run: echo "Publishing ${{ github.ref_name }}"
62
+
63
+ - language: yaml
64
+ label: "Preferred: use on: push with tags filter for tag-triggered workflows"
65
+ code: |
66
+ # More explicit and common pattern for release workflows
67
+ on:
68
+ push:
69
+ tags:
70
+ - 'v*.*.*' # triggers on v1.0.0, v2.3.1, etc.
71
+ # - 'v[0-9]+.*' # alternative glob
72
+
73
+ jobs:
74
+ release:
75
+ runs-on: ubuntu-latest
76
+ steps:
77
+ - uses: actions/checkout@v4
78
+ - name: Build and publish release
79
+ run: echo "Publishing ${{ github.ref_name }}"
80
+
81
+ - language: yaml
82
+ label: "Filter on: delete to branch deletion only (e.g., branch cleanup)"
83
+ code: |
84
+ on:
85
+ delete:
86
+
87
+ jobs:
88
+ cleanup:
89
+ runs-on: ubuntu-latest
90
+ # Only run for branch deletion, not tag deletion
91
+ if: github.ref_type == 'branch'
92
+ steps:
93
+ - name: Cleanup branch resources
94
+ run: echo "Cleaning up resources for ${{ github.ref_name }}"
95
+
96
+ prevention:
97
+ - "Always add if: github.ref_type == 'tag' when using on: create for release/publish workflows"
98
+ - "Prefer on: push with tags: filter for tag-triggered release workflows — it's more explicit"
99
+ - "Add if: github.ref_type == 'branch' when using on: delete for branch cleanup automation"
100
+ - "Test create/delete workflows by creating a feature branch to verify it does NOT trigger unexpectedly"
101
+ - "Review all on: create workflows in the repository after adding Dependabot — it creates many branches"
102
+ docs:
103
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#create"
104
+ label: "GitHub docs — create event"
105
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#delete"
106
+ label: "GitHub docs — delete event"
107
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/contexts#github-context"
108
+ label: "GitHub docs — github context (ref_type field)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htekdev/actions-debugger",
3
- "version": "1.0.74",
3
+ "version": "1.0.75",
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",