---
name: "Bump SUSE BCI Go 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 Go version"

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

sources:
  suse-bci-go-release:
    name: "Retrieve SUSE BCI Go version"
    kind: dockerimage
    spec:
      image: "registry.suse.com/bci/golang"
      versionfilter:
        kind: "semver"

conditions:
  suse-bci-go-version:
    name: "Check SUSE BCI Go version in image-scanning"
    kind: "file"
    scmid: "image-scanning"
    disablesourceinput: true
    spec:
      files:
        - ".github/workflows/scan.yml"
      matchpattern: 'container: registry.suse.com/bci/golang:.*'

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

