Skip to content

feat: move route53 dns BBs to meshstack-hub #44

feat: move route53 dns BBs to meshstack-hub

feat: move route53 dns BBs to meshstack-hub #44

Workflow file for this run

name: Generate Icon Prompts for Missing Logos
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'modules/**/buildingblock/README.md'
permissions:
pull-requests: write
contents: read
jobs:
check-missing-logos:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install pyyaml
- name: Find missing logos and generate prompts
id: generate
run: |
python .github/scripts/generate-icon-prompts.py > prompts.json
COUNT=$(jq 'length' prompts.json)
echo "has_missing=$([ "$COUNT" -gt 0 ] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
echo "count=$COUNT" >> $GITHUB_OUTPUT
- name: Read prompts
if: steps.generate.outputs.has_missing == 'true'
id: read_prompts
run: |
PROMPTS=$(cat prompts.json)
echo "prompts<<EOF" >> $GITHUB_OUTPUT
echo "$PROMPTS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Generate PR comment
if: steps.generate.outputs.has_missing == 'true'
id: format_comment
uses: actions/github-script@v7
env:
PROMPTS_JSON: ${{ steps.read_prompts.outputs.prompts }}
with:
result-encoding: string
script: |
const prompts = JSON.parse(process.env.PROMPTS_JSON);
if (prompts.length === 0) {
return '';
}
let comment = '## 🎨 Missing Building Block Icons\n\n';
comment += `Found **${prompts.length}** building block(s) without \`logo.png\` files.\n\n`;
comment += 'Copy the **AI Prompts** below and use them with your favorite AI image generator (Gemini, DALL-E, Midjourney, Stable Diffusion, etc.).\n\n';
comment += 'Then follow the **Post-Processing Steps** to prepare the icons for upload.\n\n';
comment += '---\n\n';
for (const item of prompts) {
comment += `### ${item.name}\n\n`;
comment += `**Platform:** \`${item.platform}\`\n\n`;
comment += `**Path:** \`${item.logo_path}\`\n\n`;
comment += '#### AI Prompt (copy this to image generator)\n\n';
comment += '```\n';
comment += item.ai_prompt;
comment += '\n```\n\n';
comment += '#### Post-Processing Instructions\n\n';
comment += item.post_processing;
comment += '\n\n';
comment += '---\n\n';
}
return comment;
- name: Find existing comment
if: steps.generate.outputs.has_missing == 'true'
uses: peter-evans/find-comment@v3
id: find_comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: '🎨 Missing Building Block Icons'
- name: Create or update comment
if: steps.generate.outputs.has_missing == 'true'
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.format_comment.outputs.result }}
edit-mode: replace
- name: Success message
if: steps.generate.outputs.has_missing == 'false'
run: |
echo "✅ All building blocks have logo.png files!"