Cédric OLIVIER
Cédric OLIVIER

Reputation: 63

How to configure renovate to switch from gitlab-release to git-tags

My goal is to update all includes in my gitlab-ci.yml files. By default without any custom configuration renovate create MR with an include update based on gitlab-release.

But today, I have some includes only based on tag and there isn't any release associated to this tag. I looking for a solution to update also these includes.

To explain, if I have a release for myprojet named 1.2.3 and tag 1.2 and 1

include:
  # Bash template
  - project: "myproject"
    ref: "1.2.2"
    file: "templates/gitlab-ci.yml"

renovate detects there is a new release on 1.2.3 - It's OK If I have :

include:
  # Bash template
  - project: "myproject"
    ref: "1.1"
    file: "templates/gitlab-ci.yml"

renovate don't detect tag named 1.2 for myproject

Upvotes: 0

Views: 909

Answers (1)

StinkyPointer
StinkyPointer

Reputation: 37

have you tried regex managers? here's an example, change it for your needs:

  "regexManagers": [
    {
      "fileMatch": ["(^|/)\\.?gitlab-ci\\.yml$"],
      "matchStringsStrategy": "combination",
      "matchStrings": [
          "\\s\\sCHART_SOURCES_URL: \"(?<depName>.*?)\"\n",
              "\\s\\sCHART_SOURCES_VERSION: \"(?<currentValue>.*?)\"\n"
      ],
      "datasourceTemplate": "git-tags"
    }
  ],

i believe you could also set enabled=false for the actual gitlab-ci manager using matchManagers in package rules

Upvotes: 0

Related Questions