fix: remove file name checking #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Line Linting | |
on: | |
pull_request: | |
jobs: | |
linelint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# PR 라벨 확인 | |
- name: Get PR labels | |
id: pr-labels | |
run: | | |
pr_number="${{ github.event.pull_request.number }}" | |
labels_json=$(gh pr view $pr_number --json labels -q '.labels[].name') | |
if [ -n "$labels_json" ]; then | |
echo "has_maintenance=$(echo $labels_json | grep -q 'maintenance' && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT | |
else | |
echo "has_maintenance=false" >> $GITHUB_OUTPUT | |
fi | |
env: | |
GH_TOKEN: ${{ github.token }} | |
# 줄바꿈 체크 | |
- name: Check for missing end line breaks | |
run: | | |
# 따옴표를 제거하고 파일 목록 가져오기 | |
files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | tr -d '"') | |
success=true | |
echo "변경된 파일 목록:" | |
echo "$files" | |
echo "## 줄바꿈 누락 파일" >> $GITHUB_STEP_SUMMARY | |
for file in $files; do | |
if [ -s "$file" ] && [ "$(tail -c 1 $file | wc -l)" -eq 0 ]; then | |
echo "발견된 줄바꿈 누락: $file" | |
echo "- $file" >> $GITHUB_STEP_SUMMARY | |
success=false | |
fi | |
done | |
if [ "$success" = false ]; then | |
echo -e "\n:warning: 파일 끝의 누락된 줄바꿈을 추가해 주세요." >> $GITHUB_STEP_SUMMARY | |
exit 1 | |
fi |