From 21b90ba7921082adda2afada10727ace61abfc41 Mon Sep 17 00:00:00 2001 From: Mate Molnar Date: Fri, 12 Jun 2026 21:08:12 +0200 Subject: [PATCH 1/2] Add cross-OS S3 restore regression test to test-action.yml Linux saves a workspace file to S3 with enableCrossOsArchive=true; a dependent Windows job must restore the same cache entry. Reproduces runs-on/cache v5.0.7 restoreImpl not passing enableCrossOsArchive on the S3 restore path. --- .github/workflows/test-action.yml | 51 +++++++++++++++++++++++++++++++ CLAUDE.md | 1 + 2 files changed, 52 insertions(+) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 3f31083..4ce3565 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -188,6 +188,55 @@ jobs: python -m pip install --upgrade pip pip install requests + # Reproduces: runs-on/cache S3 restore ignores enableCrossOsArchive on Windows + # Linux save with enableCrossOsArchive=true → Windows restore must hit same S3 key + test-s3-cache-cross-os-save-linux: + runs-on: github-ubuntu-latest-s + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Create cross-OS cache payload + run: echo "cross-os-test-${{ github.run_id }}" > .cross-os-cache-test.txt + - name: Save to S3 with cross-OS archive + uses: ./ + with: + path: .cross-os-cache-test.txt + key: cross-os-s3-${{ github.run_id }} + environment: dev + backend: s3 + enableCrossOsArchive: true + import-github-cache: false + + test-s3-cache-cross-os-restore-windows: + needs: test-s3-cache-cross-os-save-linux + runs-on: github-windows-latest-s + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Restore from S3 with cross-OS archive + id: cache-restore + uses: ./ + with: + path: .cross-os-cache-test.txt + key: cross-os-s3-${{ github.run_id }} + environment: dev + backend: s3 + enableCrossOsArchive: true + fail-on-cache-miss: true + import-github-cache: false + - name: Verify cache hit and restored content + shell: bash + run: | + if [[ "${{ steps.cache-restore.outputs.cache-hit }}" != "true" ]]; then + echo "::error::Expected cache-hit=true when restoring Linux S3 cache on Windows with enableCrossOsArchive=true" + exit 1 + fi + grep -q "cross-os-test-${{ github.run_id }}" .cross-os-cache-test.txt + # Reproduces: ~/.aws/config corruption from multiple credential_process entries test-s3-cache-multiple-invocations: runs-on: github-ubuntu-latest-s @@ -550,6 +599,8 @@ jobs: - test-s3-cache-with-fallback - test-s3-cache-with-credential-interference - test-s3-cache-windows + - test-s3-cache-cross-os-save-linux + - test-s3-cache-cross-os-restore-windows - test-s3-cache-multiple-invocations - test-s3-cache-with-preset-aws-config - test-s3-cache-survives-git-clean diff --git a/CLAUDE.md b/CLAUDE.md index 8ea8907..0aeeece 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -67,6 +67,7 @@ the matching job: | ----------------------------------------------------------- | ------------------------------------------------ | | User overwrites `AWS_*` in `GITHUB_ENV` mid-job | `test-s3-cache-with-credential-interference` | | Windows `~/.aws/config` parse error | `test-s3-cache-windows` | +| Linux S3 save → Windows S3 restore (`enableCrossOsArchive`) | `test-s3-cache-cross-os-save-linux` + `test-s3-cache-cross-os-restore-windows` | | Two cache steps in one job corrupting `~/.aws/config` | `test-s3-cache-multiple-invocations` | | Pre-existing `~/.aws/*` from `configure-aws-credentials` | `test-s3-cache-with-preset-aws-config` | | `git clean -ffdx` from `actions/checkout` wiping workspace | `test-s3-cache-survives-git-clean` | From dfe1a7cd3459b68c58cacbc69f73671048105c65 Mon Sep 17 00:00:00 2001 From: Mate Molnar Date: Mon, 22 Jun 2026 10:28:03 +0200 Subject: [PATCH 2/2] Fix markdownlint MD060 table alignment in CLAUDE.md --- CLAUDE.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 0aeeece..cac38ab 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -63,14 +63,14 @@ The design defends against real production failures — each has a regression-te `.github/workflows/test-action.yml`. When changing anything in the credential flow, add or update the matching job: -| Failure mode | Regression job | -| ----------------------------------------------------------- | ------------------------------------------------ | -| User overwrites `AWS_*` in `GITHUB_ENV` mid-job | `test-s3-cache-with-credential-interference` | -| Windows `~/.aws/config` parse error | `test-s3-cache-windows` | -| Linux S3 save → Windows S3 restore (`enableCrossOsArchive`) | `test-s3-cache-cross-os-save-linux` + `test-s3-cache-cross-os-restore-windows` | -| Two cache steps in one job corrupting `~/.aws/config` | `test-s3-cache-multiple-invocations` | -| Pre-existing `~/.aws/*` from `configure-aws-credentials` | `test-s3-cache-with-preset-aws-config` | -| `git clean -ffdx` from `actions/checkout` wiping workspace | `test-s3-cache-survives-git-clean` | +| Failure mode | Regression job | +| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| User overwrites `AWS_*` in `GITHUB_ENV` mid-job | `test-s3-cache-with-credential-interference` | +| Windows `~/.aws/config` parse error | `test-s3-cache-windows` | +| Linux S3 save → Windows S3 restore (`enableCrossOsArchive`) | `test-s3-cache-cross-os-save-linux` + `test-s3-cache-cross-os-restore-windows` | +| Two cache steps in one job corrupting `~/.aws/config` | `test-s3-cache-multiple-invocations` | +| Pre-existing `~/.aws/*` from `configure-aws-credentials` | `test-s3-cache-with-preset-aws-config` | +| `git clean -ffdx` from `actions/checkout` wiping workspace | `test-s3-cache-survives-git-clean` | ## Backend & cache-key logic — the non-obvious bits