Skip to content

Commit

Permalink
Allow BaseRefName in template
Browse files Browse the repository at this point in the history
  • Loading branch information
faustind authored and dlvhdr committed Mar 8, 2024
1 parent ab52fdf commit 4dc6aae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,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

0 comments on commit 4dc6aae

Please sign in to comment.