mirror of
https://github.com/docker/docs.git
synced 2026-11-04 10:01:00 +00:00
hack/moby-sync-release: Avoid SIGPIPE during note extraction
The second grep exits after finding the next release heading, which can close the pipe while the first grep is still writing. With pipefail, that SIGPIPE is reported as if the requested release notes were missing. Read the release file directly with awk and stop at the next level-two heading so early termination cannot fail an upstream process. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
1 file changed
+6
-3
@@ -18,9 +18,12 @@ docs_notes=$(mktemp -t new)
|
||||
github_notes=$(mktemp -t old)
|
||||
|
||||
# Get the release notes from the docs.
|
||||
grep -A 10000 "## ${version}" "content/manuals/engine/release-notes/${major_version}.md" | \
|
||||
grep -m 2 -A 0 -B 10000 '^## ' | \
|
||||
sed '$d' | \
|
||||
awk -v heading="## ${version}" '
|
||||
$0 == heading { found = 1; print; next }
|
||||
found && /^## / { exit }
|
||||
found { print }
|
||||
END { if (!found) exit 1 }
|
||||
' "content/manuals/engine/release-notes/${major_version}.md" | \
|
||||
sed '/{{< release-date /{N;d;}' \
|
||||
> "$docs_notes" || { echo "Release notes for ${version} not found" && exit 1; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user