Skip to content

Commit 2352e90

Browse files
committed
ci: replace fernandrone/linelint to custom job in integration workflow
1 parent 4cc7ab0 commit 2352e90

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

.github/workflows/integration.yaml

+39-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,45 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11-
- uses: fernandrone/[email protected]
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Get list of changed files
15+
id: changed-files
16+
run: |
17+
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | jq -R -s -c 'split("\n")[:-1]')
18+
echo "changed_files: $changed_files"
19+
echo "files=$changed_files" >> $GITHUB_OUTPUT
20+
21+
- name: Check for missing newlines
22+
id: newline-check
23+
run: |
24+
files_without_newline=()
25+
while IFS= read -r file; do
26+
if [ -f "$file" ]; then
27+
last_char=$(tail -c 1 "$file")
28+
if [ -n "$last_char" ]; then
29+
files_without_newline+=("$file")
30+
fi
31+
fi
32+
done < <(echo '${{ steps.changed-files.outputs.files }}' | jq -r '.[]')
33+
34+
if [ ${#files_without_newline[@]} -gt 0 ]; then
35+
json_files=$(printf '%s\n' "${files_without_newline[@]}" | jq -R -s -c 'split("\n")[:-1]')
36+
echo "files_without_newline: $json_files"
37+
echo "files=$json_files" >> $GITHUB_OUTPUT
38+
exit 1
39+
fi
40+
41+
- name: Set Job Summary
42+
if: failure()
43+
run: |
44+
if [ -n '${{ steps.newline-check.outputs.files }}' ]; then
45+
echo "🛠️ 아래 파일들에 공백 줄을 추가해주세요:" >> $GITHUB_STEP_SUMMARY
46+
echo '${{ steps.newline-check.outputs.files }}' |
47+
jq -r '.[]' |
48+
sed 's/^/- /' >> $GITHUB_STEP_SUMMARY
49+
fi
1250
1351
label-lang:
1452
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)