Files
Kamino/.gitea/workflows/renovate.yml
T
Defame1297andClaude Fable 5.2 3384ff2836
Build / build (pull_request) Successful in 17s
Lint / lint (pull_request) Successful in 1m3s
Molecule / molecule (pull_request) Successful in 15m33s
docs: remove references to anything outside this repository
This repository is public and stands alone. Comments and prose no longer
describe another repository, its documents, hosts, network or runner
sizing; each one states its own reason or is gone.

- Workflow headers keep the conclusions (disposable runner with no
  outside secret, the if: guard is not a boundary, no fork pull
  requests, the image build's memory cap) and drop the description.
- Isolation lines are worded as a property of this repository.
- The denied image namespace stays in check_image_versions.py, described
  only as a namespace this repository's CI must not use.
- CLAUDE.md and CONTRIBUTING.md gain the standing rule and the search to
  run when bringing content in from another repository.
- ci image 0.2.29 -> 0.2.30: .pre-commit-config.yaml and
  requirements-dev.txt are image inputs.

The ADR 0004 pointers, the README Roadmap, the skills-source mentions
and released changelog entries stay as they are.

Closes #108

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-20 22:57:17 +00:00

122 lines
6.6 KiB
YAML

name: Renovate
# Dependency updates for this repository (renovate.json). Runs only on the Collection's own runner
# (label kamino-docker), and no credential from anywhere else is used here.
# 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.
#
# Dry run: Actions > Renovate > Run workflow, dry_run=true (the default for a manual run), then
# read the debug log. The schedule runs live.
on: # yamllint disable-line rule:truthy
schedule:
# Daily, off the hour so it avoids typical molecule and image runs.
- cron: "17 3 * * *"
workflow_dispatch:
inputs:
dry_run:
description: "Log what Renovate would do without branches or pull requests"
type: choice
options:
- "true"
- "false"
default: "true"
# The job token is not used for Renovate (see above): read-only is enough for the job itself.
permissions:
contents: read
# Never two runs at once; a running one is not cancelled (it may be mid-push).
concurrency:
group: renovate
cancel-in-progress: false
jobs:
renovate:
# Only in this repository (a copy elsewhere has no such secret).
if: github.repository == 'mortis/kamino' || github.repository == 'Mortis/Kamino'
runs-on: kamino-docker
timeout-minutes: 30
# Docker Hub image, pinned by digest. The -full flavour ships python3 for the
# postUpgradeTasks command. 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).
container:
image: renovate/renovate:44.161.0-full@sha256:ddbf02e44b542343c9df696b88fd953f04cc3ee5f771221805ff8efb26595416
steps:
- name: Run Renovate
env:
RENOVATE_PLATFORM: gitea
RENOVATE_ENDPOINT: ${{ github.server_url }}/api/v1/
RENOVATE_REPOSITORIES: ${{ github.repository }}
RENOVATE_TOKEN: ${{ secrets.RENOVATE_BOT_TOKEN }}
# Git auth: see the run block. The host the header is scoped to.
GIT_HOST_URL: ${{ github.server_url }}/
RENOVATE_GIT_AUTHOR: "Renovate Bot <[email protected]>"
# 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"
# postUpgradeTasks may run exactly this one command (anchored, no wildcard); the JSON
# string holds a regex, hence the doubled backslash.
RENOVATE_ALLOWED_COMMANDS: '["^python3 scripts/bump_image_versions\\.py origin/main$"]'
# 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 is 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 a dry run).
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run != 'false' && 'true' || 'false' }}
run: |
if [ -z "$RENOVATE_TOKEN" ]; then
echo "::error::The repository secret RENOVATE_BOT_TOKEN is not set (token of the Kamino-only bot user)"
exit 1
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,
# 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.
git config --global "http.${GIT_HOST_URL}.extraheader" "AUTHORIZATION: bearer ${RENOVATE_TOKEN}"
report="${RUNNER_TEMP:-/tmp}/renovate-report.json"
rm -f "$report"
export RENOVATE_REPORT_PATH="$report"
if [ "$DRY_RUN" = "true" ]; then
export RENOVATE_DRY_RUN=full
fi
rc=0
renovate || rc=$?
if [ "$rc" -ne 0 ]; then
echo "::error::Renovate exited with code $rc"
exit "$rc"
fi
# Fail on a missing or unreadable report and on any ERROR (50) or FATAL (60) problem,
# global or per repository. Warnings (40) do not fail the job.
python3 -I -c '
import json, sys
try:
with open(sys.argv[1], encoding="utf-8") as handle:
report = json.load(handle)
except (OSError, ValueError) as err:
sys.exit("::error::no readable Renovate report: " + str(err))
problems = list(report.get("problems", []))
for repo in report.get("repositories", {}).values():
problems.extend(repo.get("problems", []))
bad = [p for p in problems if p.get("level", 0) >= 50]
for p in bad:
print("::error::Renovate problem: " + str(p.get("msg", "")))
sys.exit(1 if bad else 0)
' "$report"