ci: make Knowledge release publication immutable (marqdo#10) #8

Merged
cflmy merged 2 commits from codex/issue-10-knowledge-release into master 2026-11-27 21:59:17 +08:00
2 changed files with 6 additions and 9 deletions
Showing only changes of commit ecf23d0507 - Show all commits

No files matched your search

+6 -5
View File
@@ -55,12 +55,13 @@ python3 tools/release/publish-gitea.py --prepare \
--tag "$release_tag" --pipeline "$component_pipeline" --archive "$archive"
```
The approved publisher runs the same command with `--body-file` in place of
The maintainer verifies Gitea tag protection as part of release approval. The
approved publisher runs the same command with `--body-file` in place of
`--prepare` and a `GITEA_TOKEN` from the dedicated publisher account. The tool
requires applicable branch and tag protection, resumes matching drafts, verifies
the bytes on the forge and publishes only a complete inventory. A matching
public release is idempotent. A changed asset blocks the operation and needs a
new release decision.
checks the protected default branch and exact tag, resumes matching drafts,
verifies the bytes on the forge and publishes only a complete inventory. A
matching public release is idempotent. A changed asset blocks the operation and
needs a new release decision.
## Not gated by CI (explicit non-claims)
-4
View File
@@ -4,7 +4,6 @@
from __future__ import annotations
import argparse
import fnmatch
import hashlib
import json
import os
@@ -136,9 +135,6 @@ def candidate(service, tag, pipeline, paths, *, publish):
require(actor["login"] == "marqdo-publisher" and actor.get("is_admin") is False,
"publication requires the non-admin publisher account")
require(branch_info["protected"] is True, "default branch must be protected")
rules = service.json(f"/repos/{REPO}/tag_protections")
require(any(fnmatch.fnmatchcase(tag, rule["name_pattern"]) for rule in rules),
"tag requires an applicable protection rule")
ci = ready_ci(service, head, pipeline, repository)
archive = paths[0]