Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow BaseRefName in template #347

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ For PRs, the available arguments are:
| `RepoPath` | The path to the Repo, using the `config.yml` `repoPaths` key to get the mapping |
| `PrNumber` | The PR number |
| `HeadRefName` | The PR's remote branch name |
| `BaseRefName` | The PR's base branch name |

For Issues, the available arguments are:

Expand Down
2 changes: 2 additions & 0 deletions ui/modelUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type PRCommandTemplateInput struct {
RepoPath string
PrNumber int
HeadRefName string
BaseRefName string
}

func (m *Model) executeKeybinding(key string) tea.Cmd {
Expand Down Expand Up @@ -121,6 +122,7 @@ func (m *Model) runCustomPRCommand(commandTemplate string, prData *data.PullRequ
RepoPath: repoPath,
PrNumber: prData.Number,
HeadRefName: prData.HeadRefName,
BaseRefName: prData.BaseRefName,
}

cmd, err := template.New("keybinding_command").Parse(commandTemplate)
Expand Down
Loading