Skip to content

ci(safe-cosmetic): HMAC-authorized, label-gated auto-merge workflow#73

Merged
frstrtr merged 2 commits into
masterfrom
ci-steward/safe-cosmetic-automerge
Jun 6, 2026
Merged

ci(safe-cosmetic): HMAC-authorized, label-gated auto-merge workflow#73
frstrtr merged 2 commits into
masterfrom
ci-steward/safe-cosmetic-automerge

Conversation

@frstrtr
Copy link
Copy Markdown
Owner

@frstrtr frstrtr commented Jun 6, 2026

Adds the operator-sanctioned SAFE-COSMETIC auto-merge workflow with a head-SHA-bound HMAC authorization gate (operator-ratified 2026-06-06).

Gate (all must hold to merge)

  1. SAFE_COSMETIC_ENABLED repo variable == true — operator kill-switch, fail-closed.
  2. PR carries the SAFE-COSMETIC label.
  3. PR base == master (STRICT).
  4. PR open, not draft.
  5. All required Linux contexts green (bare check-run names; (AsAN+UBSan) literal): Linux x86_64, Linux x86_64 (AsAN+UBSan), plus ltc/doge/dash/btc smoke (Linux x86_64).
  6. Valid integrator HMAC authorization bound to the current head SHA.

HMAC authorization

The integrator posts a comment of the exact shape:

SAFE-COSMETIC-AUTH: <hmac> head=<head-sha>

where <hmac> = HMAC-SHA256(INTEGRATOR_LABEL_KEY, "<repo>:<pr>:<head-sha>") lowercase hex. The workflow recomputes the expected value over the PRs current head and merges only on an exact full-line match. A new push changes the head SHA and silently invalidates any prior signature — authorizations cannot be replayed across PRs or SHAs. The key lives only as the INTEGRATOR_LABEL_KEY Actions secret and is never emitted.

Enforced only once a PR is otherwise green; on a green PR lacking valid authorization the gate fails closed (strips the label, posts a refusal, fails the job).

Merge remains operator push-approval gated.

frstrtr added 2 commits June 6, 2026 19:35
Operator-sanctioned exception (2026-06-06) to per-push approval for
comment/whitespace/doc-only PRs. Merges a PR labeled SAFE-COSMETIC into
master once all six required Linux contexts pass: Linux x86_64, Linux
x86_64 (AsAN+UBSan), and the ltc/doge/dash/btc coin smokes.

Gate matches BARE check-run names (the REST API form), not the CI / ...
UI form, verified against live PR #68 check data. Guarded by a fail-closed
SAFE_COSMETIC_ENABLED repo-variable kill-switch, label presence, base==master,
and non-draft/open state.
Require a valid integrator HMAC authorization comment, bound to the PR head
SHA, before the SAFE-COSMETIC auto-merge fires. The gate recomputes
HMAC-SHA256(INTEGRATOR_LABEL_KEY, "<repo>:<pr>:<head-sha>") and merges only
when a comment of the exact shape

  SAFE-COSMETIC-AUTH: <hmac> head=<head-sha>

matches the current head. A new push changes the head SHA and silently
invalidates any prior signature, so authorizations cannot be replayed across
PRs or SHAs. Enforced only once a PR is otherwise green; on a green PR lacking
valid authorization the gate fails closed: strips the label, posts a refusal,
and fails the job. SAFE_COSMETIC_ENABLED kill-switch retained as an AND gate;
bare check-run names and the (AsAN+UBSan) literal unchanged.
@frstrtr frstrtr merged commit f62f550 into master Jun 6, 2026
14 checks passed
@frstrtr frstrtr deleted the ci-steward/safe-cosmetic-automerge branch June 6, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant