Skip to content

Commit

Permalink
ci(.github/workflows/docs.yml): update to correctly replace docs sect…
Browse files Browse the repository at this point in the history
…ion of readme
  • Loading branch information
benjivesterby committed Mar 27, 2023
1 parent 2994c1c commit e453216
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 728 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:
go install github.com/robertkrimen/godocdown/godocdown@latest
TEMPFILE=$(mktemp)
godocdown . > $TEMPFILE
if ! grep -q '<!-- GODOC_START -->' README.md; then
echo "Error: <!-- GODOC_START --> marker not found in README.md"
exit 1
fi
awk -v file="$TEMPFILE" \
'/<!-- GODOC_START -->/ {print; while (getline < file) print; next} 1' \
'/<!-- GODOC_START -->/, /<!-- GODOC_END -->/ { if ($0 ~ /<!-- GODOC_END -->/) { while (getline < file) print } else { next } } 1' \
README.md > README.md.new
mv README.md.new README.md

- name: Create or update pull request
Expand Down
Loading

0 comments on commit e453216

Please sign in to comment.