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