ci(gitea): warn before the Gitea release key stops verifying releases
Build / build (pull_request) Successful in 15s
Gitea release key / check (pull_request) Successful in 9s
Lint / lint (pull_request) Successful in 51s
Molecule / molecule (pull_request) Canceled after 36s

The gitea role accepts a release only when it carries a valid signature by
gitea_gpg_key_id or one of its subkeys, so an expired, revoked or replaced
Gitea release key makes every install and update fail closed, without
warning, on the day it happens.

scripts/check_gitea_release_key.py reads the pins from the role defaults,
fetches the release key into a throwaway keyring and only the .asc of the
pinned release (never the binary), and fails when the primary key or a
signing subkey expires within 60 days, is revoked or expired, or when a
signature in the .asc is not by a valid signing key of the pinned key. Its
docstring says what to do on a failure.

The Gitea release key workflow runs it weekly, by hand, and on pull requests
that change the role defaults or the check, so a gitea_version bump is
checked against the new release's signature. It runs in the ci image at the
pin of lint.yml; that image has gpgv but not gpg, so the job installs gpg and
gpg-agent from the Ubuntu archive per run instead of making the check an
image input. The tests that make keys skip without gpg, so the Lint job's
unittest run (no gpg) still covers the parsing and rendering tests.

The workflow pins the ci image, so it joins the pin consumers of
check_image_versions.py and check_bot_pr_diff.py: Renovate's pin follow-up
edits every workflow, and the bot-diff gate would otherwise refuse that pull
request. The new workflow and script are on the molecule selector's IGNORED
list, since no scenario reads them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-11-22 07:29:31 +00:00
1 parent aefbc24e88
commit 0837cc387f
14 files changed
+868 -9

No files matched your search

+10
View File
@@ -141,6 +141,11 @@ class RuleTest(unittest.TestCase):
f" git.rkdr.net/mortis/mol:0.1.0@{D1}",
f" git.rkdr.net/mortis/mol:0.1.1@{D2}",
),
(
".gitea/workflows/gitea-release-key.yml",
f" image: git.rkdr.net/mortis/ci:0.2.0@{D1}",
f" image: git.rkdr.net/mortis/ci:0.2.1@{D2}",
),
]
for path, old, new in cases:
self.assertIsNone(self.problem(path, old, new), (path, old, new))
@@ -208,6 +213,11 @@ class RuleTest(unittest.TestCase):
f" job_image: evil:1@{D1}",
),
(".gitea/workflows/lint.yml", "run: echo a", "run: echo b"),
(
".gitea/workflows/gitea-release-key.yml",
"run: echo a",
"run: echo b",
),
(
".gitea/workflows/lint.yml",
f" image: git.rkdr.net/mortis/ci:0.2.0@{D1}",