From 6092fcad2ba9d8a2d2da7c7700edfff72092f6ee Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 9 Mar 2025 17:26:24 -0600 Subject: [PATCH] Refactor Base64 templates workflow to improve blueprint base64 presentation --- .github/workflows/base64-templates.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/base64-templates.yml b/.github/workflows/base64-templates.yml index 1ea55ee..ad32935 100644 --- a/.github/workflows/base64-templates.yml +++ b/.github/workflows/base64-templates.yml @@ -16,13 +16,15 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - - name: Generate base64 table + - name: Generate base64 for blueprints id: generate run: | echo "### 📝 Blueprints Base64 Table" > comment.md echo '' >> comment.md - echo '| Template | Base64 (short) |' >> comment.md - echo '|----------|----------------|' >> comment.md + + echo "
" >> comment.md + echo "🔍 Show all blueprints base64" >> comment.md + echo '' >> comment.md for dir in blueprints/*; do if [ -d "$dir" ]; then @@ -36,27 +38,20 @@ jobs: TEMPLATE_CONTENT=$(cat "$TEMPLATE_FILE") JSON="{\"compose\":\"$COMPOSE_CONTENT\",\"config\":\"$TEMPLATE_CONTENT\"}" - BASE64_JSON=$(echo -n "$JSON" | base64 -w 0) - SHORT_CONTENT="${BASE64_JSON:0:50}..." - # Add table row with short base64 preview - echo "| $TEMPLATE_NAME | \`$SHORT_CONTENT\` |" >> comment.md - - # Add collapsible full base64 section - echo '' >> comment.md - echo "
" >> comment.md - echo "🔍 $TEMPLATE_NAME Full Base64" >> comment.md + echo "#### $TEMPLATE_NAME" >> comment.md echo '' >> comment.md echo '```' >> comment.md echo "$BASE64_JSON" >> comment.md echo '```' >> comment.md - echo '
' >> comment.md echo '' fi fi done + echo '
' >> comment.md + - name: Post comment to PR uses: marocchino/sticky-pull-request-comment@v2 if: github.event_name == 'pull_request'