Skip to content

Feature Request: Support matchpattern in the file kind with some dynamism #9008

@v1v

Description

@v1v

Is your feature request related to a problem?

I want do update all the given files that contain a match and avoid failing if no match

Solution you'd like

targets:
  update-files:
    name: "Update files (GCP/AWS)"
    sourceid: latestVersion
    scmid: githubConfig
    kind: file
    spec:
      searchpattern: "*.yaml"
      ifmatch: "true"
      matchpattern: '(IMAGE_.+): "platform-(.+)-([0-9]+)"'
      replacepattern: '$1: "platform-$2-{{ source "latestVersion" }}"'

Alternatives you've considered

Use the explicit list of files:

spec:
  files:
    - file_1.yaml
    - file_2.yaml

However, it requires to keep the list of files, while searchpattern could help with finding files that follow a pattern to run the replace if a match.

However, searchpattern might match files that don't have the matchpattern therefore the target step failed.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions