feat(executive-summary): add executive summary tab with WoW metrics, callouts, and data pipeline #55
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
| # Updates PR description with before/after preview URLs (AEM Live style). | |
| # See specs/006-pr-description-checklist/ for contract and quickstart. | |
| name: Update PR Description | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| update-pr-description: | |
| name: Update PR Description | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.draft == false | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Update Pull Request Description | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { data: pr } = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number | |
| }); | |
| const sectionHeading = '## Preview URLs'; | |
| if (pr.body && pr.body.includes(sectionHeading)) { | |
| console.log('Preview URLs section already exists, skipping update'); | |
| return; | |
| } | |
| const baseBranch = (context.payload.repository && context.payload.repository.default_branch) || 'dev'; | |
| const headRef = context.payload.pull_request.head.ref || ''; | |
| const branchName = headRef | |
| .replace(/[^a-zA-Z0-9-]/g, '-') | |
| .replace(/-+/g, '-') | |
| .replace(/^-|-$/g, '') || headRef || 'main'; | |
| const repoSlug = (context.repo.repo || 'forms-rum-dashboard').toLowerCase(); | |
| const org = (context.repo.owner || 'adobe').toLowerCase(); | |
| const beforeUrl = `https://${baseBranch}--${repoSlug}--${org}.aem.live/index.html`; | |
| const afterUrl = `https://${branchName}--${repoSlug}--${org}.aem.live/index.html`; | |
| const testSection = ` | |
| ${sectionHeading} | |
| **Before (baseline)**: ${beforeUrl} | |
| **After (this branch)**: ${afterUrl} | |
| `; | |
| const updatedBody = (pr.body || '') + testSection; | |
| await github.rest.pulls.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number, | |
| body: updatedBody | |
| }); | |
| console.log('PR description updated with before/after preview URLs'); |