---
name: "Bump SUSE BCI Node version"
scms:
  image-scanning:
    kind: "github"
    spec:
      user: "{{ .github.user }}"
      email: "{{ .github.email }}"
      username: "{{ .github.username }}"
      token: "{{ requiredEnv .github.token }}"
      owner: "rancher"
      repository: "image-scanning"
      branch: "main"
      commitmessage:
        title: "Bump SUSE BCI Node version"

actions:
  github:
    title: "Bump SUSE BCI Node version"
    kind: "github/pullrequest"
    scmid: "image-scanning"
    spec:
      automerge: false
      mergemethod: "squash"
      usetitleforautomerge: true

sources:
  suse-bci-node-release:
    name: "Retrieve SUSE BCI Node version"
    kind: dockerimage
    spec:
      image: "registry.suse.com/bci/nodejs"
      versionfilter:
        kind: "semver"

conditions:
  suse-bci-node-version:
    name: "Check SUSE BCI Node version in image-scanning"
    kind: "file"
    scmid: "image-scanning"
    disablesourceinput: true
    spec:
      files:
        - ".github/workflows/renovate.yml"
        - ".github/workflows/updatecli.yml"
      matchpattern: 'container: registry.suse.com/bci/nodejs:.*'

targets:
  suse-bci-node-version:
    name: "Bump SUSE BCI Node version in image-scanning"
    kind: "file"
    scmid: "image-scanning"
    disablesourceinput: true
    spec:
      files:
        - ".github/workflows/renovate.yml"
        - ".github/workflows/updatecli.yml"
      matchpattern: 'container: registry.suse.com/bci/nodejs:.*'
      replacepattern: 'container: registry.suse.com/bci/nodejs:{{ source `suse-bci-node-release` }}'

