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

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

sources:
  opensuse-bci-go-release:
    name: "Retrieve OpenSUSE BCI Go version"
    kind: dockerimage
    spec:
      image: "registry.opensuse.org/opensuse/bci/golang"
      versionfilter:
        kind: "semver"

conditions:
  opensuse-bci-go-version:
    name: "Check OpenSUSE BCI Go version in image-scanning"
    kind: "file"
    scmid: "image-scanning"
    disablesourceinput: true
    spec:
      files:
        - ".github/workflows/vex-cve.yml"
        - ".github/workflows/vex-hub-reports.yml"
        - ".github/workflows/vex-scan.yml"
      matchpattern: 'container: registry.opensuse.org/opensuse/bci/golang:.*'

targets:
  opensuse-bci-go-version:
    name: "Bump OpenSUSE BCI Go version in image-scanning"
    kind: "file"
    scmid: "image-scanning"
    disablesourceinput: true
    spec:
      files:
        - ".github/workflows/vex-cve.yml"
        - ".github/workflows/vex-hub-reports.yml"
        - ".github/workflows/vex-scan.yml"
      matchpattern: 'container: registry.opensuse.org/opensuse/bci/golang:.*'
      replacepattern: 'container: registry.opensuse.org/opensuse/bci/golang:{{ source `opensuse-bci-go-release` }}'

