()
| 32 | } |
| 33 | |
| 34 | func githubCmd() *cobra.Command { |
| 35 | cmd := &cobra.Command{ |
| 36 | Use: "github", |
| 37 | Short: "Link GitHub pull requests to Pad items", |
| 38 | Aliases: []string{"gh"}, |
| 39 | RunE: unknownSubcommandRun, |
| 40 | Long: `Link GitHub pull requests to Pad items and view their status. |
| 41 | |
| 42 | Requires the GitHub CLI (gh) to be installed: https://cli.github.com/ |
| 43 | |
| 44 | Examples: |
| 45 | pad github link TASK-5 # Link current branch's PR to TASK-5 |
| 46 | pad github link # Auto-detect item ref from branch name |
| 47 | pad github status # Show PR status for all linked items |
| 48 | pad github status TASK-5 # Show PR status for a specific item |
| 49 | pad github unlink TASK-5 # Remove PR link from an item`, |
| 50 | } |
| 51 | |
| 52 | cmd.AddCommand( |
| 53 | githubLinkCmd(), |
| 54 | githubStatusCmd(), |
| 55 | githubUnlinkCmd(), |
| 56 | ) |
| 57 | |
| 58 | return cmd |
| 59 | } |
| 60 | |
| 61 | // getCurrentBranch returns the current git branch name. |
| 62 | func getCurrentBranch() (string, error) { |
no test coverage detected