ci(lint): validate renovate.json in the pinned Renovate image
Add a renovate-config job to Lint that runs renovate-config-validator --strict --no-global in a copy of renovate.yml's Renovate image, so the config is checked by the Renovate that runs it and the check can be required. The ci image stays without Node. check_bot_pr_diff.py now lets a bot pull request move the tag and digest of the renovate/renovate image line in renovate.yml and lint.yml, in place, keeping the name and the -full flavour. A test holds the two pins equal. Refs: #188 Assisted-by: Claude Code
This commit is contained in:
1 parent
d1db4fb0db
commit
763ec5dfd3
4 files changed
+145
-11
No files matched your search
@@ -3,7 +3,7 @@ name: Lint
|
||||
# Runs only on the Collection's own runner (label kamino-docker, scoped to the mortis org).
|
||||
# No org secret is used: the only credential is the
|
||||
# job token (secrets.GITHUB_TOKEN), which is read-only for a fork pull request. No pull_request_target.
|
||||
# The tools come from the ci image (images/ci, built by image.yml): the pinned Python
|
||||
# The lint job's tools come from the ci image (images/ci, built by image.yml): the pinned Python
|
||||
# tools of requirements-dev.txt, the collections of requirements.yml and the hook
|
||||
# environments of .pre-commit-config.yaml are baked in. When a PR changes one of those
|
||||
# files the checksum check below fails and the job installs the pinned tools and
|
||||
@@ -148,3 +148,29 @@ jobs:
|
||||
echo "Checking $sha"
|
||||
pre-commit run --hook-stage commit-msg --commit-msg-filename "$MSG_FILE"
|
||||
done
|
||||
|
||||
# renovate.json checked by the validator of the Renovate that runs it. The image is a copy of
|
||||
# renovate.yml's pin (test_the_renovate_image_pins_are_the_same); the ci image has no Node.
|
||||
renovate-config:
|
||||
runs-on: kamino-docker
|
||||
timeout-minutes: 5
|
||||
container:
|
||||
image: renovate/renovate:44.161.0-full@sha256:ddbf02e44b542343c9df696b88fd953f04cc3ee5f771221805ff8efb26595416
|
||||
steps:
|
||||
# The image runs as a non-root user, so the clone goes to a directory it owns.
|
||||
- name: Validate renovate.json
|
||||
env:
|
||||
GIT_CONFIG_COUNT: "1"
|
||||
GIT_CONFIG_KEY_0: http.extraheader
|
||||
GIT_CONFIG_VALUE_0: "AUTHORIZATION: bearer ${{ secrets.GITHUB_TOKEN }}"
|
||||
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
REF: ${{ github.ref }}
|
||||
REPO_URL: ${{ github.server_url }}/${{ github.repository }}
|
||||
run: |
|
||||
src="$(mktemp -d)"
|
||||
git clone "$REPO_URL" "$src"
|
||||
cd "$src"
|
||||
git checkout "$SHA" || { git fetch origin "$REF" && git checkout "$SHA"; }
|
||||
echo "Checked out $(git rev-parse HEAD)"
|
||||
# --no-global: renovate.json is a repository config, not the bot's global one.
|
||||
renovate-config-validator --strict --no-global renovate.json
|
||||
Reference in new issue
Block a user