From b10afd5ee1fb41ff513d24c51229a195cd58ab85 Mon Sep 17 00:00:00 2001 From: Karel Van Hecke <25814162+karelvanhecke@users.noreply.github.com> Date: Thu, 7 Nov 2024 22:31:34 +0100 Subject: [PATCH] ci: renovate workflow and config update (#24) --- .github/renovate.json | 29 +++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 20 ++++++++++++++++++++ .github/workflows/renovate.yaml | 4 ++-- renovate.json | 9 --------- 4 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 .github/renovate.json delete mode 100644 renovate.json diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..cab37fd --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:best-practices"], + "repositories": ["karelvanhecke/libvirt-operator"], + "requireConfig": "ignored", + "onboarding": false, + "platformCommit": "enabled", + "postUpdateOptions": [ + "gomodTidy" + ], + "customManagers":[ + { + "customType": "regex", + "fileMatch": "^\\.github/workflows/(?:ci|renovate)\\.yaml$", + "depNameTemplate": "ghcr.io/renovatebot/renovate", + "datasourceTemplate": "docker", + "matchStrings": [ + "(?:renovate|RENOVATE)[_-](?:version|VERSION): (?[0-9.]+)(?@sha256:[a-f0-9]+)?" + ] + } + ], + "packageRules": [ + { + "matchDepNames": "ghcr.io/renovatebot/renovate", + "matchUpdateTypes": ["minor","patch"], + "automerge": true + } + ] +} \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 122ce0b..5aa9918 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,6 +12,7 @@ jobs: outputs: go: ${{ steps.changes.outputs.go }} manifests: ${{ steps.changes.outputs.manifests }} + renovate: ${{ steps.changes.outputs.renovate }} steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -27,6 +28,8 @@ jobs: - '**/*.go' manifests: - 'install/base/**/*.yaml' + renovate: + - .github/renovate.json golangci-lint: name: golangci-lint @@ -110,3 +113,20 @@ jobs: - name: Deploy to kind cluster run: make deploy-to-kind-cluster + + renovate-validate: + name: Validate Renovate config + runs-on: ubuntu-latest + needs: changes + if: needs.changes.outputs.renovate == 'true' + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Validate config + env: + RENOVATE_VERSION: 39.7.3 + run: > + docker run --rm -v ./.github/renovate.json:/renovate.json + --entrypoint renovate-config-validator + ghcr.io/renovatebot/renovate:${RENOVATE_VERSION} /renovate.json diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index d19439b..55f0bf5 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -23,6 +23,6 @@ jobs: - name: Run Renovate uses: renovatebot/github-action@28bcd5c4900a4353b5c9af9e1bd61dd6377f0f0d # v40.3.5 with: + configurationFile: .github/renovate.json + renovate-version: 39.7.3 token: '${{ steps.app-token.outputs.token }}' - env: - RENOVATE_REPOSITORIES: ${{ github.repository }} diff --git a/renovate.json b/renovate.json deleted file mode 100644 index e0034c7..0000000 --- a/renovate.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": [ - "config:best-practices" - ], - "platformCommit": "enabled", - "postUpdateOptions": [ - "gomodTidy" - ] -}