fix(ci): make Docs AI Review workflow work for fork PRs (#3577)

## Summary

Fix two related issues in `.github/workflows/docs-ai-review.yml` so that
the Docs AI Review packet + advisory comment works for fork-originated
PRs (which is the common case in this repo).

- **Rerun on push when labeled.** The `pull_request` trigger previously
only listed the `labeled` action, so the workflow ran exactly once when
the `ai-review-docs` label was first applied and did not re-run when the
PR was updated with new commits. Add `synchronize` and `reopened` to the
types list, and gate those two actions on the `ai-review-docs` label
already being present on the PR.
- **Split the advisory comment into a `workflow_run` workflow.** Pull
requests from forks run `pull_request` workflows with a read-only
`GITHUB_TOKEN` regardless of declared `permissions:`, so the inline
comment step could never post on fork PRs and returned 403 on both the
GraphQL `addComment` mutation (via `gh pr comment`) and the REST
`issues/{n}/comments` endpoint. Following the standard GitHub pattern:
- `docs-ai-review.yml` (pull_request trigger) now only prepares the
packet and uploads it, together with a `pr-metadata.json` describing PR
number / head SHA / base SHA / trigger name.
- A new `docs-ai-review-comment.yml` (`workflow_run` trigger) downloads
the artifact from the completed run, parses the metadata, and upserts
the advisory comment via REST. Because `workflow_run` runs in the
base-repo context, its `GITHUB_TOKEN` honors `issues: write` even for
fork PRs.

The comment workflow does not check out or execute any code from the
fork — it only consumes the prebuilt packet and metadata JSON — so it
avoids the footgun usually associated with giving write permissions to
fork-triggered runs.

## Test plan

- [ ] After merge, open a fresh fork PR and add the `ai-review-docs`
label — confirm `Docs AI Review` runs (prepare packet + upload
artifact).
- [ ] Confirm `Docs AI Review Comment` fires via `workflow_run`
afterwards and upserts a comment with the packet metadata.
- [ ] Push a follow-up commit to the same PR — confirm `Docs AI Review`
reruns on `synchronize` because the label is still applied, and the
advisory comment is updated in place (PATCH path).
- [ ] Post `/review-docs` as a COLLABORATOR/MEMBER on a PR — confirm
`Docs AI Review` runs via `issue_comment` and the comment workflow
follows.
- [ ] Remove the label, push again — confirm `Docs AI Review` no longer
runs.
2 files changed
tree: 2d386c70b4c02bf8b26208bc6371110747ed8f15
  1. .docs-governance/
  2. .github/
  3. .vscode/
  4. blog/
  5. community/
  6. config/
  7. developer_docs/
  8. docs/
  9. i18n/
  10. ja-build/
  11. ja-source/
  12. releasenotes/
  13. scripts/
  14. shared/
  15. src/
  16. static/
  17. templates/
  18. tools/
  19. userCases/
  20. versioned_docs/
  21. versioned_sidebars/
  22. website-quality-governance/
  23. .asf-site.yaml
  24. .asf.yaml
  25. .dlc.json
  26. .gitignore
  27. .gitmodules
  28. .markdownlint.json
  29. .prettierrc.js
  30. AGENTS.md
  31. author.yml
  32. auto_correct_format.py
  33. build-docs.sh
  34. build.sh
  35. buildVersions.json
  36. check_all_deadlink.py
  37. check_docs_version_diff.py
  38. check_move.py
  39. check_move_global.py
  40. crowdin.yml
  41. cspell.json
  42. docusaurus.config.js
  43. LICENSE
  44. local_build_docs.sh
  45. local_dev.sh
  46. modify-deadlink.py
  47. package.json
  48. README.md
  49. sidebars.ts
  50. sidebarsCommunity.json
  51. sidebarsReleases.json
  52. store_format_v3.md
  53. tailwind.config.js
  54. TOC.md
  55. tsconfig.json
  56. versions.json
  57. yarn.lock
README.md

Apache Doris Website

Source code for doris.apache.org, built with Docusaurus 3.

Quick Start

Prerequisites

  • Node.js >= 18
  • Yarn

Local Development

Use local_dev.sh to run the site locally. It handles dependency installation, version filtering, and memory settings automatically.

# Start English dev server (default: only 'current' version, 2 GB memory)
./local_dev.sh

# Start Chinese dev server
./local_dev.sh start-zh

# Start on a custom port
./local_dev.sh start --port 8080

# Build a specific doc version
./local_dev.sh start --versions "4.x"

# Build English docs (production build)
./local_dev.sh build

# Build all locales (en + zh-CN)
./local_dev.sh build-all

# Clean build artifacts and caches
./local_dev.sh clean

Run ./local_dev.sh help for all available commands and options.

Production Build

export NODE_OPTIONS=--max-old-space-size=8192
yarn install
yarn docusaurus build --locale en --locale zh-CN

The output is generated in the build/ directory.

Directory Structure

.
├── docs/                         # Current (dev) version docs (English)
├── versioned_docs/
│   ├── version-4.x/              # 4.x version docs (English)
│   ├── version-3.x/              # 3.x version docs (English)
│   └── version-2.1/              # 2.1 version docs (English)
├── i18n/zh-CN/
│   └── docusaurus-plugin-content-docs/
│       ├── current/              # Current (dev) version docs (Chinese)
│       ├── version-4.x/          # 4.x version docs (Chinese)
│       ├── version-3.x/          # 3.x version docs (Chinese)
│       └── version-2.1/          # 2.1 version docs (Chinese)
├── blog/                         # Blog posts
├── community/                    # Community docs
├── src/                          # React components and pages
├── static/                       # Static assets (images, JS, CSS)
├── sidebars.ts                   # Sidebar for current (dev) docs
├── versioned_sidebars/           # Sidebar files per version
│   ├── version-4.x-sidebars.json
│   ├── version-3.x-sidebars.json
│   └── version-2.1-sidebars.json
├── sidebarsCommunity.json        # Sidebar for community docs
├── versions.json                 # Active doc versions
├── docusaurus.config.js          # Docusaurus configuration
└── local_dev.sh                  # Local development helper script

Contributing Documentation

For general contribution guidelines, see:

Editing Docs

When modifying docs, you typically need to update both the English and Chinese versions in the corresponding directories:

VersionEnglishChineseSidebar
Current (dev)docs/i18n/zh-CN/.../current/sidebars.ts
4.xversioned_docs/version-4.x/i18n/zh-CN/.../version-4.x/versioned_sidebars/version-4.x-sidebars.json
3.xversioned_docs/version-3.x/i18n/zh-CN/.../version-3.x/versioned_sidebars/version-3.x-sidebars.json
2.1versioned_docs/version-2.1/i18n/zh-CN/.../version-2.1/versioned_sidebars/version-2.1-sidebars.json

Note: When adding a new page, you must also add its path to the corresponding sidebar file, otherwise it will not appear in the navigation.

Editing Blog Posts

Blog posts are located in the blog/ directory. Submit a PR to add or modify blog content.

Editing Community Docs

Community docs are in community/, with navigation controlled by sidebarsCommunity.json. Chinese community content lives under i18n/zh-CN/docusaurus-plugin-content-docs-community/.

Images

All images are stored in static/images/. Use hyphens to separate words in filenames (e.g., query-profile-example.png).

![Description of the image](/images/my-screenshot.png)

CI / Deployment

The site is deployed via GitHub Actions:

WorkflowTriggerDescription
cron-deploy-website.ymlDaily at 01:00 AMSyncs from Doris master branch and deploys
manual-deploy-website.ymlManualDeploy from a specified branch
build-check.ymlOn PRValidates the build passes (incrementally by detected version)