2

We would like to have dependabot update our submodules in different intervals. For example, google test has new commits almost every day but we probably won't need them immediately, so updating once a month is enough and we won't get spammed by pull requests from dependabot. For another submodule, we want updates as soon as possible, so we would like dependabot to update it daily.

I tried adding a second submodules section in dependabot.yml that only allows the submodule we want to update more frequently:

version: 2
updates:
  - package-ecosystem: "gitsubmodule"
    directory: "/"
    schedule:
      interval: "monthly"
  - package-ecosystem: "gitsubmodule"
    directory: "/"
    schedule:
      interval: "daily"
    allow:
      - dependency-name: "extern/<important-submodule>"

but that gave an error:

Your .github/dependabot.yml contained invalid details Dependabot encountered the following error when parsing your .github/dependabot.yml:

The property '#/updates/1' is a duplicate. Update configs must have a unique combination of 'package-ecosystem', 'directory', and 'target-branch'

Please update the config file to conform with Dependabot's specification.

Is this simply not possible or am I missing something?

Dezi
  • 172
  • 1
  • 12

1 Answers1

1

It is all told in the error message: you have the same directory set for both clauses as "/". Once fixed, you should be able to get what you want.

Romain Prévost
  • 513
  • 2
  • 12
  • That doesn't seem to work for git submodules because they are all defined in `.gitmodules` in the repositories root directory. When I use `directory: "extern/"` I get: Dependabot couldn't find the submodule /extern//.gitmodules Dependabot couldn't find a .gitmodules. Dependabot requires a .gitmodules to evaluate your Git dependencies. It had expected to find one at the path: /extern//.gitmodules. If this isn't a Git project, you may wish to disable updates for it in the .github/dependabot.yml config file in this repo. – Dezi Nov 07 '22 at 09:36