Skip to content

Replacement with ^ and $ multiline does not work properly #180

@miniscruff

Description

@miniscruff

Discussed in #179

Originally posted by sdurrheimer November 9, 2021
Hi @miniscruff,

I'm trying the replacements feature to change the version within my Helm Chart.yaml file.

The file presents itself as the following:

version: 0.1.0

dependencies:
  - name: mysql
    repository: https://charts.bitnami.com/bitnami
    tags:
      - bitnami-mysql
    version: ~8.8.8
    condition: mysql.enabled

If I use the following configuration, the main version and dependency version are changed:

replacements:
- path: Chart.yaml
  find: 'version: .*'
  replace: 'version: {{.VersionNoPrefix}}'

But If I do the following to make sure the line strictly start with the version string without spaces in front of it, the replacement doesn't happen at all:

replacements:
- path: Chart.yaml
  find: '^version: .*'
  replace: 'version: {{.VersionNoPrefix}}'

How can I make this work properly?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions