From 43a67aaa4e4b1ad5cf7845082155c31a61ab24de Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 1 Nov 2026 01:25:23 +0000 Subject: [PATCH] CI: key the package caches on the runner image ImageOS and ImageVersion are the runner's environment variables, not the workflow's env context, so ${{ env.ImageVersion }} was empty and the cache key never changed with the image. Build the key in the shell. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01B82eRUAp3wTZAV7UCEiC4S --- .github/actions/apt/action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/apt/action.yml b/.github/actions/apt/action.yml index 089068d..d6a60f2 100644 --- a/.github/actions/apt/action.yml +++ b/.github/actions/apt/action.yml @@ -30,13 +30,14 @@ runs: run: | pkgs=$(printf '%s\n' $PKGS | sort -u | tr '\n' ' ') echo "pkgs=$pkgs" >> "$GITHUB_OUTPUT" - echo "hash=$(printf '%s|%s|%s' "$pkgs" "$PPA" "$REC" | sha256sum | cut -c1-16)" >> "$GITHUB_OUTPUT" + # (ImageOS, ImageVersion: the runner's environment, not the env context) + echo "key=apt-${ImageOS:-none}-$RUNNER_ARCH-${ImageVersion:-none}-$(printf '%s|%s|%s' "$pkgs" "$PPA" "$REC" | sha256sum | cut -c1-16)" >> "$GITHUB_OUTPUT" - id: restore uses: actions/cache/restore@v4 with: path: /tmp/apt-cache - key: apt-${{ env.ImageOS }}-${{ runner.arch }}-${{ env.ImageVersion }}-${{ steps.key.outputs.hash }} + key: ${{ steps.key.outputs.key }} - id: install shell: bash