Skip to content

Commit 734ca08

Browse files
authored
Update main.yml
1 parent 93abe12 commit 734ca08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ jobs:
4444
run: |
4545
New-Item -Path build.log -ItemType File -Force
4646
docker build --cache-from app:latest -f docker/mount.dockerfile -t app:latest . | Tee-Object -FilePath build.log
47-
$total_steps = (Get-Content build.log | Select-String -Pattern '^Step [0-9]+/' | Measure-Object).Count
4847
$cache_hits = (Get-Content build.log | Select-String -Pattern '---> Using cache' | Measure-Object).Count
49-
if ($cache_hits -eq $total_steps) {
48+
$steps_with_cache = (Get-Content build.log | Select-String -Pattern '^Step [0-9]+/' | Where-Object { $_ -notmatch 'FROM' } | Measure-Object).Count
49+
if ($cache_hits -eq $steps_with_cache) {
5050
echo "FULL_CACHE_HIT=true" >> $env:GITHUB_ENV
5151
Write-Host "Full cache hit, all layers were used from source cache."
5252
} else {

0 commit comments

Comments
 (0)