Skip to content

fix: PR 일괄 승인·병합 요청에서 repo_owner를 필수로 처리 - #71

Merged
parkhojeong merged 2 commits into
DaleStudy:mainfrom
parkhojeong:fix/require-pr-action-owner
Nov 27, 2026
Merged

parkhojeong merged 2 commits into
DaleStudy:mainfrom
parkhojeong:fix/require-pr-action-owner

Conversation

@parkhojeong

@parkhojeong parkhojeong commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

문제

Worker가 repo_owner가 빠진 일괄 승인·병합 요청도 DaleStudy 저장소에 대한 요청으로 처리합니다. 발생 경위

원인

/approve-prs와 /merge-prs의 공통 요청 파서가 조직을 검사하기 전에 누락된 소유자를 DaleStudy로 채웁니다. 이 때문에 소유자를 생략한 요청도 조직 검사를 통과합니다.

해결

repo_owner의 기본값을 제거합니다. 소유자가 누락되면 400을 반환하고, DaleStudy 이외의 값은 기존 조직 검사에서 403으로 거절합니다.

소유자 누락, 포크 소유자, DaleStudy 세 경우를 검증했고 전체 테스트 166개가 통과했습니다. 원본 워크플로가 repo_owner를 보내도록 변경한 뒤 이 Worker를 배포합니다. 먼저 반영할 워크플로 PR

@parkhojeong
parkhojeong marked this pull request as ready for review November 22, 2026 02:29
@parkhojeong
parkhojeong requested a review from a team as a code owner November 22, 2026 02:29

@DaleSeo DaleSeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

호정님, 포크 실행 로그까지 따라가서 원인을 깔끔하게 정리해 주셔서 감사해요. 작은 제안 드렸습니다.

Comment thread utils/prActions.js
try {
const data = await request.json();
const repoOwner = data.repo_owner || "DaleStudy";
const repoOwner = data.repo_owner;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

요청 본문을 신뢰하는 대신 GitHub Actions OIDC 토큰을 검증하고, 토큰의 repository_owner 클레임으로 소유자를 확인하는 건 어떨까요?

Suggested change
const repoOwner = data.repo_owner;
const repoOwner = claims.repository_owner;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

좋은 제안 감사합니다!
다만 포크 Wrapup이 일요일 오전 10시(KST)에 repo_owner 없이 실행될 수 있어서, 이 PR을 먼저 반영하고 OIDC는 후속 PR로 작업하겠습니다.

@parkhojeong
parkhojeong requested a review from DaleSeo November 27, 2026 14:58
@parkhojeong
parkhojeong merged commit 5b6a285 into DaleStudy:main Nov 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants