Skip to content

Generate command docs before website build#1764

Merged
merill merged 2 commits into
mainfrom
samerde/website-docs-workflow
May 11, 2026
Merged

Generate command docs before website build#1764
merill merged 2 commits into
mainfrom
samerde/website-docs-workflow

Conversation

@SamErde
Copy link
Copy Markdown
Contributor

@SamErde SamErde commented May 11, 2026

Summary

Fixes the website build workflow so generated command-reference docs are available before Docusaurus runs link validation.

This was suggested by @Mynster9361 in #1755 (comment) after new CIS tests linked to command docs that had not yet been generated in the PR branch.

Problem

Build Website / Build Docusaurus website 🏗️ (pull_request) currently builds the checked-out website tree as-is. When a PR adds new PowerShell test commands and generated test docs link to /docs/commands/<CommandName>, the Docusaurus build can fail because the generated command-reference pages are not committed yet.

The existing build-docs.yaml and update-module-docs.yaml workflows generate those command docs, but they create pull requests using the Maester bot GitHub App token. Calling those write-oriented workflows from the PR website build would make the validation path more privileged and less reliable for pull requests.

Solution

  • Add a read-only generate-command-reference job to build-website.yaml.
  • Run the existing build/Update-CommandReference.ps1 script before the Docusaurus build.
  • Pass the generated command docs to the website build job via a workflow artifact.
  • Keep broad powershell/** and tests/** PR path filters so future docs-generation inputs under those trees still trigger website validation.

Token / permissions notes

This does not call the PR-creating docs workflows and does not need the GitHub App token. The workflow keeps repository write permissions out of the pull request validation path and only uses read/artifact permissions needed to build and download generated docs.

Validation

  • Parsed .github/workflows/build-website.yaml with powershell-yaml.
  • Ran git diff --check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 11, 2026

Deploying maester with  Cloudflare Pages  Cloudflare Pages

Latest commit: af035a7
Status: ✅  Deploy successful!
Preview URL: https://e493d84a.maester.pages.dev
Branch Preview URL: https://samerde-website-docs-workflo.maester.pages.dev

View logs

Copilot AI review requested due to automatic review settings May 11, 2026 09:15
@SamErde SamErde requested a review from a team as a code owner May 11, 2026 09:15
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 11, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the PR website validation workflow so command-reference docs are generated during CI before the Docusaurus build runs, preventing link-validation failures when new commands are introduced but generated docs aren’t committed in the PR branch.

Changes:

  • Expands PR path filters so website validation also runs when PowerShell/tests and the command-doc generator script change.
  • Adds a Windows job to run build/Update-CommandReference.ps1 and upload the generated command docs as an artifact.
  • Downloads and overlays the generated command docs into the website workspace before npm run build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build-website.yaml
Comment thread .github/workflows/build-website.yaml
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SamErde SamErde added bug Something isn't working documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code automation labels May 11, 2026
@SamErde SamErde requested a review from merill May 11, 2026 09:41
Copy link
Copy Markdown
Contributor

@merill merill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@merill merill merged commit f5b948d into main May 11, 2026
11 checks passed
@SamErde SamErde deleted the samerde/website-docs-workflow branch May 11, 2026 09:55
@SamErde
Copy link
Copy Markdown
Contributor Author

SamErde commented May 11, 2026

Thanks, @merill, @Mynster9361, and GitHub Copilot! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation bug Something isn't working documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants