version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
      time: "06:00"
      timezone: "America/Chicago"
    labels: []
    commit-message:
      prefix: "ci"
    ignore:
      # These actions deliver the latest versions by updating the major
      # release tag, so ignore minor and patch versions
      - dependency-name: "actions/*"
        update-types:
          - version-update:semver-minor
          - version-update:semver-patch
      - dependency-name: "Apple-Actions/import-codesign-certs"
        update-types:
          - version-update:semver-minor
          - version-update:semver-patch
      - dependency-name: "marocchino/sticky-pull-request-comment"
        update-types:
          - version-update:semver-minor
          - version-update:semver-patch
    groups:
      github-actions:
        patterns:
          - "*"

  - package-ecosystem: "gomod"
    directory: "/"
    schedule:
      interval: "weekly"
      time: "06:00"
      timezone: "America/Chicago"
    commit-message:
      prefix: "chore"
    labels: []
    ignore:
      # Ignore patch updates for all dependencies
      - dependency-name: "*"
        update-types:
          - version-update:semver-patch
    groups:
      otel:
        patterns:
          - "go.nhat.io/otelsql"
          - "go.opentelemetry.io/otel*"
      golang-x:
        patterns:
          - "golang.org/x/*"

  # Update our Dockerfile.
  - package-ecosystem: "docker"
    directory: "/scripts/"
    schedule:
      interval: "weekly"
      time: "06:00"
      timezone: "America/Chicago"
    commit-message:
      prefix: "chore"
    labels: []
    ignore:
      # We need to coordinate terraform updates with the version hardcoded in
      # our Go code.
      - dependency-name: "terraform"
    groups:
      scripts-docker:
        patterns:
          - "*"

  - package-ecosystem: "npm"
    directory: "/site/"
    schedule:
      interval: "monthly"
      time: "06:00"
      timezone: "America/Chicago"
    reviewers:
      - "coder/ts"
    commit-message:
      prefix: "chore"
    labels: []
    ignore:
      # Ignore patch updates for all dependencies
      - dependency-name: "*"
        update-types:
          - version-update:semver-patch
      # Ignore major updates to Node.js types, because they need to
      # correspond to the Node.js engine version
      - dependency-name: "@types/node"
        update-types:
          - version-update:semver-major
    groups:
      react:
        patterns:
          - "react*"
          - "@types/react*"
      xterm:
        patterns:
          - "xterm*"
      xstate:
        patterns:
          - "xstate"
          - "@xstate*"
      mui:
        patterns:
          - "@mui*"
      storybook:
        patterns:
          - "@storybook*"
          - "storybook*"
      eslint:
        patterns:
          - "eslint*"
          - "@eslint*"
          - "@typescript-eslint/eslint-plugin"
          - "@typescript-eslint/parser"

  - package-ecosystem: "npm"
    directory: "/offlinedocs/"
    schedule:
      interval: "monthly"
      time: "06:00"
      timezone: "America/Chicago"
    reviewers:
      - "coder/ts"
    commit-message:
      prefix: "chore"
    labels: []
    ignore:
      # Ignore patch updates for all dependencies
      - dependency-name: "*"
        update-types:
          - version-update:semver-patch
      # Ignore major updates to Node.js types, because they need to
      # correspond to the Node.js engine version
      - dependency-name: "@types/node"
        update-types:
          - version-update:semver-major

  # Update dogfood.
  - package-ecosystem: "terraform"
    directory: "/dogfood/"
    schedule:
      interval: "weekly"
      time: "06:00"
      timezone: "America/Chicago"
    commit-message:
      prefix: "chore"
    labels: []
    ignore:
      # We likely want to update this ourselves.
      - dependency-name: "coder/coder"
