name: Setup documentation lint environment description: >- Provision Node, mermaid-cli, and chrome-headless-shell for every CI job that executes the blocking documentation lint gate. runs: using: composite steps: - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: "20" - name: Cache puppeteer / chrome-headless-shell uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ~/.cache/puppeteer key: puppeteer-chrome-headless-shell-${{ runner.os }}-v1 - name: Install pinned repository documentation tooling shell: bash working-directory: ${{ github.workspace }} run: | npm ci --ignore-scripts --no-audit --no-fund echo "${{ github.workspace }}/node_modules/.bin" >> "$GITHUB_PATH" - name: Install chrome-headless-shell for puppeteer shell: bash working-directory: ${{ github.workspace }} run: npx --no-install puppeteer browsers install chrome-headless-shell - name: Locate chrome-headless-shell binary shell: bash run: | set -euo pipefail CHROME_PATH=$(find "$HOME/.cache/puppeteer/chrome-headless-shell" -type f -name 'chrome-headless-shell' | head -n1) if [ -z "$CHROME_PATH" ]; then echo "ERROR: chrome-headless-shell binary not found" exit 1 fi echo "CHROME_EXECUTABLE_PATH=$CHROME_PATH" >> "$GITHUB_ENV" echo "Resolved chrome at: $CHROME_PATH" - name: Verify pinned Mermaid CLI shell: bash working-directory: ${{ github.workspace }} run: npx --no-install mmdc --version