AGT(Automatic GitHub Tool)λ GitHub Issueλ₯Ό κΈ°λ°μΌλ‘ λΈλμΉ κ΄λ¦¬μ ν 리νμ€νΈ(PR) μμ±μ μλννμ¬ κ°λ°μμ μμ°μ±μ ν₯μμν€κ³ , λΈλμΉ κ΄λ¦¬μ μΌκ΄μ±μ μ μ§νλ λꡬμ λλ€.
μ΄ λꡬλ₯Ό μ¬μ©νλ©΄ λ€μκ³Ό κ°μ μμ μ λΉ λ₯΄κ² μνν μ μμ΅λλ€:
- μ΄μ λͺ©λ‘ μ‘°ν
- μ μ΄μ μμ± (μ λͺ© μ λ ₯ κ°λ₯)
- μ΄μ κΈ°λ° λΈλμΉ μμ±
- PR μμ±
- Node.js 14 μ΄μ
- GitHub CLI (gh) μ€μΉ νμ
- GitHub κ³μ μ΄ νμν©λλ€.
node -v # λ²μ νμΈ
gh --version # μ€μΉ νμΈ
-
GitHub CLI μ€μΉ
# Homebrewλ₯Ό ν΅ν μ€μΉ brew install gh
-
GitHub κ³μ μ°λ
gh auth login
- ν둬ννΈμ λ°λΌ μ§ν:
? What account do you want to log into?
βGitHub.com
μ ν? What is your preferred protocol for Git operations?
βHTTPS
μ ν? Authenticate Git with your GitHub credentials?
βYes
μ ν? How would you like to authenticate GitHub CLI?
βLogin with a web browser
μ ν- νμλ one-time codeλ₯Ό 볡μ¬
- μλμΌλ‘ μ΄λ¦¬λ λΈλΌμ°μ μμ GitHub λ‘κ·ΈμΈ
- 볡μ¬ν μ½λ μ λ ₯νμ¬ μΈμ¦ μλ£
- ν둬ννΈμ λ°λΌ μ§ν:
-
AGT μ€νμμ€ μ€μΉ
npm install -g auth-github-tool
μ€μΉ ν agt λͺ λ Ήμ΄λ₯Ό μ¬μ©νμ¬ μ€νν μ μμ΅λλ€.
agt --help # μ¬μ© κ°λ₯ν λͺ
λ Ήμ΄ λͺ©λ‘ μΆλ ₯
agt list # μ€νλ μ΄μ λͺ©λ‘ μ‘°ν
agt issue # μ μ΄μ μμ± (μ λͺ© μ
λ ₯ μ§μ)
agt branch # μ νν μ΄μ κΈ°λ° λΈλμΉ μμ±
agt pr # νμ¬ λΈλμΉμμ PR μμ±
$ agt --help
Usage: agt <command> [options]
Commands:
list Show open issues
issue Create a new issue
branch Create a branch from an issue
pr Create a pull request
--help Show this help message
Examples:
agt list
agt issue
agt branch
agt pr
νμ¬ μ μ₯μμ λͺ¨λ μ΄μλ₯Ό λ²νΈ μμΌλ‘ μ λ ¬νμ¬ λ³΄μ¬μ€λλ€.
$ agt list
=== π Open Issues ===
...
μ΄μ μμ±
$ agt issue
> π Enter issue title: {issue-title}
π Available Issue Templates:
1. bug_report.md
2. feature_request.md
3. question.md
> Select a template number or press Enter to skip: {issue-number}
> π· Enter labels (comma-separated, or press Enter to skip): {issue-labels}
> π₯ Enter assignees (comma-separated, or press Enter to skip): {issue-assignees}
> π
Enter milestone (or press Enter to skip): {issue-milestone}
μ΄μ λ²νΈλ₯Ό μ λ ₯λ°μ ν΄λΉ μ΄μμ μ λͺ©μ κΈ°λ°μΌλ‘ μλ‘μ΄ λΈλμΉλ₯Ό μμ±ν©λλ€.
- λΈλμΉ λͺ
λͺ
κ·μΉ:
{issue-label(feature/bug)}/{issue-number}-{issue-title}
$ agt branch
=== π Open Issues ===
...
π’ Enter issue number to create branch: {issue-number}
β
Branch '{issue-label}/{issue-number}-{issue-title}' created.
νμ¬ λΈλμΉμμ PRμ μλμΌλ‘ μμ±ν©λλ€.
$ agt pr
π Enter PR title: {pr-title}
π Enter PR description: {pr-description}
π₯ Enter reviewers (comma-separated, or press Enter to skip): {pr-reviewers}
π Pushing branch '{issue-label}/{issue-number}-{pr-title}' to remote repository...
π Creating a new pull request...
-
Git μ μ₯μκ° μλ κ²½μ°
Error: Not a git repository. Please run 'git init' first.
β‘οΈ ν΄κ²°:
git init
λͺ λ Ήμ΄λ‘ Git μ μ₯μ μ΄κΈ°ν -
GitHub CLI μΈμ¦ μ€λ₯
Error: Please run 'gh auth login' to authenticate with GitHub.
β‘οΈ ν΄κ²°:
gh auth login
μ€ννμ¬ μ¬μΈμ¦ -
μμ€ λΈλμΉκ° μλ κ²½μ°
Error: Source branch '{branch-name}' does not exist
β‘οΈ ν΄κ²°: ν΄λΉνλ λΈλμΉκ° μ‘΄μ¬νλμ§ νμΈ
μ΄ νλ‘μ νΈλ MIT λΌμ΄μ μ€λ₯Ό λ°λ¦ λλ€.