This repository was archived by the owner on Jan 28, 2026. It is now read-only.
Screenshot feature #39
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: GUI Screenshots in PR | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| permissions: | |
| pull-requests: write | |
| jobs: | |
| capture-screenshots: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 3 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Playwright | |
| run: npm install playwright | |
| - name: Capture and embed screenshots | |
| id: screenshots | |
| run: | | |
| # Create output directory | |
| mkdir -p screenshots | |
| # Run screenshot script | |
| node scripts/screenshot.js | |
| # Get base64 images and set output | |
| IMAGES_MARKDOWN="" | |
| for file in screenshots/*.jpg; do | |
| [ -e "$file" ] || continue | |
| base64_data=$(base64 -w0 "$file") | |
| IMAGES_MARKDOWN+="\n\n" | |
| done | |
| # Escape newlines for output | |
| IMAGES_MARKDOWN="${IMAGES_MARKDOWN//$'\n'/'%0A'}" | |
| echo "images=$IMAGES_MARKDOWN" >> $GITHUB_OUTPUT | |
| - name: Post images to PR | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| header: gui-screenshots | |
| message: | | |
| ## 🖼️ Automated UI Preview | |
| ${{ steps.screenshots.outputs.images }} |