Skip to content

CICD-100 · Keep the same digest through promotion ​

Encyclopedia · Artifact handoffs · All snippets

Previous · CICD-099 · Next · CICD-101

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites actions runner, trusted producers and files actually generated by tests.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters CANDIDATE_DIGEST, TESTED_DIGEST.

2. Copy the snippet ​

bash
test "${CANDIDATE_DIGEST:?}" = "${TESTED_DIGEST:?}"

3. How it works ​

A digest comparison ensures that the artifact tested and the artifact selected for promotion are the same. The sources of both values must be trusted and bound to the release.

Matching a candidate to the tested digest is a release gate.

flowchart TD
  N1["Tested digest"]
  N2{"Same digest"}
  N1 --> N2
  N3["Candidate digest"]
  N3 --> N2
  N4["Approve promotion step"]
  N2 -->|Yes| N4
  N5["Fail gate"]
  N2 -->|No| N5

4. Verify the result ​

Use signed or trusted build provenance to set these values.

Validation syntax-validated (Bash parse). Status definitions.