Skip to content

Commit b7b6410

Browse files
committed
chore: apply copilot suggestion
1 parent 6a2e215 commit b7b6410

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/go_app_pull_requests.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,22 @@ jobs:
231231
exit 1
232232
fi
233233
echo "✅ integrations-testsuite image verified"
234+
# Get hash of Docker images list for cache key
235+
- name: Hash Docker images list
236+
if: ${{ inputs.GO_TEST_INTEGRATION_ENABLED && inputs.DOCKER_CACHE_IMAGES != '' }}
237+
id: images-hash
238+
run: |
239+
HASH=$(echo "${{ inputs.DOCKER_CACHE_IMAGES }}" | sha256sum | cut -d' ' -f1 | head -c 12)
240+
echo "hash=${HASH}" >> $GITHUB_OUTPUT
234241
# Cache custom Docker images (specified by caller)
235242
- name: Cache custom Docker images
236243
if: ${{ inputs.GO_TEST_INTEGRATION_ENABLED && inputs.DOCKER_CACHE_IMAGES != '' }}
237244
uses: actions/cache@v4
238245
with:
239246
path: /tmp/.custom-docker-cache
240-
key: docker-custom-images-${{ runner.os }}-${{ github.run_number % 20 }}-v1
247+
key: docker-custom-images-${{ runner.os }}-${{ steps.images-hash.outputs.hash }}-${{ github.run_number % 20 }}-v1
241248
restore-keys: |
242-
docker-custom-images-${{ runner.os }}-
249+
docker-custom-images-${{ runner.os }}-${{ steps.images-hash.outputs.hash }}-
243250
# Pre-pull custom Docker images before running tests
244251
- name: Load or pull custom Docker images
245252
if: ${{ inputs.GO_TEST_INTEGRATION_ENABLED && inputs.DOCKER_CACHE_IMAGES != '' }}

0 commit comments

Comments
 (0)