@htekdev/actions-debugger 1.0.124 → 1.0.125
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/caching-artifacts/caching-artifacts-073.yml +100 -0
- package/errors/caching-artifacts/caching-artifacts-074.yml +117 -0
- package/errors/known-unsolved/known-unsolved-071.yml +122 -0
- package/errors/known-unsolved/known-unsolved-072.yml +143 -0
- package/errors/permissions-auth/permissions-auth-071.yml +144 -0
- package/errors/permissions-auth/permissions-auth-072.yml +112 -0
- package/errors/permissions-auth/permissions-auth-073.yml +127 -0
- package/errors/permissions-auth/permissions-auth-074.yml +106 -0
- package/errors/permissions-auth/permissions-auth-075.yml +137 -0
- package/errors/runner-environment/runner-environment-227.yml +106 -0
- package/errors/runner-environment/runner-environment-228.yml +117 -0
- package/errors/runner-environment/runner-environment-229.yml +119 -0
- package/errors/runner-environment/runner-environment-230.yml +129 -0
- package/errors/runner-environment/runner-environment-231.yml +90 -0
- package/errors/runner-environment/runner-environment-232.yml +131 -0
- package/errors/runner-environment/runner-environment-233.yml +90 -0
- package/errors/runner-environment/runner-environment-234.yml +114 -0
- package/errors/runner-environment/runner-environment-235.yml +151 -0
- package/errors/silent-failures/silent-failures-112.yml +97 -0
- package/errors/silent-failures/silent-failures-113.yml +110 -0
- package/errors/silent-failures/silent-failures-114.yml +116 -0
- package/errors/silent-failures/silent-failures-115.yml +130 -0
- package/errors/silent-failures/silent-failures-116.yml +117 -0
- package/errors/silent-failures/silent-failures-117.yml +137 -0
- package/errors/silent-failures/silent-failures-118.yml +156 -0
- package/errors/yaml-syntax/yaml-syntax-075.yml +128 -0
- package/errors/yaml-syntax/yaml-syntax-076.yml +107 -0
- package/package.json +1 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
id: yaml-syntax-075
|
|
2
|
+
title: 'environment: shorthand string format silently rejects needs.* and jobs.* contexts — use environment.name form'
|
|
3
|
+
category: yaml-syntax
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- environment
|
|
7
|
+
- dynamic-environment
|
|
8
|
+
- needs-context
|
|
9
|
+
- expression
|
|
10
|
+
- shorthand
|
|
11
|
+
- template-validation
|
|
12
|
+
patterns:
|
|
13
|
+
- regex: 'Unrecognized named-value.*needs.*environment'
|
|
14
|
+
flags: 'i'
|
|
15
|
+
- regex: "Unrecognized named-value: 'needs'.*position.*expression.*needs\\."
|
|
16
|
+
flags: 'i'
|
|
17
|
+
- regex: 'TemplateValidationException.*Unrecognized named-value.*needs'
|
|
18
|
+
flags: 'i'
|
|
19
|
+
error_messages:
|
|
20
|
+
- "The workflow is not valid. .github/workflows/deploy.yml (Line: 15, Col: 18): Unrecognized named-value: 'needs'. Located at position 1 within expression: needs.set_environment.outputs.my_env"
|
|
21
|
+
- "Unrecognized named-value: 'needs'. Located at position 1 within expression: needs.X.outputs.env"
|
|
22
|
+
root_cause: |
|
|
23
|
+
The GitHub Actions workflow parser supports two forms for specifying a job environment:
|
|
24
|
+
|
|
25
|
+
1. Shorthand string: `environment: production` or `environment: ${{ some.expression }}`
|
|
26
|
+
2. Explicit mapping: `environment:\n name: ${{ expression }}\n url: ${{ expression }}`
|
|
27
|
+
|
|
28
|
+
The shorthand string form (`environment: ${{ ... }}`) supports only a limited expression
|
|
29
|
+
context and does NOT support the `needs.*` or `jobs.*` contexts, even when the job
|
|
30
|
+
has `needs:` declared. Attempting to use `needs.X.outputs.Y` inside the shorthand
|
|
31
|
+
produces a TemplateValidationException at workflow parse time:
|
|
32
|
+
|
|
33
|
+
"Unrecognized named-value: 'needs'. Located at position 1 within expression: needs.X.outputs.Y"
|
|
34
|
+
|
|
35
|
+
The explicit mapping form (`environment:\n name: ${{ ... }}`) DOES support the `needs.*`
|
|
36
|
+
context fully — this is the documented way to set a dynamic environment name or URL.
|
|
37
|
+
|
|
38
|
+
This trips up developers who:
|
|
39
|
+
- Copy the shorthand form from documentation examples and add an expression.
|
|
40
|
+
- Want to choose between staging/production environments based on the branch output
|
|
41
|
+
of an earlier job.
|
|
42
|
+
- Try to set a dynamic environment URL using `needs.deploy.outputs.url`.
|
|
43
|
+
|
|
44
|
+
The error appears only at workflow validation time (not at job runtime), which means
|
|
45
|
+
the entire workflow is rejected before any jobs run.
|
|
46
|
+
fix: |
|
|
47
|
+
Use the explicit `environment:` mapping format with `name:` and optionally `url:` sub-keys
|
|
48
|
+
instead of the shorthand string with a `${{ }}` expression.
|
|
49
|
+
|
|
50
|
+
The shorthand `environment: ${{ expression }}` is only for literal strings or simple
|
|
51
|
+
expressions without `needs.*` / `jobs.*`. Once you need cross-job outputs, switch to
|
|
52
|
+
the explicit form.
|
|
53
|
+
fix_code:
|
|
54
|
+
- language: yaml
|
|
55
|
+
label: 'Broken — shorthand with needs.* context causes TemplateValidationException'
|
|
56
|
+
code: |
|
|
57
|
+
jobs:
|
|
58
|
+
determine-env:
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
outputs:
|
|
61
|
+
target: ${{ steps.pick.outputs.env }}
|
|
62
|
+
steps:
|
|
63
|
+
- id: pick
|
|
64
|
+
run: echo "env=production" >> $GITHUB_OUTPUT
|
|
65
|
+
|
|
66
|
+
deploy:
|
|
67
|
+
needs: determine-env
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
# ❌ BROKEN: shorthand does not support needs.* context
|
|
70
|
+
environment: ${{ needs.determine-env.outputs.target }}
|
|
71
|
+
steps:
|
|
72
|
+
- run: echo "deploying"
|
|
73
|
+
|
|
74
|
+
- language: yaml
|
|
75
|
+
label: 'Fixed — explicit environment.name form supports needs.* context'
|
|
76
|
+
code: |
|
|
77
|
+
jobs:
|
|
78
|
+
determine-env:
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
outputs:
|
|
81
|
+
target: ${{ steps.pick.outputs.env }}
|
|
82
|
+
steps:
|
|
83
|
+
- id: pick
|
|
84
|
+
run: |
|
|
85
|
+
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
|
86
|
+
echo "env=production" >> $GITHUB_OUTPUT
|
|
87
|
+
else
|
|
88
|
+
echo "env=staging" >> $GITHUB_OUTPUT
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
deploy:
|
|
92
|
+
needs: determine-env
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
# ✅ FIXED: explicit name: sub-key supports needs.* context
|
|
95
|
+
environment:
|
|
96
|
+
name: ${{ needs.determine-env.outputs.target }}
|
|
97
|
+
url: ${{ needs.deploy.outputs.deploy_url }}
|
|
98
|
+
steps:
|
|
99
|
+
- run: echo "deploying to ${{ needs.determine-env.outputs.target }}"
|
|
100
|
+
|
|
101
|
+
- language: yaml
|
|
102
|
+
label: 'Dynamic environment from workflow_dispatch input — correct form'
|
|
103
|
+
code: |
|
|
104
|
+
on:
|
|
105
|
+
workflow_dispatch:
|
|
106
|
+
inputs:
|
|
107
|
+
environment:
|
|
108
|
+
required: true
|
|
109
|
+
type: environment
|
|
110
|
+
jobs:
|
|
111
|
+
deploy:
|
|
112
|
+
runs-on: ubuntu-latest
|
|
113
|
+
# ✅ Use explicit name: when referencing inputs.* or needs.* contexts
|
|
114
|
+
environment:
|
|
115
|
+
name: ${{ inputs.environment }}
|
|
116
|
+
steps:
|
|
117
|
+
- run: echo "deploying to ${{ inputs.environment }}"
|
|
118
|
+
prevention:
|
|
119
|
+
- 'Always use the `environment:\n name: ${{ }}` form (never the shorthand string) when the environment name is dynamic or derived from another job.'
|
|
120
|
+
- 'Remember: `environment: ${{ expression }}` is valid syntax but only for literal strings — it silently ignores `needs.*` context at parse time, producing a hard error.'
|
|
121
|
+
- 'Lint with actionlint (v1.7.0+) which detects this pattern before pushing.'
|
|
122
|
+
docs:
|
|
123
|
+
- url: 'https://github.com/actions/runner/issues/998'
|
|
124
|
+
label: 'actions/runner#998 — Setting job environment dynamically fails with needs context in shorthand form'
|
|
125
|
+
- url: 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idenvironment'
|
|
126
|
+
label: 'GitHub Docs — jobs.<job_id>.environment syntax reference'
|
|
127
|
+
- url: 'https://stackoverflow.com/questions/65826284/use-dynamic-input-value-for-environment-in-github-actions-workflow-job'
|
|
128
|
+
label: 'Stack Overflow — Dynamic environment in GitHub Actions workflow job (many upvotes)'
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
id: yaml-syntax-076
|
|
2
|
+
title: 'actionlint <=1.7.7 rejects valid `entrypoint` and `command` keys on service containers — schema lag after April 2026 GitHub changelog'
|
|
3
|
+
category: yaml-syntax
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- actionlint
|
|
7
|
+
- service-container
|
|
8
|
+
- entrypoint
|
|
9
|
+
- command
|
|
10
|
+
- schema-lag
|
|
11
|
+
- linting
|
|
12
|
+
- CI-check
|
|
13
|
+
patterns:
|
|
14
|
+
- regex: 'unexpected key "entrypoint" for "services" section'
|
|
15
|
+
flags: 'i'
|
|
16
|
+
- regex: 'unexpected key "command" for "services" section'
|
|
17
|
+
flags: 'i'
|
|
18
|
+
- regex: 'unexpected key "(?:entrypoint|command)" for "services" section\. expected one of "credentials", "env", "image", "options", "ports", "volumes"'
|
|
19
|
+
flags: 'i'
|
|
20
|
+
error_messages:
|
|
21
|
+
- '.github/workflows/test.yaml:9:9: unexpected key "entrypoint" for "services" section. expected one of "credentials", "env", "image", "options", "ports", "volumes" [syntax-check]'
|
|
22
|
+
- '.github/workflows/test.yaml:10:9: unexpected key "command" for "services" section. expected one of "credentials", "env", "image", "options", "ports", "volumes" [syntax-check]'
|
|
23
|
+
root_cause: |
|
|
24
|
+
GitHub Actions added support for `entrypoint` and `command` keys on service container
|
|
25
|
+
definitions on April 2, 2026 (GitHub Actions: Early April 2026 updates changelog). These
|
|
26
|
+
new keys allow overriding the service container's default entrypoint and command directly from
|
|
27
|
+
workflow YAML, matching Docker Compose semantics:
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
services:
|
|
31
|
+
redis:
|
|
32
|
+
image: redis
|
|
33
|
+
entrypoint: redis-server
|
|
34
|
+
command: --save 60 1 --loglevel warning
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
actionlint versions <=1.7.7 validate service container keys against a hardcoded schema that
|
|
38
|
+
only permits `credentials`, `env`, `image`, `options`, `ports`, and `volumes`. When a workflow
|
|
39
|
+
uses the new `entrypoint` or `command` keys, actionlint reports them as unknown properties with
|
|
40
|
+
a `[syntax-check]` error.
|
|
41
|
+
|
|
42
|
+
This causes CI pipelines that run actionlint as a lint check to fail even though the workflow
|
|
43
|
+
is perfectly valid on GitHub.com. The fix was merged into actionlint on April 19, 2026 and
|
|
44
|
+
released in v1.7.8.
|
|
45
|
+
|
|
46
|
+
This is a schema-lag pattern: a new GitHub Actions feature was released before the static
|
|
47
|
+
analysis tool's schema was updated to recognize it, causing a false-positive lint failure.
|
|
48
|
+
fix: |
|
|
49
|
+
**Primary fix: Upgrade actionlint to >=1.7.8.**
|
|
50
|
+
The fix was merged April 19, 2026 (rhysd/actionlint#644). Update your CI pipeline to use
|
|
51
|
+
actionlint >=1.7.8:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
- name: Run actionlint
|
|
55
|
+
uses: raven-actions/actionlint@v2
|
|
56
|
+
with:
|
|
57
|
+
version: latest # or pin to 1.7.8+
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Temporary workaround (if upgrading is not immediately possible):** Add an inline ignore
|
|
61
|
+
comment to suppress the false-positive while on the older actionlint version:
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
services:
|
|
65
|
+
redis:
|
|
66
|
+
image: redis
|
|
67
|
+
entrypoint: redis-server # actionlint:ignore
|
|
68
|
+
command: --save 60 1 # actionlint:ignore
|
|
69
|
+
```
|
|
70
|
+
fix_code:
|
|
71
|
+
- language: yaml
|
|
72
|
+
label: 'Upgrade actionlint in CI to >=1.7.8 to recognize entrypoint/command service keys'
|
|
73
|
+
code: |
|
|
74
|
+
- name: Run actionlint
|
|
75
|
+
uses: raven-actions/actionlint@v2
|
|
76
|
+
with:
|
|
77
|
+
version: 1.7.8 # Minimum version that supports entrypoint/command on service containers
|
|
78
|
+
- language: yaml
|
|
79
|
+
label: 'Valid service container workflow using new entrypoint/command keys (GitHub Actions only)'
|
|
80
|
+
code: |
|
|
81
|
+
jobs:
|
|
82
|
+
test:
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
services:
|
|
85
|
+
redis:
|
|
86
|
+
image: redis:7
|
|
87
|
+
# These keys are valid on GitHub Actions (GA April 2, 2026)
|
|
88
|
+
# but require actionlint >=1.7.8 for linting to pass
|
|
89
|
+
entrypoint: redis-server
|
|
90
|
+
command: --save 60 1 --loglevel warning
|
|
91
|
+
ports:
|
|
92
|
+
- 6379:6379
|
|
93
|
+
steps:
|
|
94
|
+
- uses: actions/checkout@v4
|
|
95
|
+
- name: Run tests
|
|
96
|
+
run: npm test
|
|
97
|
+
prevention:
|
|
98
|
+
- 'Pin actionlint to a specific version in CI and include it in your Dependabot or Renovate configuration so schema updates are picked up promptly when new GitHub Actions features are released.'
|
|
99
|
+
- 'When a new GitHub Actions feature ships, check the actionlint changelog (https://github.com/rhysd/actionlint/releases) for schema support before using the feature in linted workflows.'
|
|
100
|
+
- 'Use `# actionlint:ignore` comment as a short-term workaround for valid-but-unknown-to-linter keys while waiting for the schema update.'
|
|
101
|
+
docs:
|
|
102
|
+
- url: 'https://github.com/rhysd/actionlint/issues/644'
|
|
103
|
+
label: 'rhysd/actionlint#644 — Add support for entrypoint and command for service containers (fixed in v1.7.8)'
|
|
104
|
+
- url: 'https://github.blog/changelog/2026-04-02-github-actions-early-april-2026-updates/'
|
|
105
|
+
label: 'GitHub Changelog — April 2026 updates: entrypoint and command overrides for service containers'
|
|
106
|
+
- url: 'https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idservicesservice_identrypoint'
|
|
107
|
+
label: 'GitHub Docs — Workflow syntax: jobs.<job_id>.services.<service_id>.entrypoint'
|
package/package.json
CHANGED