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