-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: add line ending check workflow for current pr #336
Conversation
저도 그 부분이 약간 걸렸었는데, 제거해주시니 좋네요! |
이 job은 추가 persmission 설정 필요없나요? 혹시 워크플로우를 합치는 과정에서 빼먹으셨을까봐 여쭤봅니다. |
아네 개인 레포에서 했을 때 없어도 되었는데요~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
피드백 적극적으로 반영해주셔서 너무 감사합니다! 덕분에 앞으로 우리 저장소에서 🚫 표시 볼 일을 없겠네요. 🥰
.github/workflows/integration.yaml
Outdated
|
||
label-lang: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
|
||
permissions: | ||
contents: write | ||
contents: read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
.github/workflows/integration.yaml
Outdated
done < <(echo '${{ steps.changed-files.outputs.files }}' | jq -r '.[]') | ||
|
||
if [ ${#files_without_newline[@]} -gt 0 ]; then | ||
json_files=$(printf '%s\n' "${files_without_newline[@]}" | jq -R -s -c 'split("\n")[:-1]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 거 생각보다 복잡하네요. 예전 방식이 더 간단해서 좋은 것 같기도 하고 ㅎㅎ
예전 방식으로 돌려 달라고 말씀드리면 화나실려나요? 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아뇨 괜찮습니다 ㅋㅋㅋ 그런데 예전 방식이 이거 말씀하시는 걸까요?
for file in "${changed_files[@]}"; do
if [ -f "$file" ] && [ "$(tail -c 1 "$file" | wc -l)" -eq 0 ]; then
files_without_newline+="- ${file}\n"
fi
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaleSeo 달레님, 요거 답변 주실 수 있으실까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
한 줄의 JSON으로 변환하지 않고 여러 줄의 문자열을 그대로 환경 변수에 설정하는 방식이요! (참고: #336 (comment))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }}) | ||
success=true | ||
for file in $files; do | ||
if [ "$(tail -c 1 $file | wc -l)" -eq 0 ]; then | ||
echo "- $file" >> $GITHUB_STEP_SUMMARY | ||
success=false | ||
fi | ||
done | ||
|
||
if [ "$success" = false ]; then | ||
echo -e "\n:warning: 위 파일들의 끝에 누락된 줄 바꿈을 추가해 주세요." >> $GITHUB_STEP_SUMMARY | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와, 맨 처음 스크립트에 비해서 진짜 간단해졌네요 ㅎㅎ 🕺
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네네 다행히 간단히 줄일 수 있었습니다! 요거는 전에 승인 주셨으니 병합 진행할게요!
작업 내용
모든 파일이 올바르게 개행 처리되어 있습니다.
라는 메시지를 출력합니다.Job Summary
에 출력합니다.테스트
모두 개행 처리된 경우 Job Summary-> 불필요하다고 판단하여 제거