Skip to content

Commit 068bb21

Browse files
committed
feat: enhance content sync summary with success rate and sync status
1 parent 361fa35 commit 068bb21

1 file changed

Lines changed: 32 additions & 11 deletions

File tree

β€Ž.github/workflows/content-sync.ymlβ€Ž

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ jobs:
5151
echo "added=$added" >> $GITHUB_OUTPUT
5252
echo "updated=$updated" >> $GITHUB_OUTPUT
5353
echo "unchanged=$unchanged" >> $GITHUB_OUTPUT
54-
echo "failed=$failed" >> $GITHUB_OUTPUT
55-
echo "total=$total" >> $GITHUB_OUTPUT
54+
echo "failed=$failed" >> $GITHUB_OUTPUT echo "total=$total" >> $GITHUB_OUTPUT
5655
5756
# Check if upload failed
5857
if [ "$failed" != "0" ]; then
@@ -63,23 +62,45 @@ jobs:
6362
- name: Create Content Sync Summary
6463
if: always()
6564
run: |
65+
# Get the values from the previous step
66+
added="${{ steps.upload-content.outputs.added }}"
67+
updated="${{ steps.upload-content.outputs.updated }}"
68+
unchanged="${{ steps.upload-content.outputs.unchanged }}"
69+
failed="${{ steps.upload-content.outputs.failed }}"
70+
total="${{ steps.upload-content.outputs.total }}"
71+
article_count="${{ steps.count-articles.outputs.article-count }}"
72+
73+
# Calculate success rate
74+
if [ "$total" -gt 0 ]; then
75+
success_rate=$(( (total - failed) * 100 / total ))
76+
else
77+
success_rate=0
78+
fi
79+
80+
# Determine sync status
81+
if [ "$failed" = "0" ]; then
82+
sync_status="🟒 All Good!"
83+
else
84+
sync_status="πŸ”΄ Some Issues"
85+
fi
86+
6687
# Create a beautiful summary with emojis and markdown formatting
67-
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
88+
cat >> $GITHUB_STEP_SUMMARY << EOF
6889
## πŸ“ Content Sync Report
6990
7091
| Status | Count | Description |
7192
|--------|-------|-------------|
72-
| βœ… Added | ${{ steps.upload-content.outputs.added }} | New content files uploaded |
73-
| πŸ”„ Updated | ${{ steps.upload-content.outputs.updated }} | Existing content updated |
74-
| βšͺ Unchanged | ${{ steps.upload-content.outputs.unchanged }} | Files with no changes |
75-
| ❌ Failed | ${{ steps.upload-content.outputs.failed }} | Upload failures |
76-
| πŸ“Š **Total** | **${{ steps.upload-content.outputs.total }}** | **Total files processed** |
93+
| βœ… Added | ${added} | New content files uploaded |
94+
| πŸ”„ Updated | ${updated} | Existing content updated |
95+
| βšͺ Unchanged | ${unchanged} | Files with no changes |
96+
| ❌ Failed | ${failed} | Upload failures |
97+
| πŸ“Š **Total** | **${total}** | **Total files processed** |
7798
7899
### 🎯 Summary
79100
80-
- **Success Rate**: $(( (${{ steps.upload-content.outputs.total }} - ${{ steps.upload-content.outputs.failed }}) * 100 / ${{ steps.upload-content.outputs.total }} ))%
81-
- **Content Articles**: ${{ steps.count-articles.outputs.article-count }} total files in repository
82-
- **Sync Status**: ${{ steps.upload-content.outputs.failed == '0' && '🟒 All Good!' || 'πŸ”΄ Some Issues' }}
101+
- **Success Rate**: ${success_rate}%
102+
- **Content Articles**: ${article_count} total files in repository
103+
- **Sync Status**: ${sync_status}
83104
84105
> πŸš€ **Copilot That Jawn** content is now synced and ready to help developers level up their AI game!
85106
EOF

0 commit comments

Comments
Β (0)