@htekdev/actions-debugger 1.0.0 → 1.0.1
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/LICENSE +21 -21
- package/README.md +108 -108
- package/errors/_schema.json +89 -89
- package/errors/caching-artifacts/artifact-storage-quota-exceeded.yml +118 -0
- package/errors/caching-artifacts/cache-miss.yml +56 -56
- package/errors/caching-artifacts/cache-save-cancelled-job.yml +82 -0
- package/errors/caching-artifacts/cache-v3-to-v4-breaking-changes.yml +95 -0
- package/errors/caching-artifacts/cross-repo-artifacts-not-supported.yml +102 -0
- package/errors/caching-artifacts/upload-artifact-no-files-found.yml +92 -0
- package/errors/caching-artifacts/upload-artifact-v4-breaking.yml +67 -67
- package/errors/concurrency-timing/cancel-in-progress-deploy-drops.yml +97 -0
- package/errors/concurrency-timing/jobs-cancelled-unexpectedly.yml +60 -60
- package/errors/concurrency-timing/skipped-needs-cascade.yml +103 -0
- package/errors/concurrency-timing/workflow-run-conclusion-unchecked.yml +100 -0
- package/errors/known-unsolved/composite-input-env-vars-missing.yml +91 -0
- package/errors/known-unsolved/composite-nested-outputs-null.yml +101 -0
- package/errors/known-unsolved/no-dynamic-secret-access.yml +111 -0
- package/errors/known-unsolved/no-step-level-rerun.yml +94 -0
- package/errors/known-unsolved/no-step-retry.yml +53 -53
- package/errors/permissions-auth/checkout-submodule-private-auth.yml +91 -0
- package/errors/permissions-auth/fork-pr-secrets-unavailable.yml +97 -0
- package/errors/permissions-auth/github-token-403.yml +64 -64
- package/errors/permissions-auth/github-token-protected-branch-push.yml +109 -0
- package/errors/permissions-auth/oidc-aws-failure.yml +85 -85
- package/errors/permissions-auth/oidc-azure-subject-mismatch.yml +91 -0
- package/errors/runner-environment/disk-space.yml +57 -57
- package/errors/runner-environment/docker-buildx-not-setup.yml +106 -0
- package/errors/runner-environment/macos-homebrew-path.yml +90 -0
- package/errors/runner-environment/node-runtime-deprecation.yml +56 -56
- package/errors/runner-environment/npm-ci-lockfile-mismatch.yml +112 -0
- package/errors/runner-environment/self-hosted-stale-toolcache.yml +73 -0
- package/errors/runner-environment/setup-node-version-file-missing.yml +105 -0
- package/errors/runner-environment/windows-execution-policy.yml +83 -0
- package/errors/silent-failures/add-mask-no-retroactive-masking.yml +75 -0
- package/errors/silent-failures/composite-boolean-inputs-as-strings.yml +110 -0
- package/errors/silent-failures/conditional-output-null-downstream.yml +82 -0
- package/errors/silent-failures/continue-on-error-masks-failure.yml +86 -0
- package/errors/silent-failures/github-token-no-trigger.yml +57 -57
- package/errors/silent-failures/reusable-workflow-env-secrets-empty.yml +90 -0
- package/errors/silent-failures/scheduled-workflow-disabled.yml +59 -59
- package/errors/triggers/cron-schedule-late.yml +59 -59
- package/errors/triggers/pull-request-target-rce-risk.yml +117 -0
- package/errors/triggers/workflow-not-triggering.yml +60 -60
- package/errors/triggers/workflow-run-default-branch-requirement.yml +78 -0
- package/errors/yaml-syntax/anchors-not-supported.yml +95 -0
- package/errors/yaml-syntax/dynamic-matrix-fromjson-failure.yml +99 -0
- package/errors/yaml-syntax/if-always-true.yml +52 -52
- package/errors/yaml-syntax/missing-expression-wrapper.yml +67 -0
- package/errors/yaml-syntax/needs-indirect-outputs.yml +91 -0
- package/errors/yaml-syntax/secrets-in-if.yml +55 -55
- package/errors/yaml-syntax/unexpected-yaml-key.yml +69 -69
- package/errors/yaml-syntax/working-directory-ignored-on-uses.yml +66 -0
- package/package.json +70 -67
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
id: caching-artifacts-001
|
|
2
|
-
title: "Cache Miss Despite Recent Save"
|
|
3
|
-
category: caching-artifacts
|
|
4
|
-
severity: warning
|
|
5
|
-
tags:
|
|
6
|
-
- cache
|
|
7
|
-
- artifacts
|
|
8
|
-
- restore-keys
|
|
9
|
-
- branch-scope
|
|
10
|
-
- performance
|
|
11
|
-
patterns:
|
|
12
|
-
- regex: "Cache not found for input keys: .*"
|
|
13
|
-
flags: "i"
|
|
14
|
-
- regex: "Failed to restore: .*"
|
|
15
|
-
flags: "i"
|
|
16
|
-
- regex: "Received 429 response while trying to reserve cache"
|
|
17
|
-
flags: "i"
|
|
18
|
-
error_messages:
|
|
19
|
-
- "Cache not found for input keys"
|
|
20
|
-
- "Received 429 response while trying to reserve cache"
|
|
21
|
-
root_cause: |
|
|
22
|
-
GitHub Actions caches are scoped by key, version, and branch. A cache saved on one branch
|
|
23
|
-
is not always visible from another branch, and a small key mismatch can force a full miss.
|
|
24
|
-
High-volume repositories can also hit cache service throttling, which makes cache restore
|
|
25
|
-
or save behavior look flaky.
|
|
26
|
-
|
|
27
|
-
This is especially confusing when a previous run clearly saved a cache but the next run
|
|
28
|
-
still reports a miss.
|
|
29
|
-
fix: |
|
|
30
|
-
Design cache keys intentionally, add `restore-keys` for partial matches, and understand the
|
|
31
|
-
branch visibility rules. Prime important caches on the default branch and avoid creating an
|
|
32
|
-
overly specific key for data that should be shared more broadly.
|
|
33
|
-
fix_code:
|
|
34
|
-
- language: yaml
|
|
35
|
-
label: "Use restore keys and stable cache key prefixes"
|
|
36
|
-
code: |
|
|
37
|
-
- uses: actions/cache@v4
|
|
38
|
-
with:
|
|
39
|
-
path: |
|
|
40
|
-
~/.npm
|
|
41
|
-
node_modules
|
|
42
|
-
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
|
|
43
|
-
restore-keys: |
|
|
44
|
-
${{ runner.os }}-npm-
|
|
45
|
-
prevention:
|
|
46
|
-
- "Keep cache keys stable enough to be reusable, but specific enough to avoid stale restores."
|
|
47
|
-
- "Use `restore-keys` for partial fallback instead of a single exact key."
|
|
48
|
-
- "Prime caches on the default branch for the widest reuse."
|
|
49
|
-
docs:
|
|
50
|
-
- url: "https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows"
|
|
51
|
-
label: "Caching dependencies to speed up workflows"
|
|
52
|
-
- url: "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions"
|
|
53
|
-
label: "Workflow syntax for GitHub Actions"
|
|
54
|
-
source:
|
|
55
|
-
article: "https://htek.dev/articles/github-actions-debugging-guide"
|
|
56
|
-
section: "Cache misses despite recent saves"
|
|
1
|
+
id: caching-artifacts-001
|
|
2
|
+
title: "Cache Miss Despite Recent Save"
|
|
3
|
+
category: caching-artifacts
|
|
4
|
+
severity: warning
|
|
5
|
+
tags:
|
|
6
|
+
- cache
|
|
7
|
+
- artifacts
|
|
8
|
+
- restore-keys
|
|
9
|
+
- branch-scope
|
|
10
|
+
- performance
|
|
11
|
+
patterns:
|
|
12
|
+
- regex: "Cache not found for input keys: .*"
|
|
13
|
+
flags: "i"
|
|
14
|
+
- regex: "Failed to restore: .*"
|
|
15
|
+
flags: "i"
|
|
16
|
+
- regex: "Received 429 response while trying to reserve cache"
|
|
17
|
+
flags: "i"
|
|
18
|
+
error_messages:
|
|
19
|
+
- "Cache not found for input keys"
|
|
20
|
+
- "Received 429 response while trying to reserve cache"
|
|
21
|
+
root_cause: |
|
|
22
|
+
GitHub Actions caches are scoped by key, version, and branch. A cache saved on one branch
|
|
23
|
+
is not always visible from another branch, and a small key mismatch can force a full miss.
|
|
24
|
+
High-volume repositories can also hit cache service throttling, which makes cache restore
|
|
25
|
+
or save behavior look flaky.
|
|
26
|
+
|
|
27
|
+
This is especially confusing when a previous run clearly saved a cache but the next run
|
|
28
|
+
still reports a miss.
|
|
29
|
+
fix: |
|
|
30
|
+
Design cache keys intentionally, add `restore-keys` for partial matches, and understand the
|
|
31
|
+
branch visibility rules. Prime important caches on the default branch and avoid creating an
|
|
32
|
+
overly specific key for data that should be shared more broadly.
|
|
33
|
+
fix_code:
|
|
34
|
+
- language: yaml
|
|
35
|
+
label: "Use restore keys and stable cache key prefixes"
|
|
36
|
+
code: |
|
|
37
|
+
- uses: actions/cache@v4
|
|
38
|
+
with:
|
|
39
|
+
path: |
|
|
40
|
+
~/.npm
|
|
41
|
+
node_modules
|
|
42
|
+
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
|
|
43
|
+
restore-keys: |
|
|
44
|
+
${{ runner.os }}-npm-
|
|
45
|
+
prevention:
|
|
46
|
+
- "Keep cache keys stable enough to be reusable, but specific enough to avoid stale restores."
|
|
47
|
+
- "Use `restore-keys` for partial fallback instead of a single exact key."
|
|
48
|
+
- "Prime caches on the default branch for the widest reuse."
|
|
49
|
+
docs:
|
|
50
|
+
- url: "https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows"
|
|
51
|
+
label: "Caching dependencies to speed up workflows"
|
|
52
|
+
- url: "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions"
|
|
53
|
+
label: "Workflow syntax for GitHub Actions"
|
|
54
|
+
source:
|
|
55
|
+
article: "https://htek.dev/articles/github-actions-debugging-guide"
|
|
56
|
+
section: "Cache misses despite recent saves"
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
id: caching-artifacts-007
|
|
2
|
+
title: "actions/cache Post-Save Step Skipped When Job Is Cancelled Mid-Run"
|
|
3
|
+
category: caching-artifacts
|
|
4
|
+
severity: silent-failure
|
|
5
|
+
tags:
|
|
6
|
+
- cache
|
|
7
|
+
- cancellation
|
|
8
|
+
- save
|
|
9
|
+
- post-step
|
|
10
|
+
- cache-miss
|
|
11
|
+
- actions/cache
|
|
12
|
+
patterns:
|
|
13
|
+
- regex: "Post job cleanup"
|
|
14
|
+
flags: "i"
|
|
15
|
+
- regex: "Cache save skipped"
|
|
16
|
+
flags: "i"
|
|
17
|
+
- regex: "Cache service responded with 503"
|
|
18
|
+
flags: "i"
|
|
19
|
+
- regex: "cache.*not saved.*cancelled"
|
|
20
|
+
flags: "i"
|
|
21
|
+
error_messages:
|
|
22
|
+
- "Cache save skipped due to job cancellation."
|
|
23
|
+
- "Post job cleanup: Cache was not saved as the job was cancelled."
|
|
24
|
+
root_cause: |
|
|
25
|
+
`actions/cache` saves the cache in a **post-job step** that runs after all workflow
|
|
26
|
+
steps complete. When a job is cancelled (via the UI, API, `concurrency: cancel-in-progress`,
|
|
27
|
+
or reaching the job timeout), the post-step save is skipped — GitHub does not allow
|
|
28
|
+
post-steps to run when the job is cancelled.
|
|
29
|
+
|
|
30
|
+
This causes a **cold cache** on the next run: a build that took 10 minutes to complete
|
|
31
|
+
its install phase is cancelled just before the cache save fires, so the next run starts
|
|
32
|
+
from scratch again. In high-frequency CI environments with auto-cancel enabled, this can
|
|
33
|
+
mean most runs never benefit from caching.
|
|
34
|
+
fix: |
|
|
35
|
+
Use `actions/cache/save@v4` as an explicit step instead of relying on the post-job
|
|
36
|
+
hook. Save the cache immediately after the slow step completes rather than waiting for
|
|
37
|
+
job end. For `cancel-in-progress` workflows, save the cache before the cancellable steps.
|
|
38
|
+
fix_code:
|
|
39
|
+
- language: yaml
|
|
40
|
+
label: "WRONG — cache save is a post-job hook, skipped on cancellation"
|
|
41
|
+
code: |
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/cache@v4
|
|
44
|
+
with:
|
|
45
|
+
path: node_modules
|
|
46
|
+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
47
|
+
|
|
48
|
+
- run: npm ci # slow — if job cancelled here, cache never saves
|
|
49
|
+
- run: npm run build
|
|
50
|
+
- language: yaml
|
|
51
|
+
label: "CORRECT — explicit save step that always runs"
|
|
52
|
+
code: |
|
|
53
|
+
steps:
|
|
54
|
+
- name: Restore cache
|
|
55
|
+
id: cache
|
|
56
|
+
uses: actions/cache/restore@v4
|
|
57
|
+
with:
|
|
58
|
+
path: node_modules
|
|
59
|
+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
60
|
+
|
|
61
|
+
- name: Install dependencies
|
|
62
|
+
if: steps.cache.outputs.cache-hit != 'true'
|
|
63
|
+
run: npm ci
|
|
64
|
+
|
|
65
|
+
- name: Save cache immediately after install
|
|
66
|
+
if: steps.cache.outputs.cache-hit != 'true'
|
|
67
|
+
uses: actions/cache/save@v4
|
|
68
|
+
with:
|
|
69
|
+
path: node_modules
|
|
70
|
+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
71
|
+
|
|
72
|
+
# If job is cancelled after this point, cache is already saved
|
|
73
|
+
- run: npm run build
|
|
74
|
+
prevention:
|
|
75
|
+
- "Use `actions/cache/restore` + `actions/cache/save` separately so cache saves happen as explicit steps, not post-hooks."
|
|
76
|
+
- "Save the cache immediately after the slow install/build step, before the steps most likely to be cancelled."
|
|
77
|
+
- "For very long builds, consider saving a partial cache at key checkpoints."
|
|
78
|
+
docs:
|
|
79
|
+
- url: "https://github.com/actions/cache/blob/main/save/README.md"
|
|
80
|
+
label: "actions/cache/save — explicit save action"
|
|
81
|
+
- url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows"
|
|
82
|
+
label: "Caching dependencies to speed up workflows"
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
id: caching-artifacts-009
|
|
2
|
+
title: "actions/cache v3 to v4 Breaking Changes — save-always and Path Handling"
|
|
3
|
+
category: caching-artifacts
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- actions/cache
|
|
7
|
+
- v3
|
|
8
|
+
- v4
|
|
9
|
+
- migration
|
|
10
|
+
- save-always
|
|
11
|
+
- breaking-change
|
|
12
|
+
- upgrade
|
|
13
|
+
patterns:
|
|
14
|
+
- regex: "Cache action is too slow.*v4"
|
|
15
|
+
flags: "i"
|
|
16
|
+
- regex: "save-always.*not a valid input"
|
|
17
|
+
flags: "i"
|
|
18
|
+
- regex: "Path .* does not exist"
|
|
19
|
+
flags: "i"
|
|
20
|
+
- regex: "Input 'enableCrossOsArchive' is deprecated"
|
|
21
|
+
flags: "i"
|
|
22
|
+
error_messages:
|
|
23
|
+
- "Unexpected input(s) 'save-always', valid inputs are ['path', 'key', 'restore-keys', 'upload-chunk-size', 'enableCrossOsArchive', 'fail-on-cache-miss', 'lookup-only']"
|
|
24
|
+
- "Path /home/runner/.npm does not exist, not saving cache."
|
|
25
|
+
root_cause: |
|
|
26
|
+
`actions/cache@v4` introduced several breaking changes from v3:
|
|
27
|
+
|
|
28
|
+
1. **`save-always` input removed** — v3's `save-always: true` (save even on failure) was
|
|
29
|
+
removed in v4. The replacement is the split `actions/cache/restore` + `actions/cache/save`
|
|
30
|
+
pattern with `if: always()` on the save step.
|
|
31
|
+
|
|
32
|
+
2. **Missing path no longer silently skipped** — v4 by default fails (or warns) when the
|
|
33
|
+
specified cache path does not exist at save time. In v3 this was a silent no-op.
|
|
34
|
+
|
|
35
|
+
3. **Stricter ZSTD compression** — v4 switched to ZSTD compression. Caches saved by v3
|
|
36
|
+
are incompatible with v4 and will cause a cache miss on first run after migration.
|
|
37
|
+
|
|
38
|
+
4. **`enableCrossOsArchive` default changed** — in v4 cross-OS cache sharing requires
|
|
39
|
+
explicit opt-in; v3 defaults were permissive.
|
|
40
|
+
fix: |
|
|
41
|
+
When upgrading from v3 to v4, replace `save-always: true` with the explicit
|
|
42
|
+
restore+save pattern, add existence checks for cache paths, and expect a one-time
|
|
43
|
+
cache miss after migrating (old v3 cache entries are incompatible with v4).
|
|
44
|
+
fix_code:
|
|
45
|
+
- language: yaml
|
|
46
|
+
label: "WRONG — v3 pattern with save-always (breaks in v4)"
|
|
47
|
+
code: |
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/cache@v4 # upgraded from v3 but kept v3 inputs
|
|
50
|
+
with:
|
|
51
|
+
path: ~/.npm
|
|
52
|
+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
53
|
+
save-always: true # ERROR: not a valid input in v4
|
|
54
|
+
- language: yaml
|
|
55
|
+
label: "CORRECT — v4 pattern with explicit save on failure"
|
|
56
|
+
code: |
|
|
57
|
+
steps:
|
|
58
|
+
- name: Restore npm cache
|
|
59
|
+
id: cache
|
|
60
|
+
uses: actions/cache/restore@v4
|
|
61
|
+
with:
|
|
62
|
+
path: ~/.npm
|
|
63
|
+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
64
|
+
restore-keys: |
|
|
65
|
+
${{ runner.os }}-npm-
|
|
66
|
+
|
|
67
|
+
- run: npm ci
|
|
68
|
+
|
|
69
|
+
- name: Save npm cache (runs even on failure)
|
|
70
|
+
if: always() && steps.cache.outputs.cache-hit != 'true'
|
|
71
|
+
uses: actions/cache/save@v4
|
|
72
|
+
with:
|
|
73
|
+
path: ~/.npm
|
|
74
|
+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
75
|
+
- language: yaml
|
|
76
|
+
label: "CORRECT — simple v4 usage without save-always"
|
|
77
|
+
code: |
|
|
78
|
+
steps:
|
|
79
|
+
- uses: actions/cache@v4
|
|
80
|
+
with:
|
|
81
|
+
path: ~/.npm
|
|
82
|
+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
83
|
+
restore-keys: ${{ runner.os }}-npm-
|
|
84
|
+
# No save-always — cache saves on successful job completion only
|
|
85
|
+
prevention:
|
|
86
|
+
- "Expect one cache miss when migrating from v3 to v4 — v3 and v4 cache entries are incompatible."
|
|
87
|
+
- "Replace `save-always: true` with the `actions/cache/restore` + `actions/cache/save` split pattern."
|
|
88
|
+
- "Test cache behavior in a draft PR before merging a v3→v4 migration to main."
|
|
89
|
+
docs:
|
|
90
|
+
- url: "https://github.com/actions/cache/blob/main/RELEASES.md"
|
|
91
|
+
label: "actions/cache release notes (v3→v4 changes)"
|
|
92
|
+
- url: "https://github.com/actions/cache/blob/main/tips-and-workarounds.md"
|
|
93
|
+
label: "actions/cache tips and workarounds"
|
|
94
|
+
- url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows"
|
|
95
|
+
label: "Caching dependencies to speed up workflows"
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
id: caching-artifacts-008
|
|
2
|
+
title: "Artifacts Are Repository-Scoped — Cross-Repo Download Not Supported"
|
|
3
|
+
category: caching-artifacts
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- artifacts
|
|
7
|
+
- cross-repo
|
|
8
|
+
- download
|
|
9
|
+
- scoping
|
|
10
|
+
- workflow-run
|
|
11
|
+
- actions/download-artifact
|
|
12
|
+
patterns:
|
|
13
|
+
- regex: "Unable to find any artifacts for the associated workflow"
|
|
14
|
+
flags: "i"
|
|
15
|
+
- regex: "No artifacts found for"
|
|
16
|
+
flags: "i"
|
|
17
|
+
- regex: "Artifact not found.*repository"
|
|
18
|
+
flags: "i"
|
|
19
|
+
error_messages:
|
|
20
|
+
- "Unable to find any artifacts for the associated workflow run"
|
|
21
|
+
- "Error: No artifacts found for workflow run 1234567890"
|
|
22
|
+
- "HttpError: Not Found — artifacts are scoped to the repository that created them"
|
|
23
|
+
root_cause: |
|
|
24
|
+
GitHub Actions artifacts are **repository-scoped**. A workflow in `org/repo-a` cannot
|
|
25
|
+
download artifacts produced by a workflow in `org/repo-b` using `actions/download-artifact`,
|
|
26
|
+
even if both repos are in the same organization and the caller has read access to both.
|
|
27
|
+
|
|
28
|
+
The `actions/download-artifact` action only fetches artifacts from the **current workflow
|
|
29
|
+
run**. To download artifacts from a different workflow run (same repo), you must use the
|
|
30
|
+
GitHub Actions REST API with a PAT or GitHub App token. Cross-repository artifact sharing
|
|
31
|
+
is entirely unsupported natively and requires external storage (S3, Azure Blob, GitHub
|
|
32
|
+
Releases, GitHub Packages) as an intermediary.
|
|
33
|
+
|
|
34
|
+
This surprises teams building release pipelines where a build repo produces artifacts
|
|
35
|
+
that a deploy repo needs to consume.
|
|
36
|
+
fix: |
|
|
37
|
+
Use an external storage layer (GitHub Releases, GitHub Packages, S3, Azure Blob) for
|
|
38
|
+
cross-repo artifact sharing. Within the same repo, use the GitHub API with a PAT to
|
|
39
|
+
download artifacts from a different workflow run.
|
|
40
|
+
fix_code:
|
|
41
|
+
- language: yaml
|
|
42
|
+
label: "WRONG — attempting cross-repo artifact download (always fails)"
|
|
43
|
+
code: |
|
|
44
|
+
jobs:
|
|
45
|
+
deploy:
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
steps:
|
|
48
|
+
# This ONLY works for artifacts from THIS workflow run
|
|
49
|
+
- uses: actions/download-artifact@v4
|
|
50
|
+
with:
|
|
51
|
+
name: build-output
|
|
52
|
+
# There is no 'repository' input — cross-repo not supported
|
|
53
|
+
- language: yaml
|
|
54
|
+
label: "CORRECT option 1 — upload to GitHub Releases for cross-repo sharing"
|
|
55
|
+
code: |
|
|
56
|
+
# In build repo (org/build-repo):
|
|
57
|
+
jobs:
|
|
58
|
+
build:
|
|
59
|
+
steps:
|
|
60
|
+
- name: Build
|
|
61
|
+
run: npm run build
|
|
62
|
+
|
|
63
|
+
- name: Upload to GitHub Release
|
|
64
|
+
uses: softprops/action-gh-release@v2
|
|
65
|
+
with:
|
|
66
|
+
files: dist/**
|
|
67
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
68
|
+
|
|
69
|
+
# In deploy repo (org/deploy-repo):
|
|
70
|
+
jobs:
|
|
71
|
+
deploy:
|
|
72
|
+
steps:
|
|
73
|
+
- name: Download from release
|
|
74
|
+
run: |
|
|
75
|
+
gh release download v1.0.0 --repo org/build-repo --pattern "*.tar.gz"
|
|
76
|
+
env:
|
|
77
|
+
GH_TOKEN: ${{ secrets.CROSS_REPO_PAT }}
|
|
78
|
+
- language: yaml
|
|
79
|
+
label: "CORRECT option 2 — GitHub API to download artifact from same repo, different run"
|
|
80
|
+
code: |
|
|
81
|
+
jobs:
|
|
82
|
+
deploy:
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
steps:
|
|
85
|
+
- name: Download artifact from specific workflow run
|
|
86
|
+
uses: dawidd6/action-download-artifact@v6
|
|
87
|
+
with:
|
|
88
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
89
|
+
workflow: build.yml
|
|
90
|
+
run_id: ${{ github.event.workflow_run.id }}
|
|
91
|
+
name: build-output
|
|
92
|
+
prevention:
|
|
93
|
+
- "Use GitHub Releases or GitHub Packages (Container Registry, npm registry) for artifacts that must cross repository boundaries."
|
|
94
|
+
- "Design pipelines so build and deploy are in the same repo if artifact passing is needed."
|
|
95
|
+
- "Document artifact storage architecture explicitly in repo README — don't let teams discover the limitation at deploy time."
|
|
96
|
+
docs:
|
|
97
|
+
- url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/storing-and-sharing-data-from-a-workflow"
|
|
98
|
+
label: "Storing and sharing data from a workflow"
|
|
99
|
+
- url: "https://docs.github.com/en/rest/actions/artifacts"
|
|
100
|
+
label: "GitHub REST API — Artifacts"
|
|
101
|
+
- url: "https://github.com/dawidd6/action-download-artifact"
|
|
102
|
+
label: "dawidd6/action-download-artifact (cross-run downloads)"
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
id: caching-artifacts-005
|
|
2
|
+
title: "upload-artifact: No Files Found — Artifact Silently Not Uploaded"
|
|
3
|
+
category: caching-artifacts
|
|
4
|
+
severity: warning
|
|
5
|
+
tags:
|
|
6
|
+
- upload-artifact
|
|
7
|
+
- paths
|
|
8
|
+
- working-directory
|
|
9
|
+
- if-no-files-found
|
|
10
|
+
- silent-failure
|
|
11
|
+
patterns:
|
|
12
|
+
- regex: "No files were found with the provided path[^.]*\\."
|
|
13
|
+
flags: "i"
|
|
14
|
+
- regex: "No artifacts will be uploaded"
|
|
15
|
+
flags: "i"
|
|
16
|
+
- regex: "ENOENT: no such file or directory.*lstat"
|
|
17
|
+
flags: "i"
|
|
18
|
+
error_messages:
|
|
19
|
+
- "No files were found with the provided path: dist. No artifacts will be uploaded."
|
|
20
|
+
- "Warning: No files were found with the provided path"
|
|
21
|
+
- "Error: ENOENT: no such file or directory, lstat '/home/runner/work/..."
|
|
22
|
+
root_cause: |
|
|
23
|
+
The `actions/upload-artifact` action resolves `path:` values relative to the workspace root
|
|
24
|
+
(`$GITHUB_WORKSPACE`, typically `/home/runner/work/{repo}/{repo}`). The five most common
|
|
25
|
+
failure causes:
|
|
26
|
+
|
|
27
|
+
1. Build step outputs to a different directory than expected (e.g., `./build` vs `dist/`).
|
|
28
|
+
2. A prior step uses `working-directory:` which does not affect how upload-artifact resolves
|
|
29
|
+
its `path:` — the path must still be relative to `$GITHUB_WORKSPACE`, not to that step's CWD.
|
|
30
|
+
3. The build step failed silently (non-zero exit code masked by `continue-on-error: true` or
|
|
31
|
+
a multi-command run where the failure was not the last command) so the output directory was
|
|
32
|
+
never created.
|
|
33
|
+
4. A wildcard `path:` glob matches nothing — the directory exists but no files match the pattern.
|
|
34
|
+
5. The artifact `path:` references a file or directory whose name includes a space or special
|
|
35
|
+
character that was not quoted correctly.
|
|
36
|
+
|
|
37
|
+
By default, `upload-artifact` exits with a WARNING (not an error) when no files match. The
|
|
38
|
+
job succeeds and the missing artifact is only discovered downstream when a dependent step or
|
|
39
|
+
job tries to download it — often failing with a cryptic "artifact not found" error.
|
|
40
|
+
fix: |
|
|
41
|
+
Set `if-no-files-found: error` to turn the silent warning into an immediate job failure.
|
|
42
|
+
Add a debug step before the upload to confirm the exact path that was actually written.
|
|
43
|
+
fix_code:
|
|
44
|
+
- language: yaml
|
|
45
|
+
label: "Add if-no-files-found: error and a debug step to verify the path"
|
|
46
|
+
code: |
|
|
47
|
+
steps:
|
|
48
|
+
- name: Build
|
|
49
|
+
run: npm run build
|
|
50
|
+
# outputs to ./dist by default
|
|
51
|
+
|
|
52
|
+
- name: Debug — verify build output exists
|
|
53
|
+
if: always()
|
|
54
|
+
run: |
|
|
55
|
+
echo "=== workspace contents ==="
|
|
56
|
+
ls -la
|
|
57
|
+
echo "=== dist/ contents ==="
|
|
58
|
+
ls -la dist/ || echo "dist/ does not exist"
|
|
59
|
+
|
|
60
|
+
- uses: actions/upload-artifact@v4
|
|
61
|
+
with:
|
|
62
|
+
name: dist-bundle
|
|
63
|
+
path: dist/
|
|
64
|
+
if-no-files-found: error # fail immediately instead of silently skipping
|
|
65
|
+
retention-days: 7
|
|
66
|
+
- language: yaml
|
|
67
|
+
label: "Fix working-directory path mismatch"
|
|
68
|
+
code: |
|
|
69
|
+
steps:
|
|
70
|
+
- name: Build in subdirectory
|
|
71
|
+
working-directory: packages/app
|
|
72
|
+
run: npm run build
|
|
73
|
+
# outputs to packages/app/dist — NOT ./dist relative to workspace root
|
|
74
|
+
|
|
75
|
+
- uses: actions/upload-artifact@v4
|
|
76
|
+
with:
|
|
77
|
+
name: app-bundle
|
|
78
|
+
path: packages/app/dist/ # always relative to $GITHUB_WORKSPACE
|
|
79
|
+
if-no-files-found: error
|
|
80
|
+
prevention:
|
|
81
|
+
- "Always set `if-no-files-found: error` — the default `warn` silently hides missing artifacts."
|
|
82
|
+
- "Add a debug `ls` or `find` step before upload-artifact when setting up a new workflow."
|
|
83
|
+
- "Remember that `path:` is always relative to `$GITHUB_WORKSPACE`, not to any step's `working-directory:`."
|
|
84
|
+
- "If a build can legitimately produce no files (e.g., no changed files), use `if-no-files-found: ignore` explicitly so the intent is clear."
|
|
85
|
+
- "Avoid masking build failures with `continue-on-error: true` on steps that produce upload artifacts."
|
|
86
|
+
docs:
|
|
87
|
+
- url: "https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/storing-and-sharing-data-from-a-workflow"
|
|
88
|
+
label: "Storing and sharing data from a workflow"
|
|
89
|
+
- url: "https://github.com/actions/upload-artifact#inputs"
|
|
90
|
+
label: "upload-artifact README — if-no-files-found input"
|
|
91
|
+
- url: "https://github.com/actions/upload-artifact/issues/232"
|
|
92
|
+
label: "actions/upload-artifact#232 — No files were found with the provided path"
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
id: caching-artifacts-004
|
|
2
|
-
title: "upload-artifact v3 → v4 Breaking Changes"
|
|
3
|
-
category: caching-artifacts
|
|
4
|
-
severity: error
|
|
5
|
-
tags:
|
|
6
|
-
- artifacts
|
|
7
|
-
- upload-artifact
|
|
8
|
-
- download-artifact
|
|
9
|
-
- v4
|
|
10
|
-
- compatibility
|
|
11
|
-
patterns:
|
|
12
|
-
- regex: "Artifact not found for name: .*"
|
|
13
|
-
flags: "i"
|
|
14
|
-
- regex: "Unable to find any artifacts for the associated workflow"
|
|
15
|
-
flags: "i"
|
|
16
|
-
- regex: "The requested artifact was not found"
|
|
17
|
-
flags: "i"
|
|
18
|
-
error_messages:
|
|
19
|
-
- "Artifact not found for name: build-output"
|
|
20
|
-
- "Unable to find any artifacts for the associated workflow"
|
|
21
|
-
- "The requested artifact was not found"
|
|
22
|
-
root_cause: |
|
|
23
|
-
The v4 artifact actions use a different backend and behavior than v3. Mixing
|
|
24
|
-
`actions/upload-artifact@v3` with `actions/download-artifact@v4` can produce confusing
|
|
25
|
-
artifact-not-found failures even when the earlier upload step seemed successful.
|
|
26
|
-
|
|
27
|
-
The safest rule is to keep upload and download artifact actions on the same major version,
|
|
28
|
-
and preferably migrate both sides to v4 together.
|
|
29
|
-
fix: |
|
|
30
|
-
Upgrade both upload and download steps to v4 in the same workflow or workflow chain.
|
|
31
|
-
Re-test artifact names exactly as written, because name mismatches compound the version
|
|
32
|
-
mismatch problem.
|
|
33
|
-
fix_code:
|
|
34
|
-
- language: yaml
|
|
35
|
-
label: "Use matching artifact action versions"
|
|
36
|
-
code: |
|
|
37
|
-
jobs:
|
|
38
|
-
build:
|
|
39
|
-
runs-on: ubuntu-latest
|
|
40
|
-
steps:
|
|
41
|
-
- uses: actions/checkout@v4
|
|
42
|
-
- run: npm run build
|
|
43
|
-
- uses: actions/upload-artifact@v4
|
|
44
|
-
with:
|
|
45
|
-
name: build-output
|
|
46
|
-
path: dist/
|
|
47
|
-
|
|
48
|
-
consume:
|
|
49
|
-
runs-on: ubuntu-latest
|
|
50
|
-
needs: build
|
|
51
|
-
steps:
|
|
52
|
-
- uses: actions/download-artifact@v4
|
|
53
|
-
with:
|
|
54
|
-
name: build-output
|
|
55
|
-
path: dist/
|
|
56
|
-
prevention:
|
|
57
|
-
- "Upgrade upload and download artifact actions together, not one side at a time."
|
|
58
|
-
- "Keep artifact names consistent and explicit across jobs."
|
|
59
|
-
- "Retest cross-workflow artifact usage after action major-version upgrades."
|
|
60
|
-
docs:
|
|
61
|
-
- url: "https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts"
|
|
62
|
-
label: "Store and share data with workflow artifacts"
|
|
63
|
-
- url: "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions"
|
|
64
|
-
label: "Workflow syntax for GitHub Actions"
|
|
65
|
-
source:
|
|
66
|
-
article: "https://htek.dev/articles/github-actions-debugging-guide"
|
|
67
|
-
section: "Artifact v4 breaking changes"
|
|
1
|
+
id: caching-artifacts-004
|
|
2
|
+
title: "upload-artifact v3 → v4 Breaking Changes"
|
|
3
|
+
category: caching-artifacts
|
|
4
|
+
severity: error
|
|
5
|
+
tags:
|
|
6
|
+
- artifacts
|
|
7
|
+
- upload-artifact
|
|
8
|
+
- download-artifact
|
|
9
|
+
- v4
|
|
10
|
+
- compatibility
|
|
11
|
+
patterns:
|
|
12
|
+
- regex: "Artifact not found for name: .*"
|
|
13
|
+
flags: "i"
|
|
14
|
+
- regex: "Unable to find any artifacts for the associated workflow"
|
|
15
|
+
flags: "i"
|
|
16
|
+
- regex: "The requested artifact was not found"
|
|
17
|
+
flags: "i"
|
|
18
|
+
error_messages:
|
|
19
|
+
- "Artifact not found for name: build-output"
|
|
20
|
+
- "Unable to find any artifacts for the associated workflow"
|
|
21
|
+
- "The requested artifact was not found"
|
|
22
|
+
root_cause: |
|
|
23
|
+
The v4 artifact actions use a different backend and behavior than v3. Mixing
|
|
24
|
+
`actions/upload-artifact@v3` with `actions/download-artifact@v4` can produce confusing
|
|
25
|
+
artifact-not-found failures even when the earlier upload step seemed successful.
|
|
26
|
+
|
|
27
|
+
The safest rule is to keep upload and download artifact actions on the same major version,
|
|
28
|
+
and preferably migrate both sides to v4 together.
|
|
29
|
+
fix: |
|
|
30
|
+
Upgrade both upload and download steps to v4 in the same workflow or workflow chain.
|
|
31
|
+
Re-test artifact names exactly as written, because name mismatches compound the version
|
|
32
|
+
mismatch problem.
|
|
33
|
+
fix_code:
|
|
34
|
+
- language: yaml
|
|
35
|
+
label: "Use matching artifact action versions"
|
|
36
|
+
code: |
|
|
37
|
+
jobs:
|
|
38
|
+
build:
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
- run: npm run build
|
|
43
|
+
- uses: actions/upload-artifact@v4
|
|
44
|
+
with:
|
|
45
|
+
name: build-output
|
|
46
|
+
path: dist/
|
|
47
|
+
|
|
48
|
+
consume:
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
needs: build
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/download-artifact@v4
|
|
53
|
+
with:
|
|
54
|
+
name: build-output
|
|
55
|
+
path: dist/
|
|
56
|
+
prevention:
|
|
57
|
+
- "Upgrade upload and download artifact actions together, not one side at a time."
|
|
58
|
+
- "Keep artifact names consistent and explicit across jobs."
|
|
59
|
+
- "Retest cross-workflow artifact usage after action major-version upgrades."
|
|
60
|
+
docs:
|
|
61
|
+
- url: "https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts"
|
|
62
|
+
label: "Store and share data with workflow artifacts"
|
|
63
|
+
- url: "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions"
|
|
64
|
+
label: "Workflow syntax for GitHub Actions"
|
|
65
|
+
source:
|
|
66
|
+
article: "https://htek.dev/articles/github-actions-debugging-guide"
|
|
67
|
+
section: "Artifact v4 breaking changes"
|