Skip to content

06-doohyunmoon PR request #68

06-doohyunmoon PR request

06-doohyunmoon PR request #68

Workflow file for this run

name: Count Lines of md
on: [pull_request]
jobs:
count-lines:
runs-on: ubuntu-latest
steps:
- name: Checkout ๐Ÿ›Ž๏ธ
uses: actions/checkout@v3
- name: Count Lines of md ๐Ÿ“Š
run: |
# ํƒ์ƒ‰ํ•  ๋””๋ ‰ํ„ฐ๋ฆฌ ์„ค์ •, ๊ธฐ๋ณธ๊ฐ’์€ ํ˜„์žฌ ๋””๋ ‰ํ„ฐ๋ฆฌ
DIRECTORY=${1:-.}
# .md ํŒŒ์ผ ์ฐพ๊ธฐ ๋ฐ ์ค„ ์ˆ˜ ๊ณ„์‚ฐ
find "$DIRECTORY" -type f -name "*.md" | while read -r file; do
line_count=$(wc -l < "$file")
if [ "$line_count" -lt 10 ]; then
echo "Error: '$file' ํŒŒ์ผ์ด 10์ค„๋ณด๋‹ค ์ ๊ฒŒ ์ž‘์„ฑ๋˜์—ˆ์–ด์š”. (ํ˜„์žฌ : $line_count ์ค„)." >&2
exit 1
fi
done
echo "๋ชจ๋“  .md ํŒŒ์ผ์ด 10์ค„์˜ ์ œํ•œ ์กฐ๊ฑด์„ ์ถฉ์กฑํ•ฉ๋‹ˆ๋‹ค."