Skip to content

feat(renovate): Add support for `renovate:ignore` in `.tool-versions`.

What

feat(renovate): Add support for renovate:ignore in .tool-versions.

Why

The .tool-versions file is governed by two managers: regex and asdf.

So far, adding a datasource/depName comment enables the regex manager with a custom regular expression. However, it does not disable the asdf manager. That means that the asdf manager may still upgrade a tool, even when the (more explicitly configured) regex manager would not.

For example, gitlab-com/gl-infra/platform/runway/provisioner!663 tried to upgrade tflint due to a GitHub release, despite the explicitly provided datasource not having the new version yet.

With this change the following syntax will do what we need:

tflint 0.55.1 # renovate:ignore # datasource=docker depName=registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks-images/tflint
  • The regex manager will continue to parse this line as it has before – the renovate:ignore has no meaning for it.
  • The asdf manager will honor the renovate:ignore marker and ignore the dependency.

Minor unrelated fix: the regular expression previously anchored on a trailing newline \n. This is problematic when the file does not have a newline at the end-of-file, which is a common behavior of code editors, unfortunately. This enables multi-line mode ((?m)), so $ also matches at the end-of-line, and uses $ instead of \n for the end-of-line match.

Edited by Florian Forster

Merge request reports

Loading