Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,19 @@ jobs:
env:
CONTAINER_ENGINE: docker
BUILD_IMAGE_SPEC: localhost:5000/kroxy-jekyll:latest

# Currently the image shas are not available when we create the release, they need to be manually
# updated in the release PR before merge.
- name: Require release manifests to contain non-placeholder container image SHAs
run: |
PLACEHOLDER="REPLACE_WITH_SHA_AFTER_IMAGE_RELEASE"
# || true prevents the script failing when 0 matches are found

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the || true part commented out code?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it's a comment on why we've got to include an || true, so that githubs set -e doesn't fail the script fast.

matching_files=$(grep -r -l "${PLACEHOLDER}" _data/release/ || true)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess for should add -F, because you've not said that PLACEHOLDER is intended to be a regex.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some how I didn't connect it up with the following line. I would write this as

# The `|| true` below prevents the script failing when 0 matches are found

But I don't think it's worth a PR to change it.

if [[ -n "${matching_files}" ]]; then
echo "Error: ${PLACEHOLDER} found in release manifests:" >&2
echo "${matching_files}" >&2
echo "Please replace the placeholders in these files with the released image SHAs" >&2
exit 1
else
echo "Success: Release manifests contain no image SHA placeholders"
fi