From c2e09e05e2aaae7a7c34c362c6b6b8cda1c56a0b Mon Sep 17 00:00:00 2001 From: Jamie Tanna Date: Fri, 7 Nov 2025 09:31:54 +0000 Subject: [PATCH] ci: ensure `example/` passes `renovate-config-validator` As noted in #910, we have invalid configuration shared as an example, which isn't ideal. We should validate any JSON and `config.js` files in the example directory. This is a separate check to allow us to run it only for changes to the examples, or the Workflow definition. --- .github/workflows/config-validator.yml | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/config-validator.yml diff --git a/.github/workflows/config-validator.yml b/.github/workflows/config-validator.yml new file mode 100644 index 00000000..8608797c --- /dev/null +++ b/.github/workflows/config-validator.yml @@ -0,0 +1,42 @@ +name: Validate example configuration + +on: + push: + paths: + - example/* + - .github/workflows/config-validator.yml + pull_request: + paths: + - example/* + - .github/workflows/config-validator.yml + workflow_dispatch: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +env: + RENOVATE_VERSION: 41.173.1 # renovate: datasource=docker depName=renovate packageName=ghcr.io/renovatebot/renovate + +jobs: + renovate-config-validator: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + with: + show-progress: false + + # When running the config validator in this repo, with the `package.json`, we receive error: + # + # module is not defined in ES module scope + # + # So we need to delete the `package.json` to allow us to validate the `config.js` + - name: Remove `package.json` + run: rm package.json + + - name: Validate Renovate configuration + run: | + cd example + env LOG_LEVEL=debug npx --yes --package renovate@${{ env.RENOVATE_VERSION }} -- renovate-config-validator *.json *.js