name: Verify Playwright Documentation on: pull_request: paths: - 'openmetadata-ui/src/main/resources/ui/playwright/e2e/**/*.spec.ts' - 'openmetadata-ui/src/main/resources/ui/playwright/doc-generator/**' branches: - main permissions: contents: write pull-requests: write jobs: verify-docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Setup Node.js uses: actions/setup-node@v3 with: node-version-file: 'openmetadata-ui/src/main/resources/ui/.nvmrc' cache: 'yarn' cache-dependency-path: 'openmetadata-ui/src/main/resources/ui/yarn.lock' - name: Install Dependencies working-directory: openmetadata-ui/src/main/resources/ui run: yarn install --frozen-lockfile --ignore-scripts - name: Install Playwright Browsers # We need browsers installed for 'playwright test --list' to work in some versions, # although strictly speaking just listing shouldn't require binaries if configured right. # Adding just in case. working-directory: openmetadata-ui/src/main/resources/ui run: npx playwright install chromium --with-deps - name: Generate Documentation working-directory: openmetadata-ui/src/main/resources/ui run: node playwright/doc-generator/generate.js - name: Check for Changes id: git-check run: | git diff --exit-code --quiet openmetadata-ui/src/main/resources/ui/playwright/docs || echo "changes=true" >> $GITHUB_OUTPUT - name: Commit and Push Changes if: steps.git-check.outputs.changes == 'true' run: | git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add openmetadata-ui/src/main/resources/ui/playwright/docs git commit -m "docs: auto-generate playwright documentation" git push - name: Comment on PR if: steps.git-check.outputs.changes == 'true' uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{ github.event.pull_request.number }} body: | ## 📝 Documentation Auto-Updated The Playwright documentation has been automatically updated to match the changes in this PR. * **Generated by**: `playwright-docs-check.yml` * **Status**: ✅ Updated and pushed to branch.