diff --git a/.github/scripts/frontmatter.sh b/.github/scripts/frontmatter.sh index a591a7b6d2e..9a29d7733e0 100755 --- a/.github/scripts/frontmatter.sh +++ b/.github/scripts/frontmatter.sh @@ -22,6 +22,13 @@ is_true() { return 1 } +# if file is empty +content=$(cat "$file_path") +if [ -z "$content" ]; then + echo -e "---\n" >"$file_path" + echo -e "---\n" >>"$file_path" +fi + echo "Checking front matter" if ! grep -q "^---$" "$file_path"; then echo "Front matter (start) not found, adding it"