Skip to content

Commit

Permalink
ci(.github/workflows/docs.yml): update docs action to replace inside …
Browse files Browse the repository at this point in the history
…of tags only
  • Loading branch information
benjivesterby committed Mar 27, 2023
1 parent 6583e1d commit 8b8bb06
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ jobs:
exit 1
fi

if ! grep -q '<!-- GODOC_END -->' README.md; then
echo "Error: <!-- GODOC_END --> marker not found in README.md"
exit 1
fi

awk -v file="$TEMPFILE" \
'/<!-- GODOC_START -->/, /<!-- GODOC_END -->/ { if ($0 ~ /<!-- GODOC_END -->/) { while (getline < file) print } else { next } } 1' \
'BEGIN { show = 1 } /<!-- GODOC_START -->/ { show = 0; print; while (getline < file) print } /<!-- GODOC_END -->/ { show = 1; } show' \
README.md > README.md.new

mv README.md.new README.md
Expand Down

0 comments on commit 8b8bb06

Please sign in to comment.