Search code examples
azure-devopsazure-pipelinessemantic-versioningrenovate

How to force renovate to set azure pipeline task from "x@1" to "x@2" instead of "[email protected]"


[CONTEXT]

I use renovate (azure-pipeline manager) to update my YML azure pipelines tasks.

[NEED]

If my pipeline calls my-task@1, I don't want a PR that sets [email protected], I want to keep this notation my-task@2.

Hence, I keep using the latest minor/patch at each execution.

[RESEARCHES]

LLMs keep saying wrong suggestions using any config tag containing "version" or whatever, even with fine tuned and detailed prompts.

I have read the whole Renovate config page without finding my answer... Maybe I missed something. Thanks in advance.


Solution

  • If my pipeline calls my-task@1, I don't want a PR that sets [email protected], I want to keep this notation my-task@2.

    As per your requirement, you want only major version to update.

    You can try to use matchUpdateTypes to match only major version, and add "extractVersion": "^(?<version>\\d+)" in renovate.json for the trick.

    {
      "azure-pipelines": {
        "enabled": true
      },
      "packageRules": [
        {
          "matchDatasources": ["azure-pipelines-tasks"],
          "extractVersion": "^(?<version>\\d+)"
        },
        {
          "packageNames": ["DownloadBuildArtifacts"],
          "matchUpdateTypes": ["major"],
          "labels": ["UPDATE-MAJOR"]
        }
      ]
    }
    

    The PR created:

    enter image description here