Skip to content

Commit b4855f2

Browse files
committed
fix: update purged count calculation to handle errors gracefully
1 parent 4f9fac1 commit b4855f2

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

.github/workflows/cleanup-container-images.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,8 @@ jobs:
114114
/dev/null)
115115
116116
exit_code=$?
117-
118-
# Count purged images by looking for lines with "Deleted manifest" in the output
119-
purged_count=$(echo "$purge_output" | grep -c "Deleted manifest" || echo 0)
117+
# Count purged images by looking for lines with "Deleted manifest" in the output
118+
purged_count=$(echo "$purge_output" | grep -c "Deleted manifest" || true)
120119
echo "purged_count=$purged_count" >> $GITHUB_OUTPUT
121120
122121
if [ $exit_code -eq 0 ]; then

0 commit comments

Comments
 (0)