@htekdev/actions-debugger 1.0.92 → 1.0.94
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/permissions-auth/github-models-missing-models-read-permission.yml +115 -0
- package/errors/runner-environment/macos-xcrun-simctl-no-developer-tools.yml +84 -0
- package/errors/runner-environment/node-22-openssl-legacy-provider-removed.yml +96 -0
- package/errors/runner-environment/setup-go-gotoolchain-auto-download.yml +122 -0
- package/errors/runner-environment/setup-java-temurin-java8-arm64-not-available.yml +93 -0
- package/errors/runner-environment/ubuntu-tzdata-apt-hang-noninteractive-required.yml +84 -0
- package/errors/triggers/deployment-status-all-types-default.yml +123 -0
- package/errors/yaml-syntax/workflow-call-boolean-input-default-string.yml +122 -0
- package/package.json +1 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
id: permissions-auth-052
|
|
2
|
+
title: 'GitHub Models API in Actions requires models: read permission — not in default GITHUB_TOKEN scopes'
|
|
3
|
+
category: permissions-auth
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- models
|
|
7
|
+
- github-models
|
|
8
|
+
- ai
|
|
9
|
+
- permissions
|
|
10
|
+
- GITHUB_TOKEN
|
|
11
|
+
- 403
|
|
12
|
+
- inference
|
|
13
|
+
patterns:
|
|
14
|
+
- regex: 'models:\s*read'
|
|
15
|
+
flags: 'i'
|
|
16
|
+
- regex: 'Resource not accessible by integration.*model'
|
|
17
|
+
flags: 'i'
|
|
18
|
+
- regex: 'models.*permission.*required|permission.*models.*required'
|
|
19
|
+
flags: 'i'
|
|
20
|
+
- regex: '403.*github\.com/models|github\.com/models.*403'
|
|
21
|
+
flags: 'i'
|
|
22
|
+
error_messages:
|
|
23
|
+
- 'Error: Resource not accessible by integration'
|
|
24
|
+
- '403 Forbidden — models: read permission is required'
|
|
25
|
+
- 'HttpError: 403 Resource not accessible by integration'
|
|
26
|
+
- 'Error: The models permission is required to use the GitHub Models API'
|
|
27
|
+
root_cause: |
|
|
28
|
+
GitHub Models (launched in 2024) provides access to AI inference models (GPT-4o,
|
|
29
|
+
Claude, Llama, etc.) via the GitHub Models API at https://models.inference.ai.azure.com
|
|
30
|
+
and via the GitHub REST API at api.github.com/models. When workflows use these
|
|
31
|
+
endpoints with the GITHUB_TOKEN (for example, via `actions/ai-inference` or via
|
|
32
|
+
`actions/github-script` calling `github.rest.models.*`), the token must have the
|
|
33
|
+
`models: read` permission explicitly declared.
|
|
34
|
+
|
|
35
|
+
The `models: read` permission was introduced as a new GITHUB_TOKEN scope alongside
|
|
36
|
+
the GitHub Models feature. It is NOT included in the default GITHUB_TOKEN permissions
|
|
37
|
+
and is NOT implied by any other existing permission (not `contents: read`, not
|
|
38
|
+
`packages: read`, not `id-token: write`).
|
|
39
|
+
|
|
40
|
+
Common failure patterns:
|
|
41
|
+
1. Adding an AI inference step or action to an existing workflow that has a
|
|
42
|
+
permissions: block — the block narrows all unspecified permissions to none,
|
|
43
|
+
and models: read was never added.
|
|
44
|
+
2. Using GitHub Models for the first time in a workflow that relies on the
|
|
45
|
+
repository's default "Read and write" permissions — models: read is not
|
|
46
|
+
included even in the broadest default permission set.
|
|
47
|
+
3. Reusable workflow callers that use `secrets: inherit` but do NOT pass through
|
|
48
|
+
permissions — the called workflow must declare its own `models: read`.
|
|
49
|
+
4. Fine-grained PATs used as a token override: the PAT must have the "Models: read"
|
|
50
|
+
resource permission enabled for the target repository or organization.
|
|
51
|
+
|
|
52
|
+
The error message "Resource not accessible by integration" is the same 403 error
|
|
53
|
+
used for other missing permissions, making it hard to identify models: read as the
|
|
54
|
+
specific missing scope without checking the API response body.
|
|
55
|
+
fix: |
|
|
56
|
+
Add `models: read` to the `permissions:` block of the job (or workflow) that calls
|
|
57
|
+
the GitHub Models API. If using a fine-grained PAT instead of GITHUB_TOKEN, ensure
|
|
58
|
+
the PAT has the "Models" permission enabled.
|
|
59
|
+
fix_code:
|
|
60
|
+
- language: yaml
|
|
61
|
+
label: 'Add models: read to job permissions for AI inference steps'
|
|
62
|
+
code: |
|
|
63
|
+
jobs:
|
|
64
|
+
ai-analysis:
|
|
65
|
+
runs-on: ubuntu-latest
|
|
66
|
+
permissions:
|
|
67
|
+
contents: read
|
|
68
|
+
models: read # Required for GitHub Models API access
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
- name: Run AI inference via GitHub Models
|
|
72
|
+
uses: actions/ai-inference@v1
|
|
73
|
+
with:
|
|
74
|
+
model: openai/gpt-4o
|
|
75
|
+
system-prompt: 'You are a code reviewer. Be concise.'
|
|
76
|
+
user-prompt: 'Review the changes in this PR for security issues.'
|
|
77
|
+
- language: yaml
|
|
78
|
+
label: 'Workflow with multiple permissions including models: read'
|
|
79
|
+
code: |
|
|
80
|
+
on:
|
|
81
|
+
pull_request:
|
|
82
|
+
|
|
83
|
+
permissions:
|
|
84
|
+
contents: read
|
|
85
|
+
pull-requests: write
|
|
86
|
+
models: read # Required for any AI model inference step
|
|
87
|
+
|
|
88
|
+
jobs:
|
|
89
|
+
review:
|
|
90
|
+
runs-on: ubuntu-latest
|
|
91
|
+
steps:
|
|
92
|
+
- uses: actions/checkout@v4
|
|
93
|
+
- name: AI code review
|
|
94
|
+
uses: actions/github-script@v7
|
|
95
|
+
with:
|
|
96
|
+
script: |
|
|
97
|
+
// github.rest.models requires models: read permission
|
|
98
|
+
const response = await github.request('POST /repos/{owner}/{repo}/actions/generate-summary', {
|
|
99
|
+
owner: context.repo.owner,
|
|
100
|
+
repo: context.repo.repo
|
|
101
|
+
});
|
|
102
|
+
prevention:
|
|
103
|
+
- "Always add `models: read` to the permissions block when using GitHub Models API, AI inference actions, or any `github.rest.models.*` API calls"
|
|
104
|
+
- "The `models: read` scope is not inherited, implied, or included in any default permission set — it must be declared explicitly"
|
|
105
|
+
- "When upgrading a workflow to add AI features, audit the existing permissions: block and add models: read before deploying"
|
|
106
|
+
- "Fine-grained PATs used as token overrides must explicitly include the Models permission for the relevant repositories"
|
|
107
|
+
docs:
|
|
108
|
+
- url: 'https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token'
|
|
109
|
+
label: 'GitHub Docs: Controlling permissions for GITHUB_TOKEN — available scopes'
|
|
110
|
+
- url: 'https://docs.github.com/en/github-models/use-github-models/integrating-ai-models-into-your-application'
|
|
111
|
+
label: 'GitHub Docs: Using GitHub Models — authentication and permissions'
|
|
112
|
+
- url: 'https://github.com/actions/ai-inference'
|
|
113
|
+
label: 'actions/ai-inference — GitHub Models inference action'
|
|
114
|
+
- url: 'https://github.com/marketplace/actions/ai-inference'
|
|
115
|
+
label: 'GitHub Marketplace: AI Inference action'
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
id: runner-environment-161
|
|
2
|
+
title: 'macOS ARM64 runners: xcrun simctl fails — Xcode developer tools not selected'
|
|
3
|
+
category: runner-environment
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- macos
|
|
7
|
+
- xcrun
|
|
8
|
+
- simctl
|
|
9
|
+
- xcode
|
|
10
|
+
- ios
|
|
11
|
+
- arm64
|
|
12
|
+
- xcode-select
|
|
13
|
+
- macos-14
|
|
14
|
+
- macos-15
|
|
15
|
+
patterns:
|
|
16
|
+
- regex: 'xcrun: error: unable to find utility "simctl"'
|
|
17
|
+
flags: 'i'
|
|
18
|
+
- regex: 'xcode-select.*tool.*requires Xcode'
|
|
19
|
+
flags: 'i'
|
|
20
|
+
- regex: 'active developer directory.*command line tools instance'
|
|
21
|
+
flags: 'i'
|
|
22
|
+
- regex: 'xcode-select: note: No developer tools were found'
|
|
23
|
+
flags: 'i'
|
|
24
|
+
error_messages:
|
|
25
|
+
- 'xcrun: error: unable to find utility "simctl", not a developer tool or in PATH'
|
|
26
|
+
- 'xcode-select: error: tool ''xcodebuild'' requires Xcode, but active developer directory ''/Library/Developer/CommandLineTools'' is a command line tools instance'
|
|
27
|
+
- 'xcode-select: note: No developer tools were found, requesting install'
|
|
28
|
+
root_cause: |
|
|
29
|
+
macOS 14 (macos-14) and macOS 15 (macos-15) GitHub-hosted runners include
|
|
30
|
+
multiple Xcode versions and also have Xcode Command Line Tools installed. When
|
|
31
|
+
the active developer directory is set to the Command Line Tools path
|
|
32
|
+
(/Library/Developer/CommandLineTools) rather than a full Xcode.app installation,
|
|
33
|
+
tools that require full Xcode — xcrun simctl, xcodebuild, instruments, codesign,
|
|
34
|
+
and others — fail with "unable to find utility" or "requires Xcode" errors.
|
|
35
|
+
|
|
36
|
+
The runners have a default Xcode selected at image creation time, but this can
|
|
37
|
+
be changed or reset by steps earlier in the workflow (e.g., a Homebrew install
|
|
38
|
+
that runs xcode-select internally). iOS simulator builds on the ARM64 macos-14
|
|
39
|
+
and macos-15 runners are the most common trigger because simctl is exclusively
|
|
40
|
+
a full Xcode tool with no Command Line Tools counterpart.
|
|
41
|
+
fix: |
|
|
42
|
+
Explicitly select a full Xcode version using xcode-select or DEVELOPER_DIR at
|
|
43
|
+
the start of the workflow. List available Xcode versions with
|
|
44
|
+
ls /Applications/Xcode*.app to find what is pre-installed on the runner.
|
|
45
|
+
fix_code:
|
|
46
|
+
- language: yaml
|
|
47
|
+
label: 'Explicitly select Xcode at workflow start'
|
|
48
|
+
code: |
|
|
49
|
+
- name: Select Xcode version
|
|
50
|
+
run: |
|
|
51
|
+
sudo xcode-select -s /Applications/Xcode_16.2.app
|
|
52
|
+
xcode-select --print-path
|
|
53
|
+
- language: yaml
|
|
54
|
+
label: 'Use DEVELOPER_DIR env var for all Xcode steps'
|
|
55
|
+
code: |
|
|
56
|
+
jobs:
|
|
57
|
+
ios-build:
|
|
58
|
+
runs-on: macos-15
|
|
59
|
+
env:
|
|
60
|
+
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v4
|
|
63
|
+
- name: Build and test
|
|
64
|
+
run: |
|
|
65
|
+
xcrun simctl list devicetypes | head -5
|
|
66
|
+
xcodebuild -scheme MyApp -sdk iphonesimulator build
|
|
67
|
+
- language: yaml
|
|
68
|
+
label: 'List available Xcode versions on the runner'
|
|
69
|
+
code: |
|
|
70
|
+
- name: List Xcode versions
|
|
71
|
+
run: ls /Applications/Xcode*.app
|
|
72
|
+
# Shows all pre-installed Xcode versions to pick the correct path
|
|
73
|
+
prevention:
|
|
74
|
+
- 'Always run xcode-select -p at the start of iOS/macOS workflows to verify the active developer directory'
|
|
75
|
+
- 'Pin the Xcode version explicitly using xcode-select or DEVELOPER_DIR instead of relying on runner defaults'
|
|
76
|
+
- 'Check the runner image README at github.com/actions/runner-images for pre-installed Xcode versions per image'
|
|
77
|
+
- 'Use the setup-xcode community action for simplified Xcode version selection'
|
|
78
|
+
docs:
|
|
79
|
+
- url: 'https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md'
|
|
80
|
+
label: 'macOS 15 runner image README — pre-installed Xcode versions'
|
|
81
|
+
- url: 'https://developer.apple.com/documentation/xcode/selecting-the-xcode-that-tools-will-use'
|
|
82
|
+
label: 'Apple Developer: Selecting the Xcode that tools will use'
|
|
83
|
+
- url: 'https://github.com/actions/runner-images/issues'
|
|
84
|
+
label: 'actions/runner-images GitHub Issues — macOS Xcode selection reports'
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
id: runner-environment-162
|
|
2
|
+
title: 'Node.js 22 removed --openssl-legacy-provider — webpack 4 and Create React App builds fail'
|
|
3
|
+
category: runner-environment
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- nodejs
|
|
7
|
+
- node-22
|
|
8
|
+
- openssl
|
|
9
|
+
- webpack
|
|
10
|
+
- create-react-app
|
|
11
|
+
- lts
|
|
12
|
+
- setup-node
|
|
13
|
+
- openssl-legacy-provider
|
|
14
|
+
patterns:
|
|
15
|
+
- regex: 'ERR_OSSL_UNSUPPORTED'
|
|
16
|
+
flags: 'i'
|
|
17
|
+
- regex: '--openssl-legacy-provider is not allowed in NODE_OPTIONS'
|
|
18
|
+
flags: 'i'
|
|
19
|
+
- regex: 'error:0308010C:digital envelope routines::unsupported'
|
|
20
|
+
flags: 'i'
|
|
21
|
+
- regex: 'opensslErrorStack.*digital envelope routines.*initialization error'
|
|
22
|
+
flags: 'i'
|
|
23
|
+
error_messages:
|
|
24
|
+
- 'Error: error:0308010C:digital envelope routines::unsupported'
|
|
25
|
+
- 'node: --openssl-legacy-provider is not allowed in NODE_OPTIONS'
|
|
26
|
+
- 'opensslErrorStack: [ ''error:03000086:digital envelope routines::initialization error'' ]'
|
|
27
|
+
root_cause: |
|
|
28
|
+
Node.js 22 (LTS since October 2024) completed the removal of the
|
|
29
|
+
--openssl-legacy-provider CLI flag that was first deprecated in Node.js 18.
|
|
30
|
+
When node-version: 'lts/*' or node-version: '22' in setup-node resolves to
|
|
31
|
+
Node.js 22, workflows that build webpack 4 projects, older Create React App
|
|
32
|
+
setups, or any tool using MD4/RC4/legacy OpenSSL algorithms fail with
|
|
33
|
+
ERR_OSSL_UNSUPPORTED.
|
|
34
|
+
|
|
35
|
+
The common Node.js 17/18 workaround of setting
|
|
36
|
+
NODE_OPTIONS=--openssl-legacy-provider now causes a secondary error:
|
|
37
|
+
"--openssl-legacy-provider is not allowed in NODE_OPTIONS" on Node.js 22.
|
|
38
|
+
This double-failure — the original OpenSSL error AND the workaround error —
|
|
39
|
+
makes the root cause difficult to diagnose.
|
|
40
|
+
|
|
41
|
+
This is distinct from runner-environment-111 (setup-node major version upgrade
|
|
42
|
+
breaking engines field). That entry covers package.json engines compatibility;
|
|
43
|
+
this entry covers a specific CLI flag removal at the Node.js runtime level.
|
|
44
|
+
fix: |
|
|
45
|
+
The correct fix is to upgrade webpack to version 5 or migrate the project away
|
|
46
|
+
from Create React App. As a temporary workaround, pin node-version to '20'
|
|
47
|
+
while the webpack upgrade is in progress. Do not use --openssl-legacy-provider
|
|
48
|
+
as it is removed in Node.js 22 and will also error on Node.js 22.
|
|
49
|
+
fix_code:
|
|
50
|
+
- language: yaml
|
|
51
|
+
label: 'Pin to Node.js 20 LTS as temporary workaround'
|
|
52
|
+
code: |
|
|
53
|
+
- name: Setup Node.js
|
|
54
|
+
uses: actions/setup-node@v4
|
|
55
|
+
with:
|
|
56
|
+
node-version: '20' # Pin to Node 20 while upgrading webpack to v5
|
|
57
|
+
cache: 'npm'
|
|
58
|
+
- language: yaml
|
|
59
|
+
label: 'Use .nvmrc to enforce Node version across all environments'
|
|
60
|
+
code: |
|
|
61
|
+
# .nvmrc contains: 20
|
|
62
|
+
- name: Setup Node.js
|
|
63
|
+
uses: actions/setup-node@v4
|
|
64
|
+
with:
|
|
65
|
+
node-version-file: '.nvmrc'
|
|
66
|
+
cache: 'npm'
|
|
67
|
+
- language: yaml
|
|
68
|
+
label: 'Test builds against Node.js 22 in a separate matrix job'
|
|
69
|
+
code: |
|
|
70
|
+
jobs:
|
|
71
|
+
test:
|
|
72
|
+
strategy:
|
|
73
|
+
matrix:
|
|
74
|
+
node: ['20', '22']
|
|
75
|
+
fail-fast: false
|
|
76
|
+
runs-on: ubuntu-latest
|
|
77
|
+
steps:
|
|
78
|
+
- uses: actions/checkout@v4
|
|
79
|
+
- uses: actions/setup-node@v4
|
|
80
|
+
with:
|
|
81
|
+
node-version: ${{ matrix.node }}
|
|
82
|
+
cache: 'npm'
|
|
83
|
+
- run: npm ci
|
|
84
|
+
- run: npm run build
|
|
85
|
+
prevention:
|
|
86
|
+
- 'Upgrade to webpack 5 — webpack 4 uses MD4 hashes that depend on legacy OpenSSL algorithms'
|
|
87
|
+
- 'Do not set NODE_OPTIONS=--openssl-legacy-provider in workflow env — it was a temporary workaround removed in Node 22'
|
|
88
|
+
- 'Use node-version-file (.nvmrc or .node-version) to prevent automatic major version upgrades when lts/* resolves to a new major'
|
|
89
|
+
- 'Run a separate CI matrix job targeting Node.js 22 to detect future incompatibilities before they block your default branch'
|
|
90
|
+
docs:
|
|
91
|
+
- url: 'https://nodejs.org/en/blog/release/v22.0.0'
|
|
92
|
+
label: 'Node.js 22 release notes — OpenSSL legacy provider removal'
|
|
93
|
+
- url: 'https://github.com/webpack/webpack/issues/14532'
|
|
94
|
+
label: 'webpack GitHub issue: ERR_OSSL_UNSUPPORTED on Node.js 17+'
|
|
95
|
+
- url: 'https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs#specifying-the-nodejs-version'
|
|
96
|
+
label: 'GitHub Docs: Specifying the Node.js version in setup-node'
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
id: runner-environment-159
|
|
2
|
+
title: 'setup-go@v5 with Go 1.21+ toolchain directive — GOTOOLCHAIN=auto downloads newer Go toolchain mid-CI'
|
|
3
|
+
category: runner-environment
|
|
4
|
+
severity: warning
|
|
5
|
+
tags:
|
|
6
|
+
- setup-go
|
|
7
|
+
- go
|
|
8
|
+
- gotoolchain
|
|
9
|
+
- toolchain-directive
|
|
10
|
+
- go-version
|
|
11
|
+
- network
|
|
12
|
+
- go-mod
|
|
13
|
+
patterns:
|
|
14
|
+
- regex: 'go: downloading go1\.\d+\.\d+ \(linux/amd64\)'
|
|
15
|
+
flags: 'i'
|
|
16
|
+
- regex: 'go: module requires GOTOOLCHAIN at least go1\.'
|
|
17
|
+
flags: 'i'
|
|
18
|
+
- regex: 'go: toolchain.*not available'
|
|
19
|
+
flags: 'i'
|
|
20
|
+
- regex: 'toolchain go1\.\d+\.\d+ required, have go1\.'
|
|
21
|
+
flags: 'i'
|
|
22
|
+
error_messages:
|
|
23
|
+
- 'go: downloading go1.22.3 (linux/amd64)'
|
|
24
|
+
- 'go: module requires GOTOOLCHAIN at least go1.22.0'
|
|
25
|
+
- 'go: toolchain download not available: dial tcp: lookup proxy.golang.org: no such host'
|
|
26
|
+
- 'toolchain go1.22.3 required, have go1.21.13'
|
|
27
|
+
root_cause: |
|
|
28
|
+
Go 1.21 introduced the `toolchain` directive in `go.mod` and `go.sum`, along with the
|
|
29
|
+
`GOTOOLCHAIN` environment variable that controls toolchain version management. The default
|
|
30
|
+
value `GOTOOLCHAIN=auto` causes the Go runtime to automatically download a newer Go
|
|
31
|
+
toolchain if the installed version is older than the version specified by the `toolchain`
|
|
32
|
+
directive (or the `go` directive when no explicit `toolchain` key exists).
|
|
33
|
+
|
|
34
|
+
When `actions/setup-go@v5` installs Go 1.21.x but the project's `go.mod` contains:
|
|
35
|
+
toolchain go1.22.3
|
|
36
|
+
Go will automatically attempt to download the go1.22.3 toolchain from proxy.golang.org
|
|
37
|
+
at runtime — during `go build`, `go test`, or any go command. This download adds
|
|
38
|
+
15-120 seconds to CI jobs and can fail entirely in:
|
|
39
|
+
- Self-hosted runners in air-gapped or network-restricted environments
|
|
40
|
+
- Runners with strict egress firewall rules blocking proxy.golang.org
|
|
41
|
+
- Flaky network conditions during toolchain resolution
|
|
42
|
+
|
|
43
|
+
The behavior is often invisible in logs because the download proceeds silently before
|
|
44
|
+
each `go` invocation. The symptom is slower-than-expected build times or a cryptic
|
|
45
|
+
`dial tcp: lookup proxy.golang.org: no such host` error that appears unrelated to
|
|
46
|
+
the Go version.
|
|
47
|
+
|
|
48
|
+
Note: This is distinct from the Go 1.23 telemetry cache tar collision
|
|
49
|
+
(runner-environment-041). That is a cache restore bug; this is an unexpected network
|
|
50
|
+
download triggered by the toolchain directive.
|
|
51
|
+
fix: |
|
|
52
|
+
Option 1 (recommended): Set `GOTOOLCHAIN=local` to prevent auto-downloads and fail fast
|
|
53
|
+
if the installed version doesn't satisfy the toolchain directive. Then configure
|
|
54
|
+
`actions/setup-go@v5` to install exactly the required Go version.
|
|
55
|
+
|
|
56
|
+
Option 2: Use `go-version-file: go.mod` so that setup-go installs the exact Go version
|
|
57
|
+
matching the `go` line in go.mod — ensure this matches or exceeds the `toolchain`
|
|
58
|
+
directive to prevent downloads.
|
|
59
|
+
|
|
60
|
+
Option 3: Remove the `toolchain` directive from `go.mod` if it is not intentionally
|
|
61
|
+
pinning a minimum toolchain version. The directive was added automatically by
|
|
62
|
+
`go mod tidy` in Go 1.21+ and many projects don't need it.
|
|
63
|
+
fix_code:
|
|
64
|
+
- language: yaml
|
|
65
|
+
label: 'Set GOTOOLCHAIN=local to prevent mid-CI toolchain downloads'
|
|
66
|
+
code: |
|
|
67
|
+
jobs:
|
|
68
|
+
build:
|
|
69
|
+
runs-on: ubuntu-latest
|
|
70
|
+
env:
|
|
71
|
+
GOTOOLCHAIN: local # Never auto-download; use only the installed toolchain
|
|
72
|
+
steps:
|
|
73
|
+
- uses: actions/checkout@v4
|
|
74
|
+
- uses: actions/setup-go@v5
|
|
75
|
+
with:
|
|
76
|
+
go-version: '1.22.x' # Install the exact version needed by go.mod
|
|
77
|
+
cache: true
|
|
78
|
+
- run: go build ./...
|
|
79
|
+
- language: yaml
|
|
80
|
+
label: 'Use go-version-file to pin version from go.mod'
|
|
81
|
+
code: |
|
|
82
|
+
jobs:
|
|
83
|
+
build:
|
|
84
|
+
runs-on: ubuntu-latest
|
|
85
|
+
env:
|
|
86
|
+
GOTOOLCHAIN: local
|
|
87
|
+
steps:
|
|
88
|
+
- uses: actions/checkout@v4
|
|
89
|
+
- uses: actions/setup-go@v5
|
|
90
|
+
with:
|
|
91
|
+
go-version-file: go.mod # Reads 'go' directive from go.mod
|
|
92
|
+
cache: true
|
|
93
|
+
# go.mod should specify 'go 1.22.3' matching or exceeding the toolchain directive
|
|
94
|
+
- run: go build ./...
|
|
95
|
+
- language: yaml
|
|
96
|
+
label: 'Remove toolchain directive from go.mod to avoid the download trigger'
|
|
97
|
+
code: |
|
|
98
|
+
# In go.mod, remove the toolchain line if your project does not require a
|
|
99
|
+
# minimum toolchain version beyond what setup-go installs:
|
|
100
|
+
# BEFORE (triggers GOTOOLCHAIN=auto download):
|
|
101
|
+
# go 1.21
|
|
102
|
+
# toolchain go1.22.3
|
|
103
|
+
#
|
|
104
|
+
# AFTER (no automatic download):
|
|
105
|
+
# go 1.22.3
|
|
106
|
+
# (no toolchain directive)
|
|
107
|
+
#
|
|
108
|
+
# Run `go mod tidy` with GOTOOLCHAIN=local after editing go.mod to clean up.
|
|
109
|
+
prevention:
|
|
110
|
+
- "Set `GOTOOLCHAIN: local` as a job-level env var in all Go workflows to prevent unexpected toolchain downloads"
|
|
111
|
+
- "When upgrading Go versions, use `go-version-file: go.mod` in setup-go so CI always installs the correct version"
|
|
112
|
+
- "After running `go mod tidy` locally with Go 1.21+, check whether a `toolchain` directive was added to go.mod before committing"
|
|
113
|
+
- "In air-gapped environments, always set GOTOOLCHAIN=local and pre-bake the required toolchain into the self-hosted runner image"
|
|
114
|
+
docs:
|
|
115
|
+
- url: 'https://go.dev/doc/toolchain'
|
|
116
|
+
label: 'Go Toolchains — official documentation for GOTOOLCHAIN and toolchain directive'
|
|
117
|
+
- url: 'https://go.dev/blog/toolchain'
|
|
118
|
+
label: 'Go Blog: Go Toolchains (Go 1.21 announcement)'
|
|
119
|
+
- url: 'https://github.com/actions/setup-go/blob/main/README.md'
|
|
120
|
+
label: 'actions/setup-go README — go-version-file input'
|
|
121
|
+
- url: 'https://pkg.go.dev/cmd/go#hdr-Go_toolchain_management'
|
|
122
|
+
label: 'go command: toolchain management — GOTOOLCHAIN environment variable'
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
id: runner-environment-163
|
|
2
|
+
title: 'actions/setup-java Temurin distribution has no Java 8 builds for macOS ARM64 runners'
|
|
3
|
+
category: runner-environment
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- setup-java
|
|
7
|
+
- temurin
|
|
8
|
+
- java-8
|
|
9
|
+
- arm64
|
|
10
|
+
- macos-14
|
|
11
|
+
- macos-15
|
|
12
|
+
- apple-silicon
|
|
13
|
+
- adoptium
|
|
14
|
+
patterns:
|
|
15
|
+
- regex: 'No matching distribution found for Java version 8.*Temurin'
|
|
16
|
+
flags: 'i'
|
|
17
|
+
- regex: 'Downloading Java 8.*Temurin.*aarch64.*Error'
|
|
18
|
+
flags: 'i'
|
|
19
|
+
- regex: 'Error: No matching distribution found for'
|
|
20
|
+
flags: 'i'
|
|
21
|
+
- regex: 'Could not find satisfied version for SemVer.*8.*temurin'
|
|
22
|
+
flags: 'i'
|
|
23
|
+
error_messages:
|
|
24
|
+
- 'Error: No matching distribution found for Java version 8 and distribution Temurin'
|
|
25
|
+
- 'Downloading Java 8 (Temurin) aarch64... Not Found'
|
|
26
|
+
- 'Could not find satisfied version for SemVer 8 using temurin on darwin aarch64'
|
|
27
|
+
root_cause: |
|
|
28
|
+
Eclipse Temurin (the continuation of AdoptOpenJDK) does not publish Java 8
|
|
29
|
+
(JDK 1.8) builds for macOS ARM64 (Apple Silicon / aarch64). Java 8 reached
|
|
30
|
+
end-of-life for Temurin production support, and no ARM64 macOS binaries were
|
|
31
|
+
ever released for that version.
|
|
32
|
+
|
|
33
|
+
The macos-14 and macos-15 GitHub-hosted runners use ARM64 hardware (M-series
|
|
34
|
+
chips). When a workflow specifies distribution: temurin with java-version: '8',
|
|
35
|
+
actions/setup-java cannot find a compatible download and fails. The error is
|
|
36
|
+
surprising because the identical workflow succeeds on macos-13 (Intel x86_64)
|
|
37
|
+
where Temurin Java 8 builds do exist.
|
|
38
|
+
|
|
39
|
+
This manifests when teams migrate from macos-13 to macos-14/15 for performance
|
|
40
|
+
or cost reasons without first auditing whether their Java version is supported
|
|
41
|
+
on ARM64.
|
|
42
|
+
fix: |
|
|
43
|
+
Preferred: Upgrade to Java 11, 17, or 21 LTS — all of which have Temurin
|
|
44
|
+
ARM64 macOS builds. If Java 8 is strictly required for the build, use the
|
|
45
|
+
Zulu distribution (Azul), which publishes Java 8 builds for macOS ARM64.
|
|
46
|
+
As a last resort, use macos-13 (Intel) for legacy Java 8 jobs.
|
|
47
|
+
fix_code:
|
|
48
|
+
- language: yaml
|
|
49
|
+
label: 'Upgrade to Java 17 LTS with Temurin (recommended)'
|
|
50
|
+
code: |
|
|
51
|
+
- name: Setup Java 17
|
|
52
|
+
uses: actions/setup-java@v4
|
|
53
|
+
with:
|
|
54
|
+
distribution: temurin
|
|
55
|
+
java-version: '17' # Temurin supports ARM64 for Java 11, 17, 21
|
|
56
|
+
- language: yaml
|
|
57
|
+
label: 'Use Zulu distribution for Java 8 on ARM64 (workaround)'
|
|
58
|
+
code: |
|
|
59
|
+
- name: Setup Java 8 via Zulu (ARM64-compatible)
|
|
60
|
+
uses: actions/setup-java@v4
|
|
61
|
+
with:
|
|
62
|
+
distribution: zulu # Azul Zulu provides Java 8 for macOS ARM64
|
|
63
|
+
java-version: '8'
|
|
64
|
+
- language: yaml
|
|
65
|
+
label: 'Matrix build — Java 8 on Intel, Java 17 on ARM64'
|
|
66
|
+
code: |
|
|
67
|
+
jobs:
|
|
68
|
+
test:
|
|
69
|
+
strategy:
|
|
70
|
+
matrix:
|
|
71
|
+
include:
|
|
72
|
+
- runner: macos-13 # Intel — Temurin Java 8 available
|
|
73
|
+
java: '8'
|
|
74
|
+
- runner: macos-15 # ARM64 — Temurin Java 17 only
|
|
75
|
+
java: '17'
|
|
76
|
+
runs-on: ${{ matrix.runner }}
|
|
77
|
+
steps:
|
|
78
|
+
- uses: actions/setup-java@v4
|
|
79
|
+
with:
|
|
80
|
+
distribution: temurin
|
|
81
|
+
java-version: ${{ matrix.java }}
|
|
82
|
+
prevention:
|
|
83
|
+
- 'Upgrade to Java 11, 17, or 21 LTS — Java 8 is past EOL for Temurin and has no ARM64 macOS builds'
|
|
84
|
+
- 'When migrating from macos-13 (Intel) to macos-14/15 (ARM64), audit all Java version requirements first'
|
|
85
|
+
- 'Use the Zulu distribution as a drop-in replacement for Java 8 when ARM64 support is required'
|
|
86
|
+
- 'Check Adoptium release availability at adoptium.net/temurin/releases before assuming a version exists on your target platform'
|
|
87
|
+
docs:
|
|
88
|
+
- url: 'https://adoptium.net/temurin/releases/?version=8&os=mac&arch=aarch64'
|
|
89
|
+
label: 'Eclipse Temurin releases — Java 8 macOS AArch64 availability'
|
|
90
|
+
- url: 'https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#supported-distributions'
|
|
91
|
+
label: 'actions/setup-java: Supported distributions and platforms'
|
|
92
|
+
- url: 'https://endoflife.date/eclipse-temurin'
|
|
93
|
+
label: 'Eclipse Temurin end-of-life dates'
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
id: runner-environment-160
|
|
2
|
+
title: 'ubuntu-24.04 apt-get install hangs on tzdata interactive timezone prompt'
|
|
3
|
+
category: runner-environment
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- ubuntu-24.04
|
|
7
|
+
- apt-get
|
|
8
|
+
- tzdata
|
|
9
|
+
- noninteractive
|
|
10
|
+
- hang
|
|
11
|
+
- debian-frontend
|
|
12
|
+
patterns:
|
|
13
|
+
- regex: 'Please select the geographic area in which you live'
|
|
14
|
+
flags: 'i'
|
|
15
|
+
- regex: 'Configuring tzdata'
|
|
16
|
+
flags: 'i'
|
|
17
|
+
- regex: 'debconf: unable to initialize frontend: Dialog'
|
|
18
|
+
flags: 'i'
|
|
19
|
+
error_messages:
|
|
20
|
+
- 'Please select the geographic area in which you live.'
|
|
21
|
+
- 'Configuring tzdata'
|
|
22
|
+
- 'debconf: unable to initialize frontend: Dialog'
|
|
23
|
+
- 'debconf: falling back to frontend: Readline'
|
|
24
|
+
root_cause: |
|
|
25
|
+
When installing packages that depend on tzdata (tzdata itself, libssl-dev, php,
|
|
26
|
+
libpq-dev, and many others) without setting DEBIAN_FRONTEND=noninteractive,
|
|
27
|
+
apt-get sends interactive prompts for timezone configuration to the TTY. GitHub
|
|
28
|
+
Actions runner steps have no interactive TTY to respond to debconf prompts, so
|
|
29
|
+
the step hangs indefinitely until the 6-hour job timeout is reached.
|
|
30
|
+
|
|
31
|
+
Ubuntu 24.04 runners are particularly susceptible because the debconf default
|
|
32
|
+
frontend is "dialog", which requires a terminal. The hang appears to come from
|
|
33
|
+
a frozen step with no output — making it look like a performance issue rather
|
|
34
|
+
than a prompt waiting for input.
|
|
35
|
+
|
|
36
|
+
The symptom is often indirect: a workflow step that installs a package with
|
|
37
|
+
tzdata as a transitive dependency (not an explicitly installed package) silently
|
|
38
|
+
hangs. Developers are surprised because the same apt-get install command works
|
|
39
|
+
fine in an interactive shell.
|
|
40
|
+
fix: |
|
|
41
|
+
Set DEBIAN_FRONTEND=noninteractive in the step or job env block before running
|
|
42
|
+
apt-get install. For tzdata specifically, pre-configure the timezone using
|
|
43
|
+
environment variables or a symlink before installation.
|
|
44
|
+
fix_code:
|
|
45
|
+
- language: yaml
|
|
46
|
+
label: 'Set DEBIAN_FRONTEND at step level'
|
|
47
|
+
code: |
|
|
48
|
+
- name: Install dependencies
|
|
49
|
+
env:
|
|
50
|
+
DEBIAN_FRONTEND: noninteractive
|
|
51
|
+
run: |
|
|
52
|
+
sudo apt-get update
|
|
53
|
+
sudo apt-get install -y tzdata libssl-dev
|
|
54
|
+
- language: yaml
|
|
55
|
+
label: 'Set DEBIAN_FRONTEND at job level (applies to all steps)'
|
|
56
|
+
code: |
|
|
57
|
+
jobs:
|
|
58
|
+
build:
|
|
59
|
+
runs-on: ubuntu-24.04
|
|
60
|
+
env:
|
|
61
|
+
DEBIAN_FRONTEND: noninteractive
|
|
62
|
+
steps:
|
|
63
|
+
- name: Install dependencies
|
|
64
|
+
run: |
|
|
65
|
+
sudo apt-get update
|
|
66
|
+
sudo apt-get install -y tzdata
|
|
67
|
+
- language: yaml
|
|
68
|
+
label: 'Pre-configure timezone to avoid the prompt entirely'
|
|
69
|
+
code: |
|
|
70
|
+
- name: Install tzdata non-interactively
|
|
71
|
+
run: |
|
|
72
|
+
sudo ln -snf /usr/share/zoneinfo/UTC /etc/localtime
|
|
73
|
+
echo UTC | sudo tee /etc/timezone
|
|
74
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
|
|
75
|
+
prevention:
|
|
76
|
+
- 'Always set DEBIAN_FRONTEND=noninteractive when running apt-get in CI environments'
|
|
77
|
+
- 'Set DEBIAN_FRONTEND at the job level env block to protect all steps automatically'
|
|
78
|
+
- 'Check transitive dependencies with apt-cache show <package> to detect tzdata deps early'
|
|
79
|
+
- 'Add a timeout-minutes to critical steps so tzdata hangs fail fast instead of blocking for 6 hours'
|
|
80
|
+
docs:
|
|
81
|
+
- url: 'https://manpages.ubuntu.com/manpages/noble/man7/debconf.7.html'
|
|
82
|
+
label: 'debconf manual page — debconf frontends and noninteractive mode'
|
|
83
|
+
- url: 'https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables'
|
|
84
|
+
label: 'GitHub Actions: Store information in variables'
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
id: triggers-063
|
|
2
|
+
title: 'on.deployment_status fires for all deployment lifecycle statuses by default — add types: to filter'
|
|
3
|
+
category: triggers
|
|
4
|
+
severity: warning
|
|
5
|
+
tags:
|
|
6
|
+
- deployment_status
|
|
7
|
+
- deployment
|
|
8
|
+
- event-types
|
|
9
|
+
- trigger
|
|
10
|
+
- duplicate-runs
|
|
11
|
+
- types-filter
|
|
12
|
+
patterns:
|
|
13
|
+
- regex: 'on:\s*\n\s*deployment_status:'
|
|
14
|
+
flags: 'ms'
|
|
15
|
+
- regex: 'deployment_status:\s*$'
|
|
16
|
+
flags: 'i'
|
|
17
|
+
error_messages:
|
|
18
|
+
- '(no error — workflow fires unexpectedly multiple times per deployment)'
|
|
19
|
+
root_cause: |
|
|
20
|
+
The `on.deployment_status` event fires whenever the status of a deployment changes.
|
|
21
|
+
A single end-to-end deployment lifecycle emits SIX distinct status events in sequence:
|
|
22
|
+
created → queued → in_progress → success (or failure / error)
|
|
23
|
+
Plus `inactive` when an older deployment is superseded by a new one.
|
|
24
|
+
|
|
25
|
+
When a workflow uses `on: deployment_status:` without a `types:` filter, it runs for
|
|
26
|
+
EVERY one of these status transitions. For a typical deployment:
|
|
27
|
+
- GitHub creates the deployment (fires `deployment_status` with state `created`)
|
|
28
|
+
- The deployment starts running (fires `in_progress`)
|
|
29
|
+
- The deployment completes (fires `success`)
|
|
30
|
+
- Any prior deployment for the same environment becomes inactive (fires `inactive`)
|
|
31
|
+
|
|
32
|
+
This causes a workflow to run 3-4 times per deployment. Common consequences:
|
|
33
|
+
- Post-deployment smoke tests run before the deployment is complete (`in_progress` run)
|
|
34
|
+
- Notification steps send duplicate Slack/email messages for each status transition
|
|
35
|
+
- Downstream `workflow_run` triggers fire multiple times, causing race conditions
|
|
36
|
+
- GitHub-billed Actions minutes are wasted on unwanted runs
|
|
37
|
+
|
|
38
|
+
The `deployment_status` event does not have sensible defaults for status filtering —
|
|
39
|
+
unlike `pull_request` (which defaults to `opened`, `synchronize`, `reopened`),
|
|
40
|
+
`deployment_status` has no default type filter and fires for everything.
|
|
41
|
+
|
|
42
|
+
Note: This is analogous to `on.pull_request_review` firing for all review types by
|
|
43
|
+
default (documented in triggers-062). Both events require explicit `types:` filters
|
|
44
|
+
to limit scope to meaningful actions.
|
|
45
|
+
fix: |
|
|
46
|
+
Add a `types:` filter to `on.deployment_status` to limit which status transitions
|
|
47
|
+
trigger the workflow. For most use cases:
|
|
48
|
+
- Post-deployment tests: use `types: [success]`
|
|
49
|
+
- Deployment monitoring: use `types: [failure, error]`
|
|
50
|
+
- Full lifecycle tracking: use `types: [in_progress, success, failure, error]`
|
|
51
|
+
|
|
52
|
+
Additionally, add an `if:` condition using `github.event.deployment_status.state`
|
|
53
|
+
for fine-grained control when multiple types are needed.
|
|
54
|
+
fix_code:
|
|
55
|
+
- language: yaml
|
|
56
|
+
label: 'Filter to success only — post-deployment smoke tests'
|
|
57
|
+
code: |
|
|
58
|
+
on:
|
|
59
|
+
deployment_status:
|
|
60
|
+
types:
|
|
61
|
+
- success # Only runs when deployment reaches success state
|
|
62
|
+
|
|
63
|
+
jobs:
|
|
64
|
+
smoke-test:
|
|
65
|
+
runs-on: ubuntu-latest
|
|
66
|
+
steps:
|
|
67
|
+
- name: Run smoke tests against deployed environment
|
|
68
|
+
run: |
|
|
69
|
+
ENV_URL="${{ github.event.deployment_status.environment_url }}"
|
|
70
|
+
echo "Testing $ENV_URL"
|
|
71
|
+
curl -f "$ENV_URL/health"
|
|
72
|
+
- language: yaml
|
|
73
|
+
label: 'Filter to failure and error — deployment monitoring'
|
|
74
|
+
code: |
|
|
75
|
+
on:
|
|
76
|
+
deployment_status:
|
|
77
|
+
types:
|
|
78
|
+
- failure
|
|
79
|
+
- error
|
|
80
|
+
|
|
81
|
+
jobs:
|
|
82
|
+
alert:
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
steps:
|
|
85
|
+
- name: Notify on deployment failure
|
|
86
|
+
run: |
|
|
87
|
+
echo "Deployment failed: ${{ github.event.deployment_status.state }}"
|
|
88
|
+
echo "Environment: ${{ github.event.deployment.environment }}"
|
|
89
|
+
- language: yaml
|
|
90
|
+
label: 'Multiple types with runtime if: check for nuanced handling'
|
|
91
|
+
code: |
|
|
92
|
+
on:
|
|
93
|
+
deployment_status:
|
|
94
|
+
types:
|
|
95
|
+
- success
|
|
96
|
+
- failure
|
|
97
|
+
- error
|
|
98
|
+
|
|
99
|
+
jobs:
|
|
100
|
+
post-deploy:
|
|
101
|
+
runs-on: ubuntu-latest
|
|
102
|
+
steps:
|
|
103
|
+
- name: Run tests on success
|
|
104
|
+
if: github.event.deployment_status.state == 'success'
|
|
105
|
+
run: echo "Running post-deployment tests"
|
|
106
|
+
|
|
107
|
+
- name: Alert on failure
|
|
108
|
+
if: |
|
|
109
|
+
github.event.deployment_status.state == 'failure' ||
|
|
110
|
+
github.event.deployment_status.state == 'error'
|
|
111
|
+
run: echo "Alerting on deployment failure"
|
|
112
|
+
prevention:
|
|
113
|
+
- "Always add `types:` to `on.deployment_status` — the default of no filter fires for all 6 status transitions"
|
|
114
|
+
- "Check `github.event.deployment_status.state` in workflow conditions when using multiple status types"
|
|
115
|
+
- "Use `environment_url` from `github.event.deployment_status` to target the correct environment in post-deployment tests"
|
|
116
|
+
- "Monitor your Actions run history after deploying — multiple runs per deployment indicates a missing types: filter"
|
|
117
|
+
docs:
|
|
118
|
+
- url: 'https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#deployment_status'
|
|
119
|
+
label: 'GitHub Docs: deployment_status event — activity types'
|
|
120
|
+
- url: 'https://docs.github.com/en/rest/deployments/statuses?apiVersion=2022-11-28'
|
|
121
|
+
label: 'GitHub REST API: Deployment statuses — state values'
|
|
122
|
+
- url: 'https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/contexts#github-context'
|
|
123
|
+
label: 'GitHub Docs: github.event.deployment_status context fields'
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
id: yaml-syntax-058
|
|
2
|
+
title: 'on.workflow_call.inputs boolean default must be YAML boolean not a quoted string — default: ''true'' causes validation error'
|
|
3
|
+
category: yaml-syntax
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- workflow-call
|
|
7
|
+
- reusable-workflow
|
|
8
|
+
- inputs
|
|
9
|
+
- boolean
|
|
10
|
+
- default
|
|
11
|
+
- validation-error
|
|
12
|
+
- type-mismatch
|
|
13
|
+
patterns:
|
|
14
|
+
- regex: 'Unexpected\s+value\s+''true'''
|
|
15
|
+
flags: 'i'
|
|
16
|
+
- regex: 'Unexpected\s+value\s+''false'''
|
|
17
|
+
flags: 'i'
|
|
18
|
+
- regex: 'on\.workflow_call\.inputs\.[^.]+\.default.*''(?:true|false)'''
|
|
19
|
+
flags: 'i'
|
|
20
|
+
- regex: 'default:\s+''(?:true|false)'''
|
|
21
|
+
flags: 'i'
|
|
22
|
+
error_messages:
|
|
23
|
+
- "Invalid workflow file: .github/workflows/deploy.yml: on.workflow_call.inputs.dry_run.default: Unexpected value 'true'"
|
|
24
|
+
- "Unexpected value 'true'"
|
|
25
|
+
- "Unexpected value 'false'"
|
|
26
|
+
- "on.workflow_call.inputs.X.default: Unexpected value 'true'"
|
|
27
|
+
root_cause: |
|
|
28
|
+
In GitHub Actions, `on.workflow_call.inputs` supports three types: `string`, `boolean`,
|
|
29
|
+
and `number`. When declaring a `type: boolean` input, the `default:` value must be
|
|
30
|
+
a YAML boolean literal (`true` or `false`), NOT a quoted string (`'true'` or `'false'`).
|
|
31
|
+
|
|
32
|
+
Quoted strings ('true', 'false') are YAML string scalars. GitHub Actions validates
|
|
33
|
+
the `default:` value against the declared input `type:`, and when a string is given
|
|
34
|
+
where a boolean is expected, workflow validation fails with:
|
|
35
|
+
"on.workflow_call.inputs.X.default: Unexpected value 'true'"
|
|
36
|
+
|
|
37
|
+
This mistake is extremely common for two reasons:
|
|
38
|
+
1. Developers working with YAML often quote boolean-like values defensively to avoid
|
|
39
|
+
YAML parsing surprises — but in this specific field, the quotes cause the error.
|
|
40
|
+
2. The error message "Unexpected value 'true'" is confusing: `true` is expected, but
|
|
41
|
+
the quotes around it in the error output make it look like 'true' is a bad value,
|
|
42
|
+
not that the quotes themselves are the problem.
|
|
43
|
+
|
|
44
|
+
This is distinct from `silent-failures/workflow-call-boolean-input-string-coercion.yml`
|
|
45
|
+
which covers the receiving side: even when defaults are declared correctly, the called
|
|
46
|
+
workflow receives boolean input values as strings ('true'/'false') in the `inputs`
|
|
47
|
+
context and must compare using `== 'true'` not `== true`. This entry is about the
|
|
48
|
+
DECLARATION error before the workflow even runs.
|
|
49
|
+
fix: |
|
|
50
|
+
Remove the quotes from the `default:` value for `type: boolean` inputs in
|
|
51
|
+
`on.workflow_call.inputs`. Use bare YAML booleans `true` and `false`.
|
|
52
|
+
|
|
53
|
+
If you want to document the type explicitly, add a `description:` field instead of
|
|
54
|
+
relying on the default value to communicate the type.
|
|
55
|
+
fix_code:
|
|
56
|
+
- language: yaml
|
|
57
|
+
label: 'WRONG: quoted string default causes validation error'
|
|
58
|
+
code: |
|
|
59
|
+
# BROKEN: 'true' is a string, not a boolean — validation fails
|
|
60
|
+
on:
|
|
61
|
+
workflow_call:
|
|
62
|
+
inputs:
|
|
63
|
+
dry_run:
|
|
64
|
+
type: boolean
|
|
65
|
+
default: 'true' # ERROR: Unexpected value 'true'
|
|
66
|
+
description: 'Run in dry-run mode'
|
|
67
|
+
- language: yaml
|
|
68
|
+
label: 'CORRECT: bare YAML boolean for default value'
|
|
69
|
+
code: |
|
|
70
|
+
# FIXED: true (no quotes) is a YAML boolean — validation passes
|
|
71
|
+
on:
|
|
72
|
+
workflow_call:
|
|
73
|
+
inputs:
|
|
74
|
+
dry_run:
|
|
75
|
+
type: boolean
|
|
76
|
+
default: true # Correct YAML boolean literal
|
|
77
|
+
description: 'Run in dry-run mode (default: enabled)'
|
|
78
|
+
skip_tests:
|
|
79
|
+
type: boolean
|
|
80
|
+
default: false # Correct YAML boolean literal
|
|
81
|
+
description: 'Skip test suite'
|
|
82
|
+
- language: yaml
|
|
83
|
+
label: 'Complete reusable workflow with correct boolean inputs'
|
|
84
|
+
code: |
|
|
85
|
+
# .github/workflows/deploy-reusable.yml
|
|
86
|
+
on:
|
|
87
|
+
workflow_call:
|
|
88
|
+
inputs:
|
|
89
|
+
environment:
|
|
90
|
+
type: string
|
|
91
|
+
required: true
|
|
92
|
+
description: 'Target environment: staging or production'
|
|
93
|
+
dry_run:
|
|
94
|
+
type: boolean
|
|
95
|
+
default: false # bare boolean, no quotes
|
|
96
|
+
description: 'Perform a dry run without making changes'
|
|
97
|
+
notify:
|
|
98
|
+
type: boolean
|
|
99
|
+
default: true # bare boolean, no quotes
|
|
100
|
+
description: 'Send Slack notification on completion'
|
|
101
|
+
|
|
102
|
+
jobs:
|
|
103
|
+
deploy:
|
|
104
|
+
runs-on: ubuntu-latest
|
|
105
|
+
steps:
|
|
106
|
+
- uses: actions/checkout@v4
|
|
107
|
+
# Note: inputs.dry_run arrives as the STRING 'true' or 'false'
|
|
108
|
+
# in the job body — compare with == 'true', not == true
|
|
109
|
+
- if: inputs.dry_run != 'true'
|
|
110
|
+
run: echo "Deploying to ${{ inputs.environment }}"
|
|
111
|
+
prevention:
|
|
112
|
+
- "Never quote boolean default values in workflow_call inputs — use bare `true` or `false`"
|
|
113
|
+
- "Remember that while the DECLARATION requires bare booleans, the VALUE received by steps is always a string: compare with `== 'true'`, not `== true`"
|
|
114
|
+
- "Run `actionlint` locally to catch input type/default mismatches before pushing"
|
|
115
|
+
- "Validate workflow files with `gh workflow view` or push to a test branch to surface validation errors early"
|
|
116
|
+
docs:
|
|
117
|
+
- url: 'https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_call'
|
|
118
|
+
label: 'GitHub Docs: workflow_call inputs — supported types and default values'
|
|
119
|
+
- url: 'https://docs.github.com/en/actions/sharing-automations/reusing-workflows#using-inputs-and-secrets-in-a-reusable-workflow'
|
|
120
|
+
label: 'GitHub Docs: Reusable workflow inputs'
|
|
121
|
+
- url: 'https://github.com/orgs/community/discussions/39357'
|
|
122
|
+
label: 'GitHub Community: workflow_call input type validation discussion'
|
package/package.json
CHANGED