diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c53e3c95ae..65408e22fc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -426,6 +426,7 @@ jobs: done annotations=( + --annotation "index:org.opencontainers.image.source=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" --annotation "index:org.opencontainers.image.revision=${SOURCE_SHA}" --annotation "index:xyz.block.buzz.build.id=github-actions:${GITHUB_RUN_ID}:${GITHUB_RUN_ATTEMPT}" --annotation "index:xyz.block.buzz.qualification.ci-run-id=${CI_RUN_ID}" diff --git a/scripts/test-relay-image-eligibility-workflow.sh b/scripts/test-relay-image-eligibility-workflow.sh index 6a2f22e898..e4457162c2 100755 --- a/scripts/test-relay-image-eligibility-workflow.sh +++ b/scripts/test-relay-image-eligibility-workflow.sh @@ -70,6 +70,15 @@ grep -Fq "actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10" <<<"$merge_ exit 1 } +for annotation in \ + 'index:org.opencontainers.image.source=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}' \ + 'index:org.opencontainers.image.revision=${SOURCE_SHA}'; do + grep -Fxq " --annotation \"$annotation\"" <<<"$merge_job" || { + echo "relay image index is missing its source annotation: $annotation" >&2 + exit 1 + } +done + # Staging auto-promotes the newest main--<7> gateway image, so the gateway # must publish that tag and only from a source the relay CI qualified. Match # whole lines (-x) so a commented-out or otherwise inactive copy cannot satisfy