Skip to content

Commit 3e35c4b

Browse files
authored
fix(testing) retention for image-builds-with-cache artifacts (#12735)
Signed-off-by: alyssacgoins <[email protected]>
1 parent 19f64ec commit 3e35c4b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/image-builds-with-cache.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,18 @@ jobs:
8282
echo "registry=${{ env.REGISTRY }}"
8383
} >> "$GITHUB_OUTPUT"
8484
85+
- name: Get current date
86+
id: date
87+
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
88+
8589
# Check if the image was already built for this SHA using cache
8690
- name: Check if already built
8791
id: cache-check
8892
if: ${{ github.ref_name != github.event.repository.default_branch }}
8993
uses: actions/cache@v5
9094
with:
9195
path: .build-marker-${{ matrix.image }}
92-
key: image-built-${{ matrix.image }}-${{ github.sha }}
96+
key: image-built-${{ matrix.image }}-${{ github.sha }}-${{ steps.date.outputs.date }}
9397
lookup-only: true
9498

9599
- name: Set up Docker Buildx
@@ -138,4 +142,4 @@ jobs:
138142
uses: actions/cache/save@v5
139143
with:
140144
path: .build-marker-${{ matrix.image }}
141-
key: image-built-${{ matrix.image }}-${{ github.sha }}
145+
key: image-built-${{ matrix.image }}-${{ github.sha }}-${{ steps.date.outputs.date }}

0 commit comments

Comments
 (0)