Is it possible to select a specific branch against which Dependabot should open PR's?
Asked Answered
W

1

27

Like the title says, on GitHub is it possible to manually select a branch against which Dependabot should open its Pull Requests?

From what I can see, it opens PR against whichever branch is set to be the main one in the repo settings, but it is possible to select another one?

Wheels answered 13/4, 2021 at 20:17 Comment(0)
R
24

According to the documentation, this is possible with the option target-branch. For example, if you want to have the updates from the branch develop, you can write the following configuration for the python pip environment:

version: 2
updates:
  - package-ecosystem: "pip"
    directory: "/"
    schedule:
      interval: "daily"
    # Raise pull requests for version updates
    # to pip against the `develop` branch
    target-branch: "develop"
    # Labels on pull requests for version updates only
    labels:
      - "pip dependencies"
Repartition answered 13/4, 2021 at 20:32 Comment(4)
Than you, I overlooked this. The docs also report this When you use this option, the settings for this package manager will no longer affect any pull requests raised for security updates., what exactly does it means?Wheels
It just means that you can't set the target branch for security updates, if I understand it correctly. I.e. the settings for the package manager then have no influence on the security updates.Repartition
It seems crazy to not have security update then. I'd like to get all update suggestions for master and, for example, the v3 release branch. Would I just put in two blocks like this and it would all work?Resistance
I think you can just add the configurations for the two branches and then the security updates will be created as well. And for the default branch the security updates are always created.Repartition

© 2022 - 2024 — McMap. All rights reserved.