ci(renovate): run on push to main and let Renovate bump its own image

Renovate runs on every push to main, so after each merge the next bot
pull request is rebased without waiting for the daily schedule; the
renovate concurrency group still queues at most one run. The job timeout
drops from 30 to 10 minutes.

The rule that disabled updates to renovate.yml is replaced by a weekly
rule for renovate/renovate: a 3-day release age, never automerged, since
the job runs with the write-capable bot token. One pull request moves
the pin in renovate.yml and its copy in lint.yml. RENOVATE_DOCKER_MAX_PAGES
stays within Docker Hub's anonymous paging limit, so the image's release
timestamps are found and the wait applies.

Our own Docker images get an explicit zero release age. Every rule
description is cut to at most two sentences, and the top-level one now
says that an update with no release timestamp gets no wait.

Closes: #172
Closes: #188
Assisted-by: Claude Code
This commit is contained in:
Defame1297 committed 2026-12-06 17:02:10 +00:00
1 parent 763ec5dfd3
commit 936e253af0
3 files changed
+71 -38

No files matched your search

+30 -21
View File
@@ -5,18 +5,21 @@ name: Renovate
# The credential is the token of a Kamino-only bot user, held as
# the repository secret RENOVATE_BOT_TOKEN (not an org secret: only image.yml may reference those).
# The job token cannot be used: Renovate filters every pull request lookup by its own username,
# which is the virtual user gitea-actions with the job token, and Gitea answers 400 "user does not
# exist" (dry run 2445). No GitHub token exists (no RENOVATE_GITHUB_COM_TOKEN): the github-tags
# datasource then skips every pre-commit hook (skipReason github-token-required, dry run 3880), and
# unauthenticated GitHub API lookups are refused at once (403 rate limit). The hooks are looked up
# with git ls-remote instead (renovate.json, packageRule overrideDatasource git-tags), which needs
# RENOVATE_GITHUB_TOKEN_WARN=false below: the token check runs before package rules apply.
# which is the virtual user gitea-actions with the job token, and Gitea refuses that user.
# No GitHub token exists, so the pre-commit hooks are looked up with git ls-remote instead
# (renovate.json, git-tags), which needs RENOVATE_GITHUB_TOKEN_WARN=false below.
#
# Dry run: Actions > Renovate > Run workflow, dry_run=true (the default for a manual run), then
# read the debug log. The schedule runs live, and so does a successful Images run's completion, so
# the pin pull request for a new image version opens within minutes of its push. Gitea starts a
# workflow_run only for a run a person triggered, and its event carries no input or credential.
# read the debug log. Every other trigger runs live: a push to main rebases the next bot pull
# request, and an Images run's completion opens the pin pull request for a new image version.
# Gitea starts a workflow_run only for a run a person triggered, and its event carries no input
# or credential.
on: # yamllint disable-line rule:truthy
# Only one bot pull request merges per run when main must be up to date; a run after each merge
# rebases the next one.
push:
branches:
- main
# Images runs only on main (push, dispatch), and this job reads nothing from its run but the conclusion.
workflow_run: # zizmor: ignore[dangerous-triggers]
workflows: [Images]
@@ -38,7 +41,8 @@ on: # yamllint disable-line rule:truthy
permissions:
contents: read
# Never two runs at once; a running one is not cancelled (it may be mid-push).
# Never two runs at once; a running one is not cancelled (it may be mid-push), and a burst of
# pushes leaves at most one run waiting.
concurrency:
group: renovate
cancel-in-progress: false
@@ -50,15 +54,17 @@ jobs:
(github.repository == 'mortis/kamino' || github.repository == 'Mortis/Kamino') &&
(github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success')
runs-on: kamino-docker
timeout-minutes: 30
# A run takes seconds to about two minutes.
timeout-minutes: 10
# Docker Hub image, pinned by digest. The -full flavour ships python3 for the report check
# below and pip-compile for lock refreshes. Hand-bumped: renovate.json
# disables updates for this file. The image sets RENOVATE_BINARY_SOURCE=global, so pip-compile
# runs on the image's own python (3.14.8 in 44.161.0) and ignores the Python that Renovate
# reads from the lock header: that python's minor version must equal .python-version, or a lock
# refresh rewrites the header (check_image_versions.py pins then fails the pull request). When
# bumping this image, check its python first; RENOVATE_BINARY_SOURCE=install would make Renovate
# install the header's python, but it also downloads tools at run time (pip-tools included).
# below and pip-compile for lock refreshes. Renovate proposes its own bump weekly, never
# automerged (renovate.json), and moves lint.yml's copy of this pin in the same pull request.
# The image sets RENOVATE_BINARY_SOURCE=global, so pip-compile runs on the image's own python
# and ignores the Python that Renovate reads from the lock header: that python's minor version
# must equal .python-version, or a lock refresh rewrites the header (check_image_versions.py
# pins then fails the pull request). Check the image's python before merging a bump;
# RENOVATE_BINARY_SOURCE=install would make Renovate install the header's python, but it also
# downloads tools at run time (pip-tools included).
container:
image: renovate/renovate:44.161.0-full@sha256:ddbf02e44b542343c9df696b88fd953f04cc3ee5f771221805ff8efb26595416
steps:
@@ -74,14 +80,17 @@ jobs:
# No GitHub token exists, and the hooks go through git-tags (see the header). Without this
# Renovate marks every github-tags dependency as skipped before the package rule applies.
RENOVATE_GITHUB_TOKEN_WARN: "false"
# Docker Hub refuses anonymous paging past page 10; at more pages renovate/renovate gets
# no release timestamps, so its minimumReleaseAge would not apply.
RENOVATE_DOCKER_MAX_PAGES: "10"
# Renovate exits 0 when a repository run fails (e.g. the clone): with this it exits with
# an error-specific code instead (7 for an external host error such as a failed clone).
RENOVATE_EXIT_CODE_FOR_ERRORS: "true"
# The JSON report is checked after the run (see below).
RENOVATE_REPORT_TYPE: file
LOG_LEVEL: ${{ github.event_name == 'workflow_dispatch' && 'debug' || 'info' }}
# Fail safe: only the schedule and workflow_run are live. A manual dispatch is a dry run unless
# the input is exactly the string "false" (an empty input from an API or CLI dispatch stays one).
# Fail safe: a manual dispatch is a dry run unless the input is exactly the string "false"
# (an empty input from an API or CLI dispatch stays one); every other trigger is live.
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run != 'false' && 'true' || 'false' }}
run: |
if [ -z "$RENOVATE_TOKEN" ]; then
@@ -90,7 +99,7 @@ jobs:
fi
# Git over HTTPS with the bot token. Renovate's own rewrite puts the token in the URL
# (https://<token>@host/...), which git drops when the server redirects, and Gitea
# redirected the clone (dry run 2439). The header is sent on every request to the host,
# redirects the clone. The header is sent on every request to the host,
# as lint.yml does with its token. Renovate does not pass GIT_CONFIG_* from its environment to git
# (only an allowlist, util/exec/env.js), but it does pass HOME, so a global git config
# is the path that reaches its git children. The token is read from the environment.