Skip to content

Commit eb0423d

Browse files
committed
Fail PR build if any image SHA placeholders are found
The intent is to prevent documentation PRs from merging until we manually update the PR with the SHAs. Signed-off-by: Robert Young <[email protected]>
1 parent 521afed commit eb0423d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/pr-build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,19 @@ jobs:
3838
env:
3939
CONTAINER_ENGINE: docker
4040
BUILD_IMAGE_SPEC: localhost:5000/kroxy-jekyll:latest
41+
42+
# Currently the image shas are not available when we create the release, they need to be manually
43+
# updated in the release PR before merge.
44+
- name: Require release manifests to contain non-placeholder container image SHAs
45+
run: |
46+
PLACEHOLDER="REPLACE_WITH_SHA_AFTER_IMAGE_RELEASE"
47+
# || true prevents the script failing when 0 matches are found
48+
matching_files=$(grep -r -l "${PLACEHOLDER}" _data/release/ || true)
49+
if [[ -n "${matching_files}" ]]; then
50+
echo "Error: ${PLACEHOLDER} found in release manifests:" >&2
51+
echo "${matching_files}" >&2
52+
echo "Please replace the placeholders in these files with the released image SHAs" >&2
53+
exit 1
54+
else
55+
echo "Success: Release manifests contain no image SHA placeholders"
56+
fi

0 commit comments

Comments
 (0)