Generate command docs before website build#1764
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Deploying maester with
|
| Latest commit: |
af035a7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e493d84a.maester.pages.dev |
| Branch Preview URL: | https://samerde-website-docs-workflo.maester.pages.dev |
Up to standards ✅🟢 Issues
|
Contributor
There was a problem hiding this comment.
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.ps1and 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.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Thanks, @merill, @Mynster9361, and GitHub Copilot! ;) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-outwebsitetree 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.yamlandupdate-module-docs.yamlworkflows 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
generate-command-referencejob tobuild-website.yaml.build/Update-CommandReference.ps1script before the Docusaurus build.powershell/**andtests/**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
.github/workflows/build-website.yamlwithpowershell-yaml.git diff --check.