@htekdev/actions-debugger 1.0.43 → 1.0.44

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,100 @@
1
+ id: known-unsolved-034
2
+ title: 'environment deployment protection with required reviewers creates one review request per matrix job — no batch approval'
3
+ category: known-unsolved
4
+ severity: limitation
5
+ tags:
6
+ - environment
7
+ - matrix
8
+ - deployment
9
+ - required-reviewers
10
+ - approvals
11
+ - no-fix
12
+ patterns:
13
+ - regex: 'Waiting for.*review'
14
+ flags: 'i'
15
+ - regex: 'Review required before this job runs'
16
+ flags: 'i'
17
+ error_messages:
18
+ - 'Waiting for a reviewer'
19
+ - 'Review required before this job runs'
20
+ root_cause: |
21
+ GitHub Actions environments with required reviewers enforce approval at the
22
+ individual job level. When a job using environment: with required reviewers
23
+ also uses strategy: matrix, each matrix cell creates a separate deployment
24
+ instance requiring its own approval.
25
+
26
+ A 3x3 matrix (os x environment) produces 9 separate "Waiting for reviewer"
27
+ prompts in the GitHub Actions UI — one for each matrix combination. Each
28
+ must be approved individually; there is no "approve all" button for
29
+ matrix deployments.
30
+
31
+ This behavior stems from GitHub's deployment model: each job run creates a
32
+ discrete deployment record in the repository's deployment history. Matrix
33
+ jobs are independent job runs, so each creates its own deployment record
34
+ and independently triggers the environment protection review gate.
35
+
36
+ This is confirmed expected behavior per GitHub staff in community discussions.
37
+ There is no configuration option to batch or group matrix job deployment approvals.
38
+ fix: |
39
+ There is no supported way to batch-approve matrix jobs targeting a protected
40
+ environment. The workaround is architectural: separate the build/test matrix
41
+ from the deployment job, using a single non-matrix deploy job that depends
42
+ on all matrix results via needs:.
43
+
44
+ This "build in matrix, deploy once" pattern also aligns with security best
45
+ practice — production deployments should be a single auditable event.
46
+ fix_code:
47
+ - language: yaml
48
+ label: 'Anti-pattern — matrix job with protected environment (creates N review requests)'
49
+ code: |
50
+ jobs:
51
+ deploy:
52
+ strategy:
53
+ matrix:
54
+ region: [us-east-1, eu-west-1, ap-southeast-1]
55
+ environment: production # 3 separate review requests
56
+ runs-on: ubuntu-latest
57
+ steps:
58
+ - run: echo "deploying to ${{ matrix.region }}"
59
+ - language: yaml
60
+ label: 'Workaround — single non-matrix deploy job collects matrix artifacts and deploys once'
61
+ code: |
62
+ jobs:
63
+ build:
64
+ strategy:
65
+ matrix:
66
+ region: [us-east-1, eu-west-1, ap-southeast-1]
67
+ runs-on: ubuntu-latest
68
+ steps:
69
+ - uses: actions/checkout@v4
70
+ - name: Build for region
71
+ run: make build REGION=${{ matrix.region }}
72
+ - uses: actions/upload-artifact@v4
73
+ with:
74
+ name: build-${{ matrix.region }}
75
+ path: dist/
76
+
77
+ deploy:
78
+ needs: build
79
+ runs-on: ubuntu-latest
80
+ environment: production # Single review request for all regions
81
+ steps:
82
+ - uses: actions/download-artifact@v4
83
+ with:
84
+ pattern: build-*
85
+ merge-multiple: true
86
+ path: all-dist/
87
+ - name: Deploy all regions
88
+ run: make deploy-all ARTIFACTS_DIR=all-dist/
89
+ prevention:
90
+ - 'Design deployment workflows so the job with environment: protection is never a matrix job'
91
+ - 'Use build-in-matrix, deploy-once pattern: matrix for build/test, single serial job for protected deploy'
92
+ - 'If per-region deployments must be parallel and require environment protection, accept the N-approvals UX'
93
+ - 'Document this limitation in team runbooks before adopting matrix + environment patterns in production pipelines'
94
+ docs:
95
+ - url: 'https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-deployments/managing-environments-for-deployment'
96
+ label: 'GitHub Docs — Managing environments for deployment'
97
+ - url: 'https://github.com/orgs/community/discussions/15690'
98
+ label: 'GitHub Community — Matrix deployment creates multiple approval requests'
99
+ - url: 'https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-a-matrix-for-your-workflow'
100
+ label: 'GitHub Docs — Using a matrix for your workflow'
@@ -0,0 +1,100 @@
1
+ id: permissions-auth-035
2
+ title: 'actions/attest-build-provenance fails with 403 — missing attestations: write permission'
3
+ category: permissions-auth
4
+ severity: error
5
+ tags:
6
+ - attestations
7
+ - attest-build-provenance
8
+ - GITHUB_TOKEN
9
+ - permissions
10
+ - 403
11
+ - supply-chain
12
+ patterns:
13
+ - regex: 'HttpError.*403.*attestation'
14
+ flags: 'i'
15
+ - regex: 'Resource not accessible by integration'
16
+ flags: 'i'
17
+ - regex: 'Failed to create attestation'
18
+ flags: 'i'
19
+ error_messages:
20
+ - 'HttpError: 403 — Resource not accessible by integration'
21
+ - 'Failed to create attestation'
22
+ - 'Error: Resource not accessible by integration'
23
+ root_cause: |
24
+ actions/attest-build-provenance (introduced GitHub Changelog, May 2024) requires
25
+ the GITHUB_TOKEN to have the attestations: write scope. This permission did not
26
+ exist before the attestations feature was released and is NOT included in the
27
+ GitHub Actions default token permissions, nor in commonly used broad permission
28
+ sets like contents: write or id-token: write.
29
+
30
+ When the workflow omits attestations: write from its permissions block, the
31
+ action fails with a 403 "Resource not accessible by integration" error. The
32
+ error message does not explicitly mention "attestations: write" as the missing
33
+ scope, making the root cause difficult to identify.
34
+
35
+ Common mistake: developers copy the attest-build-provenance action from
36
+ documentation examples or third-party tutorials that may not include the full
37
+ permissions block, or they use a minimal permissions block that covers other
38
+ needs (contents: read, packages: write) without adding attestations: write.
39
+
40
+ Organization policy note: if the organization has disabled the attestations
41
+ feature, even a correctly-permissioned workflow will fail. Check org-level
42
+ Actions settings under Settings > Actions > General.
43
+ fix: |
44
+ Add attestations: write to the permissions block of the job (or workflow)
45
+ that runs actions/attest-build-provenance. If using OIDC for cloud auth,
46
+ id-token: write is also required for the attestation signature.
47
+ fix_code:
48
+ - language: yaml
49
+ label: 'Add attestations: write to job permissions'
50
+ code: |
51
+ jobs:
52
+ build:
53
+ runs-on: ubuntu-latest
54
+ permissions:
55
+ contents: read
56
+ attestations: write # Required for attest-build-provenance
57
+ id-token: write # Required for OIDC-based attestation signing
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+
61
+ - name: Build artifact
62
+ run: make build
63
+
64
+ - uses: actions/attest-build-provenance@v2
65
+ with:
66
+ subject-path: dist/my-artifact
67
+ - language: yaml
68
+ label: 'Container registry publish with attestation'
69
+ code: |
70
+ jobs:
71
+ publish:
72
+ runs-on: ubuntu-latest
73
+ permissions:
74
+ contents: read
75
+ packages: write
76
+ attestations: write # Required
77
+ id-token: write # Required
78
+ steps:
79
+ - uses: actions/checkout@v4
80
+ - uses: docker/build-push-action@v6
81
+ id: push
82
+ with:
83
+ push: true
84
+ tags: ghcr.io/${{ github.repository }}:latest
85
+ - uses: actions/attest-build-provenance@v2
86
+ with:
87
+ subject-name: ghcr.io/${{ github.repository }}
88
+ subject-digest: ${{ steps.push.outputs.digest }}
89
+ prevention:
90
+ - 'Always include both attestations: write and id-token: write when using attest-build-provenance'
91
+ - 'Check action release notes when adding actions that use newer GitHub platform features'
92
+ - 'The missing scope is not always named in 403 error messages — cross-reference the action docs for required permissions'
93
+ - 'Enable required_workflows or org-level policies to verify attestation is permitted before deploying'
94
+ docs:
95
+ - url: 'https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds'
96
+ label: 'GitHub Docs — Using artifact attestations to establish provenance'
97
+ - url: 'https://github.com/actions/attest-build-provenance'
98
+ label: 'actions/attest-build-provenance repository'
99
+ - url: 'https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token'
100
+ label: 'GitHub Docs — Controlling permissions for GITHUB_TOKEN'
@@ -0,0 +1,107 @@
1
+ id: runner-environment-099
2
+ title: "setup-python python-version '3' resolves to Python 3.13 — distutils and other removed modules cause ImportError"
3
+ category: runner-environment
4
+ severity: error
5
+ tags:
6
+ - setup-python
7
+ - python-3-13
8
+ - distutils
9
+ - breaking-change
10
+ - version-pinning
11
+ patterns:
12
+ - regex: 'ModuleNotFoundError.*distutils'
13
+ flags: 'i'
14
+ - regex: 'No module named .distutils.'
15
+ flags: 'i'
16
+ - regex: 'ImportError.*distutils'
17
+ flags: 'i'
18
+ error_messages:
19
+ - "ModuleNotFoundError: No module named 'distutils'"
20
+ - "No module named 'distutils'"
21
+ - "error: can't find distutils"
22
+ root_cause: |
23
+ Python 3.12 moved distutils into setuptools (no longer stdlib), and Python 3.13
24
+ fully removed it from the standard library (PEP 632, deprecated since 3.10).
25
+
26
+ GitHub Actions workflows using a floating python-version constraint:
27
+ python-version: '3'
28
+ python-version: '3.x'
29
+ python-version: 'latest'
30
+ ...resolved to Python 3.13 when it became the latest stable release (October 2024).
31
+ Runner images updated to include 3.13 as the available version for these constraints.
32
+
33
+ Any project that imports distutils directly (setup.py, older NumPy, Cython, some
34
+ SWIG bindings) or tools that internally import it will fail with:
35
+ ModuleNotFoundError: No module named 'distutils'
36
+
37
+ Additional modules removed in Python 3.12-3.13 that break CI:
38
+ - cgi, imghdr (removed 3.13)
39
+ - aifc, sunau, chunk, crypt (removed 3.13)
40
+ - imp module (removed 3.12)
41
+ - asynchat, asyncore (removed 3.12)
42
+
43
+ The failure is from the floating version constraint resolving higher than intended,
44
+ not from the runner image itself. Pinned workflows on 3.11 or 3.12 are unaffected.
45
+ fix: |
46
+ Pin python-version to a specific minor version instead of using a floating
47
+ constraint. If distutils is required, use the setuptools-provided shim.
48
+
49
+ Migration options for distutils usage:
50
+ - Replace distutils.core.setup with setuptools.setup
51
+ - Replace distutils.util.strtobool with a custom bool parser
52
+ - Replace distutils.version.LooseVersion with packaging.version.Version
53
+ - Install setuptools on Python 3.13 to restore the distutils shim
54
+ fix_code:
55
+ - language: yaml
56
+ label: 'Pin to specific minor version to avoid 3.13+ resolution'
57
+ code: |
58
+ - uses: actions/setup-python@v5
59
+ with:
60
+ python-version: '3.11' # Pinned — won't resolve to 3.13+
61
+ # OR: '3.12' (distutils still available via setuptools shim)
62
+ - language: yaml
63
+ label: 'Use setuptools shim on Python 3.13'
64
+ code: |
65
+ - uses: actions/setup-python@v5
66
+ with:
67
+ python-version: '3.13'
68
+ - name: Install setuptools for distutils compatibility
69
+ run: pip install setuptools # Restores distutils shim on 3.13+
70
+ - language: yaml
71
+ label: 'Pin version via .python-version file'
72
+ code: |
73
+ # .python-version file in repo root:
74
+ # 3.11.9
75
+
76
+ - uses: actions/setup-python@v5
77
+ with:
78
+ python-version-file: '.python-version' # Reads from repo file
79
+ - language: yaml
80
+ label: 'Matrix across versions to catch breakage early'
81
+ code: |
82
+ jobs:
83
+ test:
84
+ strategy:
85
+ matrix:
86
+ python-version: ['3.11', '3.12', '3.13']
87
+ steps:
88
+ - uses: actions/setup-python@v5
89
+ with:
90
+ python-version: ${{ matrix.python-version }}
91
+ - run: pip install setuptools # Shim for 3.13
92
+ - run: pip install -e .
93
+ - run: pytest
94
+ prevention:
95
+ - 'Never use python-version: 3 or python-version: 3.x in production workflows without testing each new minor release'
96
+ - 'Pin to a specific minor version (3.11, 3.12) or use a .python-version file in the repo'
97
+ - 'Run CI on a matrix of python versions to catch version-specific breakage early'
98
+ - 'Audit setup.py for direct distutils imports and replace with setuptools equivalents before upgrading to 3.13'
99
+ docs:
100
+ - url: 'https://docs.python.org/3/whatsnew/3.13.html#removed-modules'
101
+ label: 'Python 3.13 — Removed Modules'
102
+ - url: 'https://peps.python.org/pep-0632/'
103
+ label: 'PEP 632 — Deprecate distutils'
104
+ - url: 'https://github.com/actions/setup-python'
105
+ label: 'actions/setup-python repository'
106
+ - url: 'https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-python'
107
+ label: 'GitHub Docs — Building and testing Python'
@@ -0,0 +1,83 @@
1
+ id: silent-failures-049
2
+ title: 'GITHUB_OUTPUT multiline heredoc value silently truncated when content contains the delimiter string'
3
+ category: silent-failures
4
+ severity: silent-failure
5
+ tags:
6
+ - GITHUB_OUTPUT
7
+ - multiline
8
+ - heredoc
9
+ - delimiter-collision
10
+ - environment-files
11
+ patterns:
12
+ - regex: 'echo\s+\"\w+<<EOF\"'
13
+ flags: 'i'
14
+ error_messages: []
15
+ root_cause: |
16
+ GitHub Actions environment files (GITHUB_OUTPUT, GITHUB_ENV, GITHUB_STEP_SUMMARY)
17
+ use a heredoc-style syntax for multiline values:
18
+
19
+ echo "BODY<<EOF" >> $GITHUB_OUTPUT
20
+ echo "first line" >> $GITHUB_OUTPUT
21
+ echo "second line" >> $GITHUB_OUTPUT
22
+ echo "EOF" >> $GITHUB_OUTPUT
23
+
24
+ If the multiline content itself contains the exact delimiter string ("EOF" in
25
+ the example above) on a line by itself, the runner stops reading at that point
26
+ and silently truncates the value. No error is raised and the step exits 0.
27
+
28
+ Common scenarios:
29
+ 1. A release body or commit message that happens to contain "EOF" on its own line.
30
+ 2. A generated file that includes shell script snippets (which often use EOF).
31
+ 3. A changelog that uses EOF as a delimiter in a code example.
32
+
33
+ The delimiter collision causes the output variable to contain only the content
34
+ up to (but not including) the first occurrence of the delimiter string, with
35
+ no indication that truncation occurred.
36
+ fix: |
37
+ Use a randomly-generated or sufficiently unique delimiter that will not
38
+ appear in the content. Common approaches:
39
+
40
+ 1. Generate a UUID or random hex string at runtime and use it as the delimiter.
41
+ 2. Use a very long, unusual string that is unlikely to appear in content.
42
+
43
+ The GitHub documentation explicitly recommends a random delimiter to avoid
44
+ this collision:
45
+ https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#multiline-strings
46
+ fix_code:
47
+ - language: yaml
48
+ label: 'Unsafe — static delimiter may collide with content'
49
+ code: |
50
+ - name: Set multiline output (unsafe)
51
+ run: |
52
+ echo "BODY<<EOF" >> $GITHUB_OUTPUT
53
+ echo "${{ steps.notes.outputs.content }}" >> $GITHUB_OUTPUT
54
+ echo "EOF" >> $GITHUB_OUTPUT
55
+ - language: yaml
56
+ label: 'Safe — random delimiter prevents collision'
57
+ code: |
58
+ - name: Set multiline output (safe random delimiter)
59
+ run: |
60
+ DELIM="ghadelim_$(head -c 16 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | head -c 16)"
61
+ echo "BODY<<${DELIM}" >> $GITHUB_OUTPUT
62
+ echo "${{ steps.notes.outputs.content }}" >> $GITHUB_OUTPUT
63
+ echo "${DELIM}" >> $GITHUB_OUTPUT
64
+ - language: yaml
65
+ label: 'Windows — PowerShell random delimiter'
66
+ code: |
67
+ - name: Set multiline output (PowerShell)
68
+ shell: pwsh
69
+ run: |
70
+ $delim = "ghadelim_$([System.Guid]::NewGuid().ToString('N').Substring(0, 16))"
71
+ "BODY<<$delim" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
72
+ $releaseNotes | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
73
+ $delim | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
74
+ prevention:
75
+ - 'Never use a simple static delimiter like EOF, END, or DONE for multiline GITHUB_OUTPUT values'
76
+ - 'Always use a random or UUID-based delimiter when the content could be dynamic or user-provided'
77
+ - 'Test multiline output steps with content that deliberately contains common delimiter strings'
78
+ - 'GitHub docs recommend randomly generated delimiters for all multiline environment file writes'
79
+ docs:
80
+ - url: 'https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#multiline-strings'
81
+ label: 'GitHub Docs — Workflow commands: multiline strings'
82
+ - url: 'https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables'
83
+ label: 'GitHub Docs — Store information in variables'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htekdev/actions-debugger",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
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",