webpack/webpack-cli

View on GitHub
.github/workflows/update-docs.yml

Summary

Maintainability
Test Coverage
name: webpack-cli docs

on:
  pull_request:
    types: [labeled]

env:
  GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
  update-docs:
    name: Update docs

    if: contains(github.event.pull_request.labels.*.name, 'update docs')

    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-latest]
        node-version: [lts/*]

    steps:
      - name: Checkout Codebase
        uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.ref }}
          token: ${{ env.GITHUB_ACCESS_TOKEN }}

      - name: Using Node v${{ matrix.node-version }}
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
          cache: "yarn"

      - name: Install dependencies
        run: yarn --frozen-lockfile

      - name: Install latest webpack and webpack-dev-server version
        run: yarn add -W webpack-dev-server@latest webpack@latest

      - name: Bootstrap
        run: yarn lerna bootstrap

      - name: Build
        run: yarn build

      - name: Update docs
        run: yarn update:docs

      - name: Fix formatting
        run: yarn lint:prettier --write

      - name: Commit updated docs
        uses: EndBug/add-and-commit@v9.0.0
        with:
          add: "*.md"
          message: "docs: update options"
          author_name: Nitin Kumar
          author_email: snitin315@gmail.com