mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
Refactor Base64 templates workflow to improve blueprint base64 presentation
This commit is contained in:
parent
5d441530f0
commit
6092fcad2b
21
.github/workflows/base64-templates.yml
vendored
21
.github/workflows/base64-templates.yml
vendored
@ -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 "<details>" >> comment.md
|
||||
echo "<summary>🔍 Show all blueprints base64</summary>" >> 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 "<details>" >> comment.md
|
||||
echo "<summary>🔍 $TEMPLATE_NAME Full Base64</summary>" >> comment.md
|
||||
echo "#### $TEMPLATE_NAME" >> comment.md
|
||||
echo '' >> comment.md
|
||||
echo '```' >> comment.md
|
||||
echo "$BASE64_JSON" >> comment.md
|
||||
echo '```' >> comment.md
|
||||
echo '</details>' >> comment.md
|
||||
echo ''
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo '</details>' >> comment.md
|
||||
|
||||
- name: Post comment to PR
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
if: github.event_name == 'pull_request'
|
||||
|
Loading…
Reference in New Issue
Block a user