@htekdev/actions-debugger 1.0.75 → 1.0.77

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,115 @@
1
+ id: permissions-auth-047
2
+ title: "Org-Level Policy Blocks GitHub Actions from Creating or Approving Pull Requests Even with pull-requests: write"
3
+ category: permissions-auth
4
+ severity: error
5
+ tags:
6
+ - pull-requests
7
+ - permissions
8
+ - org-policy
9
+ - github-token
10
+ - create-pr
11
+ - branch-protection
12
+ patterns:
13
+ - regex: 'GitHub Actions is not permitted to create or approve pull requests'
14
+ flags: 'i'
15
+ - regex: 'Resource not accessible by integration'
16
+ flags: 'i'
17
+ - regex: 'HttpError.*403.*pull request'
18
+ flags: 'i'
19
+ error_messages:
20
+ - "GitHub Actions is not permitted to create or approve pull requests."
21
+ - "HttpError: Resource not accessible by integration"
22
+ - "Error: 403 - {\"message\":\"GitHub Actions is not permitted to create or approve pull requests.\",\"documentation_url\":\"https://docs.github.com/rest/pulls/pulls\"}"
23
+ - "Error: Validation Failed: pull request creation is not allowed for this repository"
24
+ root_cause: |
25
+ GitHub enforces a two-level policy hierarchy for GitHub Actions creating or
26
+ approving pull requests:
27
+
28
+ 1. **Organization level** — GitHub organization owners must enable
29
+ "Allow GitHub Actions to create and approve pull requests" under:
30
+ Organization Settings → Actions → General → Workflow permissions
31
+
32
+ 2. **Repository level** — After the org-level setting is enabled, each repository
33
+ can independently enable or disable the same option. The repo-level option is
34
+ grayed out and non-interactive until the org-level gate is open.
35
+
36
+ 3. **Enterprise level** — For GitHub Enterprise accounts, the same setting must
37
+ also be enabled at the enterprise level (Enterprise Settings → Actions → General)
38
+ before it can be configured at the org level.
39
+
40
+ Adding `permissions: pull-requests: write` (or `permissions: write-all`) to the
41
+ workflow YAML only controls the GITHUB_TOKEN's OAuth scope. The org/enterprise policy
42
+ is an additional administrative gate enforced by the GitHub API regardless of what
43
+ the token is scoped for. The token can have `pull-requests: write` scope but still
44
+ receive HTTP 403 if the org policy is disabled.
45
+
46
+ The repo-level "Read and write permissions" setting in repo Settings → Actions → General
47
+ is a second distinct control — it sets the token's default permissions but still
48
+ cannot override a disabled org-level policy.
49
+ fix: |
50
+ Step 1 — Enable the setting at the **organization level** (requires org owner):
51
+ https://github.com/organizations/YOUR_ORG/settings/actions
52
+ Under "Workflow permissions" → check "Allow GitHub Actions to create and approve pull requests"
53
+
54
+ Step 2 — Enable the setting at the **repository level** (the option is now clickable):
55
+ https://github.com/YOUR_ORG/YOUR_REPO/settings/actions
56
+ Under "Workflow permissions" → check "Allow GitHub Actions to create and approve pull requests"
57
+
58
+ Step 3 — Add the permission to the workflow file:
59
+ permissions: pull-requests: write (plus contents: write if creating commits)
60
+
61
+ For GitHub Enterprise: also enable at enterprise level first:
62
+ https://github.com/enterprises/YOUR_ENTERPRISE/settings/actions
63
+
64
+ For personal accounts (no org):
65
+ Go to Repository Settings → Actions → General → Workflow permissions →
66
+ set "Read and write permissions".
67
+ fix_code:
68
+ - language: yaml
69
+ label: "Add required permissions to the workflow job"
70
+ code: |
71
+ jobs:
72
+ create-pr:
73
+ runs-on: ubuntu-latest
74
+ permissions:
75
+ contents: write # required to push branches
76
+ pull-requests: write # required to create/comment on PRs
77
+ steps:
78
+ - uses: actions/checkout@v4
79
+ - name: Create Pull Request
80
+ uses: peter-evans/create-pull-request@v6
81
+ with:
82
+ title: 'chore: automated update'
83
+ branch: 'automated/update'
84
+ - language: yaml
85
+ label: "Using gh CLI to create a PR (also requires pull-requests: write + org policy enabled)"
86
+ code: |
87
+ jobs:
88
+ open-pr:
89
+ runs-on: ubuntu-latest
90
+ permissions:
91
+ contents: write
92
+ pull-requests: write
93
+ steps:
94
+ - uses: actions/checkout@v4
95
+ - name: Open PR
96
+ env:
97
+ GH_TOKEN: ${{ github.token }}
98
+ run: |
99
+ gh pr create \
100
+ --title "chore: automated update" \
101
+ --body "Created by GitHub Actions" \
102
+ --base main \
103
+ --head "${{ github.ref_name }}"
104
+ prevention:
105
+ - "Before building PR-automation workflows, verify the org-level 'Allow GitHub Actions to create and approve pull requests' setting is enabled."
106
+ - "Check the setting at all applicable levels — enterprise (if applicable) → organization → repository."
107
+ - "Always declare explicit `permissions:` in workflows that create PRs; do not rely on repository defaults."
108
+ - "Use `permissions: pull-requests: write` at the job level (not workflow level) to minimize token scope."
109
+ docs:
110
+ - url: "https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests"
111
+ label: "GitHub Docs — Preventing GitHub Actions from creating or approving pull requests"
112
+ - url: "https://docs.github.com/en/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#preventing-github-actions-from-creating-or-approving-pull-requests"
113
+ label: "GitHub Docs — Org-level: disabling GitHub Actions from creating pull requests"
114
+ - url: "https://stackoverflow.com/questions/72376229/github-actions-is-not-permitted-to-create-or-approve-pull-requests"
115
+ label: "SO: GitHub Actions is not permitted to create or approve pull requests (67 votes, 40k views)"
@@ -0,0 +1,103 @@
1
+ id: runner-environment-137
2
+ title: "bash -eo pipefail Default Causes grep Exit Code 1 (No Matches) to Fail the Step"
3
+ category: runner-environment
4
+ severity: error
5
+ tags:
6
+ - bash
7
+ - grep
8
+ - pipefail
9
+ - set-e
10
+ - shell
11
+ - exit-code
12
+ patterns:
13
+ - regex: 'Error: Process completed with exit code 1\.'
14
+ flags: 'i'
15
+ - regex: 'grep.*exit code 1'
16
+ flags: 'i'
17
+ root_cause: |
18
+ GitHub Actions `run:` steps on Linux/macOS use `bash -e {0}` by default when no
19
+ `shell:` is specified. When `shell: bash` is explicitly set, the shell is invoked
20
+ as `bash --noprofile --norc -eo pipefail {0}`, adding `-o pipefail`.
21
+
22
+ The key behavior:
23
+ - `-e` (set -e) — any command that exits non-zero immediately aborts the whole step.
24
+ - `grep` returns exit code 1 when it finds zero matches (not an error in the shell
25
+ sense, but a non-zero exit). Combined with `-e`, a `grep` that matches nothing
26
+ kills the step with "Error: Process completed with exit code 1."
27
+ - The issue is silent — the step log shows the grep command output (or no output)
28
+ and then suddenly fails. Developers who test locally (where `set -e` is not the
29
+ default interactive shell setting) never reproduce the failure.
30
+
31
+ Common triggers:
32
+ - `grep -c pattern file` when pattern not found → exits 1
33
+ - `git log | grep "pattern"` in CI where the pattern is absent
34
+ - Variable assignment: `COUNT=$(echo "$LIST" | grep -c "value")` — if grep exits 1,
35
+ the subshell exits 1, and `-e` aborts the parent step
36
+ error_messages:
37
+ - "Error: Process completed with exit code 1."
38
+ - "##[error]Process completed with exit code 1."
39
+ fix: |
40
+ Several options depending on your use case:
41
+
42
+ Option 1 — Disable fail-fast for a specific command using `|| true`:
43
+ Append `|| true` to any grep command where zero matches is acceptable. The `|| true`
44
+ ensures the overall expression always exits 0.
45
+
46
+ Option 2 — Disable `set -e` for the entire step with `shell: bash {0}`:
47
+ Using `{0}` as the script placeholder removes the `-e` flag. Use this when you need
48
+ full control over exit codes throughout the step.
49
+
50
+ Option 3 — Use `set +e` at the top of the run block to disable fail-fast for all
51
+ subsequent commands, then selectively handle errors manually.
52
+
53
+ Option 4 — Use grep's `--quiet` / `-q` flag and evaluate with an `if` statement,
54
+ never relying on exit code propagation.
55
+ fix_code:
56
+ - language: yaml
57
+ label: "WRONG — grep exit code 1 kills step when no match found"
58
+ code: |
59
+ - name: Count matches
60
+ run: |
61
+ COUNT=$(echo "$DIFF" | grep -c "src/my_folder")
62
+ echo "Changed files: $COUNT"
63
+ - language: yaml
64
+ label: "CORRECT — append || true to grep commands where zero matches is valid"
65
+ code: |
66
+ - name: Count matches
67
+ run: |
68
+ COUNT=$(echo "$DIFF" | grep -c "src/my_folder" || true)
69
+ echo "Changed files: $COUNT"
70
+ - language: yaml
71
+ label: "CORRECT — disable set -e for entire step with shell: bash {0}"
72
+ code: |
73
+ - name: Count matches
74
+ shell: bash {0}
75
+ run: |
76
+ COUNT=$(echo "$DIFF" | grep -c "src/my_folder")
77
+ echo "Changed files: $COUNT"
78
+ # now exit codes must be checked manually
79
+ - language: yaml
80
+ label: "CORRECT — use grep -q with explicit if for boolean presence check"
81
+ code: |
82
+ - name: Check for changes
83
+ run: |
84
+ if echo "$DIFF" | grep -q "src/my_folder"; then
85
+ echo "Changes detected in src/my_folder"
86
+ else
87
+ echo "No changes in src/my_folder"
88
+ fi
89
+ prevention:
90
+ - "Append `|| true` to any `grep`, `awk`, or other command where a non-zero exit is not an error."
91
+ - "Use `shell: bash {0}` (no `-e`) for steps that need fine-grained exit code handling."
92
+ - "Prefer `grep -q` with `if/else` blocks instead of relying on grep exit codes for flow control."
93
+ - "Test CI scripts locally with `bash -e script.sh` to reproduce the fail-fast behavior."
94
+ - "Use `set -o pipefail` explicitly when you need pipeline failures to surface, and document it."
95
+ docs:
96
+ - url: "https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell"
97
+ label: "jobs.<job_id>.steps[*].shell — default shell invocation"
98
+ - url: "https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference"
99
+ label: "Exit codes and error action preference"
100
+ - url: "https://stackoverflow.com/questions/73066461/github-actions-why-an-intermediate-command-failure-in-shell-script-would-cause"
101
+ label: "SO: Why an intermediate command failure causes the whole step to fail (17 votes)"
102
+ - url: "https://stackoverflow.com/questions/75419587/does-a-github-action-step-use-set-e-semantics-by-default"
103
+ label: "SO: Does a GitHub action step use set -e semantics by default? (13 votes)"
@@ -0,0 +1,113 @@
1
+ id: runner-environment-138
2
+ title: "npm ci Cross-Platform Lockfile Missing Optional Native Binaries (esbuild, rollup, vite)"
3
+ category: runner-environment
4
+ severity: error
5
+ tags:
6
+ - npm
7
+ - npm-ci
8
+ - esbuild
9
+ - rollup
10
+ - vite
11
+ - optional-dependencies
12
+ - cross-platform
13
+ - lockfile
14
+ - native-binary
15
+ patterns:
16
+ - regex: 'Cannot find module @rollup/rollup-linux-x64'
17
+ flags: 'i'
18
+ - regex: 'You installed esbuild (on|for) another platform'
19
+ flags: 'i'
20
+ - regex: 'Cannot find module @esbuild/linux'
21
+ flags: 'i'
22
+ - regex: 'npm has a bug related to optional dependencies'
23
+ flags: 'i'
24
+ error_messages:
25
+ - "Cannot find module @rollup/rollup-linux-x64-gnu"
26
+ - "Cannot find module @rollup/rollup-linux-x64-musl"
27
+ - "You installed esbuild on another platform than the one you're currently using"
28
+ - "Cannot find module @esbuild/linux-x64"
29
+ - "npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory."
30
+ root_cause: |
31
+ Modern JavaScript bundlers (rollup, vite, esbuild, SWC, Turbopack) ship platform-
32
+ specific optional native binaries as separate npm packages — e.g.,
33
+ `@rollup/rollup-linux-x64-gnu`, `@esbuild/darwin-arm64`, `@esbuild/linux-x64`.
34
+
35
+ When a developer runs `npm install` on macOS (darwin-arm64 or darwin-x64), the
36
+ generated `package-lock.json` records the macOS-specific optional packages but NOT
37
+ the Linux equivalents. GitHub-hosted runners run on Linux. When `npm ci` uses
38
+ this macOS-generated lockfile in CI:
39
+
40
+ 1. `npm ci` correctly installs exactly what's in the lockfile — only the macOS
41
+ native binary entries are present.
42
+ 2. The Linux-specific optional dependency (`@rollup/rollup-linux-x64-gnu`) is
43
+ absent from the lockfile, so `npm ci` never installs it.
44
+ 3. The build step then fails because the required native binary is missing.
45
+
46
+ This was a long-standing npm bug (npm/cli#4828) that was fixed in npm 11.3.0
47
+ (shipped with Node.js 24.0.2). On older npm versions the issue must be worked around.
48
+
49
+ Note: `npm ci` itself succeeds — the failure occurs downstream during the build/test
50
+ step that imports the native module.
51
+ fix: |
52
+ Option 1 (recommended for npm 11.3.0+ / Node.js 24.0.2+):
53
+ Update Node.js to 24.0.2 or npm to 11.3.0+, then regenerate the lockfile with
54
+ `npm install` from scratch. The bug is fixed in this version.
55
+
56
+ Option 2 — Explicitly list the Linux optional dependencies in `package.json`:
57
+ Add all required platform-native packages to the `optionalDependencies` section.
58
+ npm will then include them in the lockfile regardless of the OS where it was generated.
59
+
60
+ Option 3 — Regenerate the lockfile in CI using `npm install --package-lock-only`
61
+ before running `npm ci`. This is slow but guarantees the lockfile matches the runner OS.
62
+
63
+ Option 4 — Use a Linux environment locally (Docker, WSL2, or devcontainer) to
64
+ generate the lockfile so it contains Linux-specific entries.
65
+ fix_code:
66
+ - language: yaml
67
+ label: "Option 2 — Add Linux optional native packages to package.json optionalDependencies"
68
+ code: |
69
+ # In package.json, add the Linux optional dependency explicitly:
70
+ # "optionalDependencies": {
71
+ # "@rollup/rollup-linux-x64-gnu": "*"
72
+ # }
73
+ # Then run npm install locally to regenerate the lockfile.
74
+ # In your workflow, npm ci will now install it on Linux runners.
75
+ jobs:
76
+ build:
77
+ runs-on: ubuntu-latest
78
+ steps:
79
+ - uses: actions/checkout@v4
80
+ - uses: actions/setup-node@v4
81
+ with:
82
+ node-version: '20'
83
+ cache: 'npm'
84
+ - run: npm ci
85
+ - run: npm run build
86
+ - language: yaml
87
+ label: "Option 1 — Use Node.js 24+ where the bug is fixed"
88
+ code: |
89
+ jobs:
90
+ build:
91
+ runs-on: ubuntu-latest
92
+ steps:
93
+ - uses: actions/checkout@v4
94
+ - uses: actions/setup-node@v4
95
+ with:
96
+ node-version: '24' # npm 11.3.0+ ships with Node 24.0.2+
97
+ cache: 'npm'
98
+ - run: npm ci
99
+ - run: npm run build
100
+ prevention:
101
+ - "Pin your team's lockfile generation to Linux (use devcontainers, Docker, or WSL2 on Windows)."
102
+ - "Upgrade to Node.js 24.0.2+ or npm 11.3.0+ where the optional dependency platform bug is fixed."
103
+ - "If cross-platform lockfiles are unavoidable, explicitly add platform-specific packages to `optionalDependencies` in `package.json`."
104
+ - "After adding `optionalDependencies`, regenerate the lockfile from scratch — delete `package-lock.json` and `node_modules`, then run `npm install`."
105
+ docs:
106
+ - url: "https://stackoverflow.com/questions/79048814/github-action-is-failing-due-to-rollup-rollup-linux-x64-gnu"
107
+ label: "SO: Github Action failing due to @rollup/rollup-linux-x64-gnu (13 votes, 8k views)"
108
+ - url: "https://stackoverflow.com/questions/73139649/you-installed-esbuild-on-another-platform-than-the-one-youre-currently-using"
109
+ label: "SO: You installed esbuild on another platform (36 votes, 51k views)"
110
+ - url: "https://github.com/npm/cli/issues/4828"
111
+ label: "npm/cli#4828 — Optional dependencies not installed for different platform"
112
+ - url: "https://vitejs.dev/guide/troubleshooting#vite-cjs-node-api-deprecated"
113
+ label: "Vite troubleshooting — esbuild platform mismatch"
@@ -0,0 +1,117 @@
1
+ id: runner-environment-139
2
+ title: "Binaries Built on ubuntu-24.04 Require GLIBC 2.39 — Fail to Execute on ubuntu-22.04 Targets"
3
+ category: runner-environment
4
+ severity: error
5
+ tags:
6
+ - ubuntu-24.04
7
+ - ubuntu-latest
8
+ - glibc
9
+ - binary-compatibility
10
+ - linker
11
+ - distribution
12
+ patterns:
13
+ - regex: 'version ''GLIBC_2\.3[6-9]'' not found'
14
+ flags: 'i'
15
+ - regex: 'libc\.so\.[0-9]+: version ''GLIBC_'
16
+ flags: 'i'
17
+ - regex: 'GLIBC_2\.3[6-9] not found \(required by'
18
+ flags: 'i'
19
+ error_messages:
20
+ - "/lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.38' not found (required by ./myapp)"
21
+ - "/lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.39' not found (required by ./myapp)"
22
+ - "GLIBC_2.39 not found (required by /usr/local/bin/app)"
23
+ - "version 'GLIBC_2.38' not found"
24
+ root_cause: |
25
+ GitHub Actions ubuntu-24.04 runners ship with GLIBC 2.39 (GNU C Library). When a
26
+ binary is compiled or dynamically linked on ubuntu-24.04, the resulting ELF binary
27
+ records minimum GLIBC version requirements based on the newest symbol version used —
28
+ either directly or via a linked shared library. If any symbol first introduced in
29
+ GLIBC 2.36–2.39 is referenced, the binary will fail to load on older systems.
30
+
31
+ GLIBC versions by runner image:
32
+ - ubuntu-20.04: GLIBC 2.31
33
+ - ubuntu-22.04: GLIBC 2.35
34
+ - ubuntu-24.04: GLIBC 2.39
35
+
36
+ This affects workflows that:
37
+ 1. Build release binaries on ubuntu-latest (which resolved to ubuntu-24.04 in mid-2025)
38
+ and distribute them for Linux users on ubuntu-22.04 or older.
39
+ 2. Produce binaries in one job on ubuntu-24.04 and run them in a matrix job on
40
+ ubuntu-22.04 — the artifact fails to execute in the older-runner job.
41
+ 3. Build Docker images using ubuntu-24.04 as the build stage but target a
42
+ FROM ubuntu:22.04 or FROM debian:bookworm base image in the runtime stage.
43
+
44
+ The error only surfaces at execution time, not at compile or link time. The
45
+ binary appears healthy; only when it is actually run on the older system does
46
+ the dynamic linker report the missing GLIBC version.
47
+ fix: |
48
+ Option 1 — Pin the build runner to the oldest supported OS:
49
+ Use ubuntu-22.04 as the build runner to ensure binaries link against GLIBC 2.35,
50
+ which is compatible with both ubuntu-22.04 and ubuntu-24.04 targets.
51
+
52
+ Option 2 — Build inside a container matching the target OS:
53
+ Use a Docker container (e.g., ubuntu:22.04) in the build job so the compiler
54
+ links against the correct GLIBC version regardless of the host runner.
55
+
56
+ Option 3 — Cross-compile with musl-libc (static, no GLIBC dependency):
57
+ For Rust, use the x86_64-unknown-linux-musl target. For C/C++, use musl-gcc or
58
+ musl-cross. The resulting binary has no GLIBC dependency and runs anywhere.
59
+
60
+ Option 4 — Verify GLIBC requirement in CI:
61
+ Add a validation step that runs objdump or readelf to assert the binary's
62
+ minimum GLIBC requirement before it reaches distribution.
63
+ fix_code:
64
+ - language: yaml
65
+ label: "Pin build runner to ubuntu-22.04 for GLIBC 2.35 compatibility"
66
+ code: |
67
+ jobs:
68
+ build:
69
+ runs-on: ubuntu-22.04 # GLIBC 2.35 — compatible with ubuntu-22.04 targets
70
+ steps:
71
+ - uses: actions/checkout@v4
72
+ - name: Build binary
73
+ run: cargo build --release
74
+ - uses: actions/upload-artifact@v4
75
+ with:
76
+ name: my-binary
77
+ path: target/release/myapp
78
+ - language: yaml
79
+ label: "Build inside a Docker container targeting ubuntu:22.04"
80
+ code: |
81
+ jobs:
82
+ build:
83
+ runs-on: ubuntu-latest
84
+ container:
85
+ image: ubuntu:22.04
86
+ steps:
87
+ - name: Install build tools
88
+ run: |
89
+ apt-get update
90
+ apt-get install -y build-essential curl
91
+ - uses: actions/checkout@v4
92
+ - name: Build binary
93
+ run: make release
94
+ - language: yaml
95
+ label: "Rust: build static binary with musl (no GLIBC dependency)"
96
+ code: |
97
+ jobs:
98
+ build:
99
+ runs-on: ubuntu-latest
100
+ steps:
101
+ - uses: actions/checkout@v4
102
+ - name: Add musl target
103
+ run: rustup target add x86_64-unknown-linux-musl
104
+ - name: Build static binary
105
+ run: cargo build --release --target x86_64-unknown-linux-musl
106
+ prevention:
107
+ - "Pin the build runner to the oldest Linux OS your users run when distributing compiled binaries."
108
+ - "Test binary artifacts in a matrix that includes the oldest supported runner (ubuntu-22.04) as a separate job."
109
+ - "Use `objdump -T myapp | grep -o 'GLIBC_[0-9.]*' | sort -V | tail -1` to check the minimum GLIBC version before release."
110
+ - "For maximum portability, use musl-libc or static linking to eliminate the GLIBC runtime dependency entirely."
111
+ docs:
112
+ - url: "https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners"
113
+ label: "GitHub-hosted runners: available images"
114
+ - url: "https://wiki.ubuntu.com/Releases"
115
+ label: "Ubuntu release versions and GLIBC versions"
116
+ - url: "https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md"
117
+ label: "ubuntu-24.04 runner image readme"
@@ -0,0 +1,96 @@
1
+ id: silent-failures-072
2
+ title: "inputs Context Empty on Non-Dispatch Events — Multi-Trigger Workflows Leave inputs.* as Empty String"
3
+ category: silent-failures
4
+ severity: silent-failure
5
+ tags:
6
+ - inputs
7
+ - workflow-dispatch
8
+ - push
9
+ - multi-trigger
10
+ - context
11
+ - empty-string
12
+ patterns:
13
+ - regex: 'inputs\.[a-zA-Z_][a-zA-Z0-9_-]* (?:is empty|not set|undefined|was null)'
14
+ flags: 'i'
15
+ error_messages:
16
+ - "Deploy target is empty — expected inputs.environment to be non-empty"
17
+ - "Error: Input required and not supplied: environment"
18
+ root_cause: |
19
+ The `inputs` context in GitHub Actions is ONLY populated when a workflow is triggered
20
+ by a `workflow_dispatch` or `workflow_call` event. When the same workflow is triggered
21
+ by any other event — push, pull_request, schedule, release, workflow_run, etc. — the
22
+ entire `inputs` context is empty. Every `${{ inputs.anything }}` expression evaluates
23
+ to `""` (empty string) without raising an error or printing a warning.
24
+
25
+ This commonly affects developers who:
26
+ 1. Add `on: workflow_dispatch` with inputs to an existing push-triggered workflow
27
+ to enable manual override capability.
28
+ 2. Reference `${{ inputs.environment }}` or `${{ inputs.deploy_target }}` in `run:`
29
+ steps, `with:` parameters, or `env:` blocks — expecting a sensible default when
30
+ triggered automatically by push.
31
+ 3. Use `if: inputs.skip_tests == 'true'` — on push events this is effectively
32
+ `if: '' == 'true'` which evaluates to false silently.
33
+ 4. Pass `${{ inputs.version }}` to an action's `with: version:` parameter — the
34
+ action receives an empty string and may silently use its own default or fail
35
+ with an opaque "invalid version" message.
36
+
37
+ The `inputs` context is distinct from `github.event.inputs` (legacy alias, same
38
+ empty behavior on non-dispatch events) and from the `vars` context (org/repo
39
+ configuration variables which are always populated).
40
+ fix: |
41
+ Use the `||` fallback operator to provide defaults for all inputs in workflows
42
+ that support multiple triggers. This guarantees non-dispatch triggers receive
43
+ a sensible default instead of an empty string.
44
+
45
+ Guard dispatch-only logic blocks with `if: github.event_name == 'workflow_dispatch'`
46
+ to explicitly skip input-dependent steps on automated trigger runs.
47
+ fix_code:
48
+ - language: yaml
49
+ label: "Provide fallback defaults for all inputs in multi-event workflows"
50
+ code: |
51
+ on:
52
+ push:
53
+ branches: [main]
54
+ workflow_dispatch:
55
+ inputs:
56
+ environment:
57
+ type: choice
58
+ options: [staging, production]
59
+ default: staging
60
+ skip_tests:
61
+ type: boolean
62
+ default: false
63
+
64
+ jobs:
65
+ deploy:
66
+ runs-on: ubuntu-latest
67
+ env:
68
+ # Use || to fall back to defaults when triggered by push
69
+ DEPLOY_ENV: ${{ inputs.environment || 'staging' }}
70
+ SKIP_TESTS: ${{ inputs.skip_tests || 'false' }}
71
+ steps:
72
+ - name: Deploy
73
+ run: echo "Deploying to $DEPLOY_ENV (skip_tests=$SKIP_TESTS)"
74
+ - language: yaml
75
+ label: "Guard input-dependent logic with event_name check"
76
+ code: |
77
+ steps:
78
+ - name: Apply manual override (dispatch only)
79
+ if: github.event_name == 'workflow_dispatch'
80
+ run: echo "Manual dispatch with environment=${{ inputs.environment }}"
81
+
82
+ - name: Default automated deploy
83
+ if: github.event_name != 'workflow_dispatch'
84
+ run: echo "Automated push deploy to staging"
85
+ prevention:
86
+ - "Always use `${{ inputs.param || 'default' }}` when a workflow supports more than one trigger — never assume inputs will be populated."
87
+ - "Log `github.event_name` at the start of the workflow to trace which trigger fired and aid debugging of empty-input behavior."
88
+ - "Use the 'Context availability' table in GitHub Actions documentation to verify which contexts are populated for each event type before referencing them."
89
+ - "Consider splitting dispatch workflows (with inputs) from automated trigger workflows — combining both in one file with shared input-referencing code is a common source of subtle bugs."
90
+ docs:
91
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/contexts#inputs-context"
92
+ label: "GitHub Actions: inputs context"
93
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_dispatch"
94
+ label: "workflow_dispatch event"
95
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/contexts#context-availability"
96
+ label: "Context availability by event type"
@@ -0,0 +1,84 @@
1
+ id: silent-failures-073
2
+ title: "vars. Context Returns Empty String for Undefined Organization or Repository Variables — No Error Raised"
3
+ category: silent-failures
4
+ severity: silent-failure
5
+ tags:
6
+ - vars
7
+ - configuration-variables
8
+ - context
9
+ - empty-string
10
+ - organization
11
+ - repository
12
+ patterns:
13
+ - regex: 'vars\.[A-Z_][A-Z0-9_]* (?:is empty|not set|missing|undefined|not defined)'
14
+ flags: 'i'
15
+ error_messages:
16
+ - "Error: REGISTRY_URL is empty — check that vars.REGISTRY_URL is defined in repository variables"
17
+ - "Error: docker tag '' is not valid"
18
+ - "fatal: repository '' does not exist"
19
+ root_cause: |
20
+ GitHub Actions configuration variables (the `vars` context, introduced 2023) provide a
21
+ non-secret key/value store at the organization, repository, or environment level. When
22
+ a `${{ vars.MY_VARIABLE }}` expression references a variable that has not been defined
23
+ at any applicable scope, the expression evaluates to `""` (empty string) without
24
+ raising any error, warning, or annotation in the Actions run UI.
25
+
26
+ Unlike missing secrets (which also silently return empty string), `vars` variables are
27
+ user-visible and frequently forgotten when:
28
+ 1. A workflow is used in a new repository that hasn't had its variables configured.
29
+ 2. A variable is defined at the repository level but the job targets an environment
30
+ that doesn't inherit repo-level variables (environment-scoped variables override
31
+ but do not merge with repo-scoped variables of the same name).
32
+ 3. A variable is defined only at the organization level but the repository is
33
+ a fork — forked repositories cannot access parent org variables.
34
+ 4. The variable name has a typo in the workflow file.
35
+
36
+ Silent empty values cascade into confusing downstream errors: Docker tags become `":latest"`
37
+ instead of `"ghcr.io/org/image:latest"`, API endpoints receive empty base URLs, and
38
+ notification webhooks silently fail with HTTP 400.
39
+
40
+ Environment-scoped variables are ONLY available when the job specifies `environment:`.
41
+ If a job has no `environment:` key, env-scoped variables are not available even if
42
+ the env-scoped variable has the same name as a repo-scoped variable.
43
+ fix: |
44
+ Use the `||` fallback operator to provide safe defaults, and add an explicit
45
+ validation step for variables that are required for the workflow to succeed.
46
+ fix_code:
47
+ - language: yaml
48
+ label: "Use || fallback for optional vars"
49
+ code: |
50
+ env:
51
+ REGISTRY: ${{ vars.REGISTRY_URL || 'ghcr.io' }}
52
+ LOG_LEVEL: ${{ vars.LOG_LEVEL || 'info' }}
53
+ API_BASE: ${{ vars.API_BASE_URL || 'https://api.example.com' }}
54
+ - language: yaml
55
+ label: "Validate required vars at workflow start with fail-fast"
56
+ code: |
57
+ jobs:
58
+ preflight:
59
+ runs-on: ubuntu-latest
60
+ steps:
61
+ - name: Validate required configuration variables
62
+ env:
63
+ REGISTRY_URL: ${{ vars.REGISTRY_URL }}
64
+ DEPLOY_ENV: ${{ vars.DEPLOY_ENV }}
65
+ run: |
66
+ missing=()
67
+ [ -z "$REGISTRY_URL" ] && missing+=("vars.REGISTRY_URL")
68
+ [ -z "$DEPLOY_ENV" ] && missing+=("vars.DEPLOY_ENV")
69
+ if [ ${#missing[@]} -gt 0 ]; then
70
+ echo "::error::Missing required variables: ${missing[*]}"
71
+ echo "Set them at: Settings → Secrets and Variables → Variables"
72
+ exit 1
73
+ fi
74
+ prevention:
75
+ - "Document all required `vars.*` variables in the repository README or CONTRIBUTING guide — unlike required inputs, they have no built-in validation."
76
+ - "Add a preflight validation job that checks for required variables and fails immediately with a clear error message."
77
+ - "Use `${{ vars.SETTING || 'sensible-default' }}` consistently to make empty-variable behavior explicit."
78
+ - "For environment-scoped variables, ensure the job specifies `environment:` — variables defined only on an environment are not available to jobs that omit the environment key."
79
+ - "Use repository variable naming conventions (UPPER_SNAKE_CASE) and check for typos in workflow YAML against the variables defined in Settings."
80
+ docs:
81
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables"
82
+ label: "GitHub Actions: configuration variables (vars context)"
83
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/contexts#vars-context"
84
+ label: "vars context reference"
@@ -0,0 +1,115 @@
1
+ id: triggers-052
2
+ title: "Required Status Check Not Appearing in Branch Protection Dropdown"
3
+ category: triggers
4
+ severity: limitation
5
+ tags:
6
+ - branch-protection
7
+ - required-status-check
8
+ - check-name
9
+ - job-name
10
+ - workflow-name
11
+ - protected-branch
12
+ patterns:
13
+ - regex: 'status check.*not found'
14
+ flags: 'i'
15
+ - regex: 'waiting for status to be reported'
16
+ flags: 'i'
17
+ error_messages:
18
+ - "Waiting for status to be reported"
19
+ - "Required status check is expected — check name not found in the dropdown"
20
+ root_cause: |
21
+ Branch protection required status checks have several constraints that cause them
22
+ to silently not appear in the "Status checks that are required" search dropdown:
23
+
24
+ 1. **Wrong name searched** — The check name in branch protection is the job's
25
+ `name:` field (if set) or the job's YAML key (ID) — NOT the workflow's `name:`
26
+ field. Developers often search for the workflow name and can't find the check.
27
+ For matrix jobs, the check name includes matrix values:
28
+ e.g., `build (ubuntu-latest, 20.x)` not just `build`.
29
+
30
+ 2. **Check must have run recently** — A status check only appears in the dropdown
31
+ after it has completed successfully at least once on that repository within the
32
+ past 7 days. Brand-new workflows that have never been triggered won't show up.
33
+
34
+ 3. **Workflow must target the protected branch** — For PR-triggered checks, the
35
+ workflow must have `on: pull_request: branches: [main]` (or the target branch).
36
+ A workflow that only runs on `push` to feature branches never posts a status
37
+ to main's pull requests.
38
+
39
+ 4. **Paths filters suppressing the check** — If the workflow has `paths:` filters,
40
+ PRs that don't change filtered files never trigger the workflow, so the check
41
+ is absent (causing PRs to be permanently stuck as "Waiting"). This is covered
42
+ separately in `required-status-check-paths-filter-pr-stuck.yml`.
43
+
44
+ All of these issues are silent — no error is shown. The dropdown simply doesn't
45
+ include the expected check name.
46
+ fix: |
47
+ Step 1 — Confirm the exact check name:
48
+ Go to any recently-merged or open PR in the repository. Find the check in the
49
+ PR's "Checks" tab. Copy the exact displayed name — it is the job's `name:` field
50
+ or the YAML job key, not the workflow `name:` at the top of the file.
51
+ For matrix jobs, include the matrix combination: `build (ubuntu-latest, 20.x)`.
52
+
53
+ Step 2 — Trigger the workflow at least once on a PR against the protected branch:
54
+ The check must have a successful run within the past 7 days to appear.
55
+ Create a test PR or push a temporary commit to get the first run.
56
+
57
+ Step 3 — Add a descriptive `name:` to each job that will be a required check.
58
+ This makes the check name human-readable and stable even if you rename the job key.
59
+
60
+ Step 4 — For matrix workflows, consider adding a fanout job (a job that `needs:`
61
+ all matrix jobs) with a simple pass/fail step, and set THAT as the required check.
62
+ This avoids needing to list every matrix combination individually in branch protection.
63
+ fix_code:
64
+ - language: yaml
65
+ label: "Add explicit job name for a stable, searchable required status check name"
66
+ code: |
67
+ jobs:
68
+ build:
69
+ name: "CI Build" # This is the check name in branch protection, NOT 'build'
70
+ runs-on: ubuntu-latest
71
+ steps:
72
+ - uses: actions/checkout@v4
73
+ - run: npm ci && npm test
74
+ - language: yaml
75
+ label: "Matrix jobs — add a fanout job to use as the single required check"
76
+ code: |
77
+ jobs:
78
+ test:
79
+ name: "Test (${{ matrix.os }}, Node ${{ matrix.node }})"
80
+ runs-on: ${{ matrix.os }}
81
+ strategy:
82
+ matrix:
83
+ os: [ubuntu-latest, windows-latest]
84
+ node: ['18', '20']
85
+ steps:
86
+ - uses: actions/checkout@v4
87
+ - uses: actions/setup-node@v4
88
+ with:
89
+ node-version: ${{ matrix.node }}
90
+ - run: npm ci && npm test
91
+
92
+ all-tests-pass:
93
+ name: "All Tests Pass" # Set THIS as the required status check
94
+ needs: test
95
+ runs-on: ubuntu-latest
96
+ if: always()
97
+ steps:
98
+ - name: Verify all matrix jobs passed
99
+ run: |
100
+ if [[ "${{ needs.test.result }}" != "success" ]]; then
101
+ echo "One or more test matrix jobs failed"
102
+ exit 1
103
+ fi
104
+ prevention:
105
+ - "Always add a `name:` to jobs that will be required status checks — job IDs change when refactoring."
106
+ - "Trigger the workflow at least once before setting up branch protection, so the check appears in the dropdown."
107
+ - "For matrix jobs, add a dedicated fanout job that passes only when all matrix jobs pass; set it as the required check."
108
+ - "Avoid `paths:` filters on required-check workflows — use them on optional checks only, or use `required-status-check-paths-filter-pr-stuck.yml` workaround."
109
+ docs:
110
+ - url: "https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks"
111
+ label: "GitHub Docs — Troubleshooting required status checks"
112
+ - url: "https://stackoverflow.com/questions/68554735/github-action-status-check-missing-from-the-list-of-checks-in-protected-branch-s"
113
+ label: "SO: Github Action Status check missing from Protected branch settings (75 votes, 29k views)"
114
+ - url: "https://stackoverflow.com/questions/61989951/github-action-workflow-not-running"
115
+ label: "SO: GitHub Action workflow not running (158 votes, 202k views)"
@@ -0,0 +1,101 @@
1
+ id: yaml-syntax-049
2
+ title: "env Variable Name with Dots — ${{ env.MY.VAR }} Silently Reads Undefined Subproperty"
3
+ category: yaml-syntax
4
+ severity: silent-failure
5
+ tags:
6
+ - env-context
7
+ - expression-syntax
8
+ - dots
9
+ - property-access
10
+ - empty-string
11
+ - naming
12
+ patterns:
13
+ - regex: '\$\{\{\s*env\.[A-Za-z_][A-Za-z0-9_]*\.[A-Za-z_]'
14
+ flags: ''
15
+ - regex: '\$\{\{\s*vars\.[A-Za-z_][A-Za-z0-9_]*\.[A-Za-z_]'
16
+ flags: ''
17
+ error_messages:
18
+ - "Error: Expected non-empty value but got '' (env.MY.VAR resolved to empty string)"
19
+ - "::error::Variable 'app.version' is empty — check expression syntax"
20
+ root_cause: |
21
+ GitHub Actions expression syntax uses the dot (`.`) character as a property accessor
22
+ for traversing nested context objects. When an environment variable name contains a
23
+ dot (e.g., `MY.VAR`, `app.version`, `node.options`), the expression `${{ env.MY.VAR }}`
24
+ is evaluated by the expression parser as two sequential property dereferences:
25
+
26
+ 1. `env.MY` — look up the property named exactly `MY` on the env object
27
+ 2. `.VAR` — look up the property named `VAR` on the result of step 1
28
+
29
+ If no environment variable named exactly `MY` exists (only `MY.VAR` does), then
30
+ `env.MY` returns `""` (empty string), and the entire expression silently evaluates
31
+ to `""` with no error or warning.
32
+
33
+ This is legal YAML — `env: MY.VAR: 'hello'` is valid YAML syntax and DOES set the
34
+ shell environment variable `MY.VAR` in `run:` steps. Linux and macOS allow dots in
35
+ env var names. The problem is exclusively in the expression layer: `${{ env.MY.VAR }}`
36
+ cannot reach the variable because `.` is an operator, not part of the identifier.
37
+
38
+ The same issue affects the `vars` context: `${{ vars.app.version }}` attempts to
39
+ read a sub-property `version` of a variable named `app`, not a variable named
40
+ `app.version`.
41
+
42
+ actionlint does not currently warn on dotted env/vars expressions because the
43
+ expression syntax is technically valid — it just resolves to empty string at runtime.
44
+ fix: |
45
+ Option 1 — Rename environment variables to use underscores instead of dots (recommended):
46
+ Change `MY.VAR` to `MY_VAR`. This is the POSIX-conventional approach and works
47
+ reliably with all GitHub Actions expression syntax.
48
+
49
+ Option 2 — Use bracket property accessor syntax:
50
+ `${{ env['MY.VAR'] }}` uses the array/bracket notation which treats the entire
51
+ string `MY.VAR` as a single property key, correctly reading the dotted variable.
52
+
53
+ Option 3 — Access the variable via shell syntax in run: steps:
54
+ In `run:` steps the shell receives the full env var with its dotted name. Use
55
+ the shell variable reference directly in shell scripts, not in expressions.
56
+ fix_code:
57
+ - language: yaml
58
+ label: "Rename to underscores (recommended)"
59
+ code: |
60
+ env:
61
+ MY_VAR: 'hello' # was MY.VAR — underscore works in expressions
62
+ APP_VERSION: '1.2.3' # was app.version
63
+
64
+ steps:
65
+ - name: Read variable
66
+ run: echo "Version is ${{ env.APP_VERSION }}"
67
+ - language: yaml
68
+ label: "Bracket syntax for dotted env var names"
69
+ code: |
70
+ env:
71
+ MY.VAR: 'hello' # dotted name is set in the shell env
72
+
73
+ steps:
74
+ - name: Read via bracket syntax
75
+ run: echo "Value is ${{ env['MY.VAR'] }}"
76
+ # BAD: ${{ env.MY.VAR }} → silently reads undefined subproperty
77
+ # GOOD: ${{ env['MY.VAR'] }} → reads the full dotted variable name
78
+ - language: yaml
79
+ label: "Access dotted env var directly in shell (run: steps only)"
80
+ code: |
81
+ env:
82
+ MY.VAR: 'hello'
83
+
84
+ steps:
85
+ - name: Use shell variable directly
86
+ run: |
87
+ # The shell receives the env var with its dotted name
88
+ # Access it via indirect parameter expansion
89
+ VAR_NAME='MY.VAR'
90
+ echo "${!VAR_NAME}" # bash indirect expansion
91
+ prevention:
92
+ - "Never use dots in environment variable names in `env:` blocks — always use UPPER_SNAKE_CASE with underscores."
93
+ - "When consuming third-party tooling that sets dotted env var names, immediately re-export them with underscore names for safe use in expressions."
94
+ - "Review any expression containing two dots in the same context path (e.g., `env.a.b`) — this almost always indicates a naming mistake."
95
+ docs:
96
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/contexts#env-context"
97
+ label: "GitHub Actions: env context"
98
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#property-dereference"
99
+ label: "Property dereference in expressions"
100
+ - url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions"
101
+ label: "Evaluate expressions in workflows and actions"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htekdev/actions-debugger",
3
- "version": "1.0.75",
3
+ "version": "1.0.77",
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",