From 23ca5feffc8f17fa86a831aa8831ec4dd4f35114 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Mon, 4 May 2026 08:50:40 +0200 Subject: [PATCH] Add validate-docs workflow template to create-plugin scaffolding --- .../github/workflows/validate-docs.yml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 packages/create-plugin/templates/github/workflows/validate-docs.yml diff --git a/packages/create-plugin/templates/github/workflows/validate-docs.yml b/packages/create-plugin/templates/github/workflows/validate-docs.yml new file mode 100644 index 0000000000..c3d82880f8 --- /dev/null +++ b/packages/create-plugin/templates/github/workflows/validate-docs.yml @@ -0,0 +1,43 @@ +{{!-- /* This comment is removed after scaffolding */ --}} +name: Validate documentation + +on: + push: + branches: + - main + - master + paths: + - 'docs/**' + - 'src/plugin.json' + pull_request: + branches: + - main + - master + paths: + - 'docs/**' + - 'src/plugin.json' + +jobs: + validate: + name: Validate plugin docs + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Setup Node.js environment + uses: actions/setup-node@v6 + with: + node-version: '24' + + - name: Validate plugin documentation + run: | + DOCS_PATH=$(jq -r '.docsPath // empty' src/plugin.json) + if [ -z "$DOCS_PATH" ]; then + echo "docsPath not set in src/plugin.json, skipping" + exit 0 + fi + npx --yes @grafana/plugin-docs-cli validate --strict