name: PR Preview on: pull_request: branches: [ main ] paths: [ 'README.md' ] jobs: preview: runs-on: ubuntu-latest permissions: contents: read pull-requests: write steps: - name: Checkout PR uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies run: pip install pandas - name: Generate preview website run: python .github/workflows/website.py - name: Upload preview as artifact uses: actions/upload-artifact@v4 with: name: website-preview path: index.html retention-days: 7 - name: Comment PR with preview link uses: actions/github-script@v7 with: script: | const prNumber = context.payload.pull_request.number; const repoOwner = context.repo.owner; const repoName = context.repo.repo; const comment = `## 🔍 Website Preview Your changes have been processed! **📄 Preview Artifact:** Download the "website-preview" artifact from the Actions tab to view the generated HTML. --- ### 🛠️ Test locally: \`\`\`bash git checkout ${{ github.head_ref }} python scripts/dev-preview.py \`\`\` ### ✅ Validation Status: - ✅ Website generated successfully - ✅ Table format validated - ✅ Ready for review `; github.rest.issues.createComment({ issue_number: prNumber, owner: repoOwner, repo: repoName, body: comment });