From 06801d72ccf4f547ab07637d6071782b6e9a0d64 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Thu, 7 Nov 2024 13:41:41 +0100 Subject: [PATCH] feat: initial config --- .forgejo/workflows/build.yml | 27 +++++++++++++++++++++++++++ README.md | 7 +++++-- bin/validator.cjs | 14 ++++++++++++++ default.json | 4 ++++ renovate.json | 4 ++++ 5 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 .forgejo/workflows/build.yml create mode 100644 bin/validator.cjs create mode 100644 default.json create mode 100644 renovate.json diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..bc9ee69 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,27 @@ +name: build + +on: + push: + +jobs: + lint: + runs-on: docker + container: + image: code.forgejo.org/forgejo-contrib/renovate:38.142.7@sha256:8327ee1726142dcc504d349d84c0e7f41656867e598ea7669bb7cf23786610a2 + + strategy: + matrix: + file: + - default.json + - renovate.json + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + show-progress: false + + - run: node bin/validator.cjs ${{ matrix.file }} + env: + LOG_LEVEL: debug + RENOVATE_PLATFORM: gitea + RENOVATE_ENDPOINT: ${{ github.server_url }} diff --git a/README.md b/README.md index a4bfcc9..868d383 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ -# renovate-config +# Renovate configurations -shared organization config for renovate \ No newline at end of file +This repo contains configuration files for Renovate. + +The `default.json` will be detected as onboarding preset by Renovate when enabling it on a new repo. +The other files are shared presets and are used transitive by the `default.json`. diff --git a/bin/validator.cjs b/bin/validator.cjs new file mode 100644 index 0000000..6fe7f73 --- /dev/null +++ b/bin/validator.cjs @@ -0,0 +1,14 @@ +const { GlobalConfig } = require('/usr/local/renovate/dist/config/global'); +const { setPlatformApi } = require('/usr/local/renovate/dist/modules/platform'); + +// set required global config +GlobalConfig.set({ + platform: 'gitea', + endpoint: process.env.RENOVATE_ENDPOINT, +}); + +// set platform api +setPlatformApi('gitea'); + +// run config validator +require('/usr/local/renovate/dist/config-validator.js'); \ No newline at end of file diff --git a/default.json b/default.json new file mode 100644 index 0000000..0dcdb34 --- /dev/null +++ b/default.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["local>forgejo/renovate-config"] +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..6424e21 --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["local>forgejo/renovate-config//renovate.json"] +}