File tree Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Original file line number Diff line number Diff line change 11name : Integration π
22
3+ permissions :
4+ contents : write
5+ pull-requests : write
6+
37on :
48 pull_request :
59
4145 echo "νμ¬ μ»€λ°: ${{ github.sha }}"
4246
4347 files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | tr -d '"')
44- success=true
48+ target_file_list=()
4549
4650 echo "π λ³κ²½λ νμΌ λͺ©λ‘:"
4751 echo "$files"
@@ -50,17 +54,30 @@ jobs:
5054 for file in $files; do
5155 echo "κ²μ¬ μ€: $file"
5256 if [ -s "$file" ] && [ "$(tail -c 1 $file | wc -l)" -eq 0 ]; then
53- echo "β μ€λ°κΏ λλ½: $file"
57+ # κ°ν μΆκ°
58+ echo >> "$file"
59+ echo "βοΈ κ°ν μΆκ°: $file"
5460 echo "- $file" >> $GITHUB_STEP_SUMMARY
55- success=false
61+ target_file_list+=("$file")
5662 else
5763 echo "β
μ μ: $file"
5864 fi
5965 done
6066
61- if [ "$success" = false ]; then
62- echo "β οΈ μ€λ°κΏ κ²μ¬ μ€ν¨"
63- echo -e "\n:warning: νμΌ λμ λλ½λ μ€λ°κΏμ μΆκ°ν΄ μ£ΌμΈμ." >> $GITHUB_STEP_SUMMARY
67+ if [ "${#target_file_list[@]}" -gt 0 ]; then
68+ echo -e "\nμλ μμ λ νμΌ μ: ${#target_file_list[@]}" >> "$GITHUB_STEP_SUMMARY"
69+
70+ # μ μ μ€μ
71+ git config --global user.name "${GITHUB_ACTOR}"
72+ git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
73+
74+ # λ³κ²½λΆ μ»€λ° & νΈμ
75+ git checkout "${GITHUB_HEAD_REF}"
76+ git add -A
77+ git commit -m "chore(ci): add missing trailing newline to files"
78+ git push origin "HEAD:${GITHUB_HEAD_REF}"
79+
80+ echo "β
λλ½λ κ°ν μλ μΆκ° λ° μ»€λ°/νΈμ μλ£"
6481 exit 1
6582 else
6683 echo "β
λͺ¨λ νμΌμ μ€λ°κΏ μ μ"
You canβt perform that action at this time.
0 commit comments