Skip to content

Commit f9aadd3

Browse files
committed
fix: handle inaccessible PR head repository gracefully
1 parent 9f07672 commit f9aadd3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,15 @@ async function run() {
415415

416416
ref = pr.head.ref;
417417
sha = pr.head.sha;
418-
commitOrg = pr.head.repo.owner.login;
419-
commitRepo = pr.head.repo.name;
418+
if (pr.head.repo) {
419+
commitOrg = pr.head.repo.owner.login;
420+
commitRepo = pr.head.repo.name;
421+
} else {
422+
// 포크가 삭제된 경우 기본값 사용
423+
core.warning('PR head repository not accessible, using base repository info');
424+
commitOrg = context.repo.owner;
425+
commitRepo = context.repo.repo;
426+
}
420427
core.debug(`The head ref is: ${pr.head.ref}`);
421428
core.debug(`The head sha is: ${pr.head.sha}`);
422429
core.debug(`The commit org is: ${commitOrg}`);

0 commit comments

Comments
 (0)