Skip to content

Commit a2b83c1

Browse files
committed
fix(ci): simplify jq parsing in cleanup workflow
SHA_ONLY_RESULT is already parsed as JSON, so the -Rr flags and fromjson? conversion are unnecessary. Direct jq property access works correctly for extracting shaOnlyDeleted, totalBefore, and remaining values.
1 parent b22daec commit a2b83c1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ jobs:
318318
319319
if [ -n "$SHA_ONLY_RESULT" ] && [ "$SHA_ONLY_RESULT" != "null" ]; then
320320
AGE_DELETED=$(echo "$AGE_BASED_RESULT" | jq -r 'if type == "array" then length elif type == "object" then .ageBasedDeleted // 0 else 0 end')
321-
SHA_DELETED=$(echo "$SHA_ONLY_RESULT" | jq -Rr 'fromjson? // {} | .shaOnlyDeleted // 0')
322-
TOTAL_BEFORE=$(echo "$SHA_ONLY_RESULT" | jq -Rr 'fromjson? // {} | .totalBefore // 0')
323-
REMAINING=$(echo "$SHA_ONLY_RESULT" | jq -Rr 'fromjson? // {} | .remaining // 0')
321+
SHA_DELETED=$(echo "$SHA_ONLY_RESULT" | jq '.shaOnlyDeleted // 0')
322+
TOTAL_BEFORE=$(echo "$SHA_ONLY_RESULT" | jq '.totalBefore // 0')
323+
REMAINING=$(echo "$SHA_ONLY_RESULT" | jq '.remaining // 0')
324324
325325
echo "### Summary" >> $GITHUB_STEP_SUMMARY
326326
echo "| Metric | Count |" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)