()
| 61 | } |
| 62 | |
| 63 | func githubCmd() *cobra.Command { |
| 64 | cmd := &cobra.Command{ |
| 65 | Use: "github", |
| 66 | Short: "Link GitHub pull requests to Pad items", |
| 67 | Aliases: []string{"gh"}, |
| 68 | RunE: unknownSubcommandRun, |
| 69 | Long: `Link GitHub pull requests to Pad items and view their status. |
| 70 | |
| 71 | Requires the GitHub CLI (gh) to be installed: https://cli.github.com/`, |
| 72 | Example: ` pad github link TASK-5 # Link current branch's PR to TASK-5 |
| 73 | pad github link # Auto-detect item ref from branch name |
| 74 | pad github status # Show PR status for all linked items |
| 75 | pad github status TASK-5 # Show PR status for a specific item |
| 76 | pad github unlink TASK-5 # Remove PR link from an item`, |
| 77 | } |
| 78 | |
| 79 | cmd.AddCommand( |
| 80 | githubLinkCmd(), |
| 81 | githubStatusCmd(), |
| 82 | githubUnlinkCmd(), |
| 83 | ) |
| 84 | |
| 85 | return cmd |
| 86 | } |
| 87 | |
| 88 | // getCurrentBranch returns the current git branch name. |
| 89 | func getCurrentBranch() (string, error) { |
no test coverage detected