Skip to content

[CI integration] Rebase 없이 filename 체크가 성공할 수 있도록 개선 #702

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

Merged
merged 2 commits into from
Dec 15, 2024

Conversation

HC-kang
Copy link
Contributor

@HC-kang HC-kang commented Dec 14, 2024

목적

  • rebase 없이, 현재 PR과 upstream의 공통 조상을 찾아 filename을 비교토록 CI 워크플로우를 수정
  • 수정/디버깅 편의성을 위한 디버그 메시지 추가
- files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | tr -d '"')
+ # PR의 공통 조상 커밋을 찾아서 merge base로 설정
+ merge_base=$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
+ files=$(git diff --name-only $merge_base ${{ github.event.pull_request.head.sha }} | tr -d '"')

위 변경사항은 이 라인에서 확인하실 수 있습니다.

상세 내용

이전 수정에서
github.shagithub.event.pull_request.head.sha로 수정했었는데, 이 부분이 github actions 상에서는 사실상 같은 위치를 바라보게 되어있더라구요.
이로인해 주기적인 rebase를 해주지 않으면, 다른 사람들이 사전에 병합한 제출 내역이 같이 비교되는 문제가 있었습니다.

이러한 문제를 git merge-base를 통해 upstream/main과 현재 PR의 공통 조상을 확인토록 수정하여 rebase 없이도 PR 병합에 문제가 없도록 수정하였습니다

추가적으로, 좀 더 명확한 디버깅과 문제 원인파악을 위해, 디버깅 메시지를 추가하였습니다.

Copy link
Contributor

@SamTheKorean SamTheKorean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 ㅎㅎ!

@HC-kang HC-kang merged commit b82b4eb into DaleStudy:main Dec 15, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants