Skip to content

Commit d34ddc0

Browse files
committed
fix(ci): isolate Actions cache writes
1 parent 9c3335a commit d34ddc0

59 files changed

Lines changed: 613 additions & 393 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/actions/setup-node-env/action.yml‎

Lines changed: 87 additions & 115 deletions
Large diffs are not rendered by default.

‎.github/actions/setup-pnpm-store-cache/action.yml‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ inputs:
1313
description: Expected Node.js version already installed by actions/setup-node.
1414
required: false
1515
default: ""
16-
use-actions-cache:
17-
description: Whether actions/cache should restore the pnpm store.
16+
cache-mode:
17+
description: Cache authority for this setup action (off, restore, or read-write).
1818
required: false
19-
default: "true"
19+
default: "off"
2020
outputs:
2121
pnpm-version:
2222
description: Resolved pnpm version activated by the setup action.
@@ -40,10 +40,18 @@ runs:
4040
id: setup-pnpm
4141
shell: bash
4242
env:
43+
CACHE_MODE: ${{ inputs.cache-mode }}
4344
PACKAGE_MANAGER_FILE: ${{ inputs.package-manager-file }}
4445
REQUESTED_NODE_VERSION: ${{ inputs.node-version }}
4546
run: |
4647
set -euo pipefail
48+
case "$CACHE_MODE" in
49+
off|restore|read-write) ;;
50+
*)
51+
echo "::error::Invalid cache-mode input: '$CACHE_MODE' (expected off, restore, or read-write)"
52+
exit 2
53+
;;
54+
esac
4755
project_dir="$(dirname "$PACKAGE_MANAGER_FILE")"
4856
if [[ ! -f "$PACKAGE_MANAGER_FILE" ]]; then
4957
echo "::error::package manager file not found: $PACKAGE_MANAGER_FILE"
@@ -88,7 +96,7 @@ runs:
8896
8997
- name: Resolve pnpm store path
9098
id: pnpm-store
91-
if: ${{ inputs.use-actions-cache == 'true' && runner.os != 'Windows' }}
99+
if: ${{ inputs.cache-mode != 'off' && runner.os != 'Windows' }}
92100
shell: bash
93101
run: |
94102
set -euo pipefail
@@ -98,7 +106,7 @@ runs:
98106
99107
- name: Restore pnpm store cache
100108
id: pnpm-store-cache
101-
if: ${{ inputs.use-actions-cache == 'true' && runner.os != 'Windows' }}
109+
if: ${{ inputs.cache-mode != 'off' && runner.os != 'Windows' }}
102110
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
103111
with:
104112
path: ${{ steps.pnpm-store.outputs.path }}

‎.github/actions/setup-release-harness/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ runs:
1010
- name: Setup trusted release harness package manager
1111
uses: ./.release-harness/.github/actions/setup-pnpm-store-cache
1212
with:
13+
cache-mode: off
1314
node-version: ${{ inputs.node-version }}
1415
package-manager-file: .release-harness/package.json
15-
use-actions-cache: "false"
1616

1717
- name: Install trusted release harness dependencies
1818
shell: bash

‎.github/workflows/android-release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ jobs:
165165
- name: Setup Node environment
166166
uses: ./.github/actions/setup-node-env
167167
with:
168+
cache-mode: off
168169
install-bun: "true"
169170
install-deps: "false"
170-
use-actions-cache: "false"
171171

172172
- name: Setup Android toolchain
173173
uses: ./.github/actions/setup-android-toolchain

‎.github/workflows/ci-build-artifacts-testbox.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ jobs:
4848
persist-credentials: false
4949

5050
- name: Setup Node environment
51+
id: setup-node-env
5152
uses: ./.github/actions/setup-node-env
5253
with:
54+
cache-mode: ${{ github.event_name == 'workflow_dispatch' && 'read-write' || 'restore' }}
5355
install-bun: "false"
5456
install-trufflehog: "true"
5557

@@ -143,7 +145,7 @@ jobs:
143145
test -f dist/control-ui/index.html
144146
145147
- name: Save dist build cache
146-
if: steps.dist-cache.outputs.cache-hit != 'true'
148+
if: steps.setup-node-env.outputs.cache-mode == 'read-write' && steps.dist-cache.outputs.cache-hit != 'true'
147149
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
148150
with:
149151
path: |

‎.github/workflows/ci-check-arm-testbox.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
- name: Setup Node environment
6060
uses: ./.github/actions/setup-node-env
6161
with:
62+
cache-mode: restore
6263
install-bun: "false"
6364
install-trufflehog: "true"
6465
- name: Ensure Testbox base commit

‎.github/workflows/ci-check-testbox.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ jobs:
5252
- name: Setup Node environment
5353
uses: ./.github/actions/setup-node-env
5454
with:
55+
cache-mode: restore
5556
install-bun: "false"
5657
install-trufflehog: "true"
5758
# Testbox hydration uses the ordinary pnpm store cache. Canonical CI
5859
# owns the exact dependency archive and never delegates here.
59-
use-actions-cache: "true"
6060
- name: Ensure Testbox base commit
6161
if: github.event_name == 'pull_request'
6262
uses: ./.github/actions/ensure-base-commit

‎.github/workflows/ci.yml‎

Lines changed: 39 additions & 64 deletions
Large diffs are not rendered by default.

‎.github/workflows/codeql-android-critical-security.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
- name: Setup Node environment
3838
uses: ./.github/actions/setup-node-env
3939
with:
40+
cache-mode: restore
4041
install-bun: "false"
4142

4243
- name: Initialize CodeQL

‎.github/workflows/control-ui-locale-refresh.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ jobs:
166166
- name: Setup Node environment
167167
uses: ./.github/actions/setup-node-env
168168
with:
169+
cache-mode: restore
169170
install-bun: "false"
170171

171172
- name: Ensure translation provider secrets exist
@@ -303,6 +304,7 @@ jobs:
303304
- name: Setup Node environment
304305
uses: ./.github/actions/setup-node-env
305306
with:
307+
cache-mode: restore
306308
install-bun: "false"
307309

308310
- name: Finalize control UI generated artifacts

0 commit comments

Comments
 (0)