#
# This GitHub action checks plugin repositories for valid docs.
#
# This provides a quick assessment on PRs of whether
# there might be issues with docs in plugin repositories.
#
# This is intended to help debug Vercel build issues, which
# may or may not be related to docs in plugin repositories.

name: "website: Check plugin docs"
on:
  pull_request:
    paths:
      - "website/**"
  schedule:
    - cron: "45 0 * * *"

permissions:
  contents: read

jobs:
  check-plugin-docs:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
      - name: Setup Node
        uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
        with:
          node-version: '16.x'
      - name: Install Dependencies
        run: npm i @hashicorp/platform-packer-plugins
      - name: Fetch and validate plugin docs
        run: node .github/workflows/check-plugin-docs.js
