version: 2
registries:
  gradle-plugin-portal:
    type: maven-repository
    url: https://plugins.gradle.org/m2
    username: dummy # Required by dependabot
    password: dummy # Required by dependabot

updates:
  - package-ecosystem: "npm"
    directory: "/sources"
    schedule:
      interval: "weekly"
    groups:
      npm-dependencies:
        patterns:
        - "*"
    ignore:
      # Keep actions/cache and actions/artifact major aligned and force actions/cache version to match patch
      - dependency-name: "*actions/cache*"
      - dependency-name: "*actions/artifact*"
        update-types: ["version-update:semver-major", "version-update:semver-minor"]

  - package-ecosystem: "github-actions"
    # github-actions with directory: "/" only monitors .github/workflows
    # https://github.com/dependabot/dependabot-core/issues/6345
    directories:
      - "/"
      - "/.github/actions/build-dist"
      - "/.github/actions/init-integ-test"
    schedule:
      interval: "weekly"
    groups:
      github-actions:
        patterns:
          - "*"

  - package-ecosystem: "gradle"
    directories:
      - ".github/workflow-samples/gradle-plugin"
      - ".github/workflow-samples/groovy-dsl"
      - ".github/workflow-samples/java-toolchain"
      - ".github/workflow-samples/kotlin-dsl"
      - ".github/workflow-samples/no-wrapper"
      - ".github/workflow-samples/no-wrapper-gradle-5"
      - "sources/test/init-scripts"
    registries:
      - gradle-plugin-portal
    schedule:
      interval: "weekly"
    groups:
      gradle:
        patterns:
          - "*"
