File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/tmp
22week13 /.DS_Store
3+ . /env
4+ ** .env **
Original file line number Diff line number Diff line change 11alias create=./scripts/create.sh
22alias assign=./scripts/assign.sh
3+ alias merge=./scripts/auto_merge.sh
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ export $( grep -v ' ^#' .env | xargs)
4+
5+ # GitHub 사용자 이름
6+ USERNAME=" $1 "
7+
8+ # GitHub Personal Access Token (PAT)
9+ PAT=" $GITHUB_TOKEN "
10+
11+ # 대상 저장소
12+ REPO=" Stendhalsynd/baekjoon-algorithm-study"
13+
14+ # main 브랜치 이름
15+ MAIN_BRANCH=" main"
16+
17+ # PR 상태 필터 (예: open, closed, all)
18+ PR_STATE=" open"
19+
20+ # PAT 설정
21+ echo " $PAT " | gh auth login --with-token
22+
23+ # 현재 브랜치 확인
24+ CURRENT_BRANCH=$( git branch --show-current)
25+
26+ # main 브랜치로 이동
27+ git checkout " $MAIN_BRANCH "
28+
29+ # 모든 PR 목록 가져오기
30+ PRs=$( gh pr list --repo " $REPO " --state " $PR_STATE " --author " $USERNAME " --json url)
31+
32+ gh pr checkout 303
33+
34+ # git checkout 303
35+
36+ # # PR 루프
37+ # for PR_URL in $PRs; do
38+ # # PR 번호 추출
39+ # PR_NUMBER=$(echo "$PR_URL" | sed -n 's/.*\/pull\/\([0-9]*\).*/\1/p')
40+
41+ # # PR 정보 출력
42+ # echo "## PR #$PR_NUMBER"
43+
44+ # # PR 체크아웃
45+ # git checkout "$PR_NUMBER"
46+
47+ # # PR 변경 사항 저장
48+ # git add -A
49+
50+ # # PR rebase
51+ # git rebase "$MAIN_BRANCH"
52+
53+ # # PR merge
54+ # git merge --squash "$MAIN_BRANCH"
55+
56+ # # PR 삭제
57+ # gh pr close "$PR_NUMBER"
58+
59+ # # main 브랜치로 이동
60+ # git checkout "$MAIN_BRANCH"
61+ # done
62+
63+ # # 변경 사항 푸시
64+ # git push
65+
66+ # # 현재 브랜치로 돌아가기
67+ # git checkout "$CURRENT_BRANCH"
68+
69+ # echo "## 완료"
You can’t perform that action at this time.
0 commit comments