Post

Replace the Cordium Exact-Main Guard With a Reviewed-Any-Prose Publication Check

Replace the Cordium Exact-Main Guard With a Reviewed-Any-Prose Publication Check

This push changes the Cordium runner publication workflow so it no longer requires a dispatch on the exact current main. Instead it verifies that the dispatch commit is still an ancestor of main and that all inputs outside Markdown documentation still match. The change lets a prose-only merge land while a publication dispatch from reviewed main is still allowed to run.

Shift the Cordium publication guard to ancestry and tree comparison

I removed the inline workflow check that compared the dispatch SHA to the current main and replaced it with a new script scripts/ci/cordium-publication-source.sh. The script verifies the GitHub Actions context, checks that the checked-out HEAD matches the dispatch SHA, and then fetches main to compare the full tree except Markdown documentation. If the dispatch commit is an ancestor of the current main and all non-Markdown inputs still match, the publication proceeds with tags and provenance pointing at the original dispatch commit. This is a guard change, not a runtime test; the patch does not run the workflow.

Extend the test suite for the new guard

The test suite gained a new test case class CordiumPublicationSource that sets up a temporary git repository and exercises the ancestor and tree comparison logic. I also added a negative test that verifies the workflow rejects a dispatch when the workflow reference is wrong, and adjusted the transport mocks to include the new script. The tests are written and merged; they do not show runtime results from the homelab pipeline.

Allow publication from reviewed main with prose-only merges

The old check required the dispatch SHA to equal the current main, which blocked publication after a Markdown-only merge. The new guard accepts any dispatch commit that is still an ancestor of main and has matching non-Markdown inputs. A platform team operating a similar GitOps repository can adopt this pattern: publish from a reviewed commit rather than the exact tip, while still preventing publication when build, workflow, or signing inputs have drifted. The next check is to run the updated harbor-publish-test.py in the homelab CI and confirm the new script passes both positive and negative cases.

This post is licensed under CC BY 4.0 by the author.