feat: build plugin docs as part of package-plugin when docsPath is set - #219
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an optional documentation build step to the package-plugin composite action so that plugins declaring docsPath can ship multi-page docs artifacts inside the packaged ZIP (and onward to the CDN pipeline).
Changes:
- Adds a “Build plugin documentation” step that runs
npx @grafana/plugin-docs-cli buildwhendocsPathis set indist/plugin.json.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - name: Build plugin documentation | ||
| shell: bash | ||
| run: | | ||
| sudo apt-get install jq |
There was a problem hiding this comment.
I am not 100% sure we can just assume the runner for this action is going to be debian-based. You can move this into a two steps where a nodejs script reads the json and exports the docs_path and the other uses it.
Unless I am mistaken and we are already running apt commands in other parts of this build action
There was a problem hiding this comment.
We already use debian-based commands in this action - see for exampel
plugin-actions/package-plugin/action.yml
Line 135 in ed068c2
What this PR does / why we need it:
Adds a "Build plugin documentation" step to
package-pluginthat runsnpx @grafana/plugin-docs-cli buildwhendocsPathis set indist/plugin.json. The step generatesdist/docs/manifest.jsonand copies the markdown and images, so multi-page docs ride along in the resulting ZIP and reach the CDN through the existing pipeline.Plugins without
docsPathare unaffected - the bash conditional short-circuits before invoking the CLI.Which issue(s) this PR fixes:
No issue - part of the multi-page plugin docs initiative.
Special notes for your reviewer: