renovatebot / config-help

Please use the Discussions feature of https://github.com/renovatebot/renovate instead
https://github.com/renovatebot/renovate/discussions
MIT License
27 stars 16 forks source link

Create pull requests per updated files #985

Closed suzuki-shunsuke closed 4 years ago

suzuki-shunsuke commented 4 years ago

Which Renovate are you using?

WhiteSource Renovate App

Which platform are you using?

GitHub.com

Have you checked the logs? Don't forget to include them if relevant

What would you like to do?

I want to split pull requests per updated files. I try to use additionalBranchPrefix, but it seems that parentDir is not full path but the parent directory name, and if the parent directory name is same, the updates are included in the same pull request.

https://github.com/suzuki-shunsuke/test-renovate-2/blob/c69b1a5bf7e55d1f116da8b733f82fa51b790f02/renovate.json

{
  "packageRules": [
    {
      "managers": ["terraform"],
      "additionalBranchPrefix": "{{parentDir}}-",
      "packagePatterns": [".*"]
    }
  ]
}

directory structure

services/
  foo/
    staging/
      provider.tf
    production/
      provider.tf
  bar/
    staging/
      provider.tf
    production/
      provider.tf

provider.tf

provider "aws" {
  version = "~> 2.50.0"
}

There are four provider.tf and I want to update them by separated pull requests. But actually foo/staging/provider.tf and bar/staging/provider.tf are upgraded in the same pull request.

rarkins commented 4 years ago

Try baseDir instead of parentDir. Ref: https://docs.renovatebot.com/templates/

suzuki-shunsuke commented 4 years ago

Thank you for your reply. I tried baseDir and it works well. This is what I want!

https://github.com/suzuki-shunsuke/test-renovate-2/commit/8e869f2bee2fd1b68badbf70d03355c80042ed34

https://github.com/suzuki-shunsuke/test-renovate-2/pull/13 https://github.com/suzuki-shunsuke/test-renovate-2/pull/14 https://github.com/suzuki-shunsuke/test-renovate-2/pull/15 https://github.com/suzuki-shunsuke/test-renovate-2/pull/16

Thanks a lot!