@@ -3,8 +3,6 @@ package main
3
3
import (
4
4
"context"
5
5
"fmt"
6
- "github.com/ravilushqa/gpt-pullrequest-updater/description"
7
- oAIClient "github.com/ravilushqa/gpt-pullrequest-updater/openai"
8
6
"github.com/ravilushqa/gpt-pullrequest-updater/shortcut"
9
7
"os"
10
8
"os/signal"
@@ -13,8 +11,10 @@ import (
13
11
"github.com/google/go-github/v51/github"
14
12
"github.com/jessevdk/go-flags"
15
13
14
+ "github.com/ravilushqa/gpt-pullrequest-updater/description"
16
15
ghClient "github.com/ravilushqa/gpt-pullrequest-updater/github"
17
16
"github.com/ravilushqa/gpt-pullrequest-updater/jira"
17
+ oAIClient "github.com/ravilushqa/gpt-pullrequest-updater/openai"
18
18
)
19
19
20
20
var opts struct {
@@ -26,7 +26,7 @@ var opts struct {
26
26
OpenAIModel string `long:"openai-model" env:"OPENAI_MODEL" description:"OpenAI model" default:"gpt-3.5-turbo"`
27
27
Test bool `long:"test" env:"TEST" description:"Test mode"`
28
28
JiraURL string `long:"jira-url" env:"JIRA_URL" description:"Jira URL. Example: https://jira.atlassian.com"`
29
- ShortcutBaseUrl string `long:"shortcut-url" env:"SHORTCUT_URL" description:"Shortcut URL. Example: https://app.shortcut.com/foo/"`
29
+ ShortcutBaseURL string `long:"shortcut-url" env:"SHORTCUT_URL" description:"Shortcut URL. Example: https://app.shortcut.com/foo/"`
30
30
}
31
31
32
32
func main () {
@@ -74,8 +74,8 @@ func run(ctx context.Context) error {
74
74
}
75
75
}
76
76
77
- if opts .ShortcutBaseUrl != "" {
78
- shortcutContent := buildShortcutContent (opts .ShortcutBaseUrl , pr )
77
+ if opts .ShortcutBaseURL != "" {
78
+ shortcutContent := buildShortcutContent (opts .ShortcutBaseURL , pr )
79
79
if shortcutContent != "" {
80
80
completion = fmt .Sprintf ("%s\n \n %s" , shortcutContent , completion )
81
81
}
@@ -95,20 +95,20 @@ func run(ctx context.Context) error {
95
95
return nil
96
96
}
97
97
98
- func buildShortcutContent (shortcutBaseUrl string , pr * github.PullRequest ) string {
98
+ func buildShortcutContent (shortcutBaseURL string , pr * github.PullRequest ) string {
99
99
fmt .Println ("Adding Shortcut ticket" )
100
100
101
- id , err := shortcut .ExtractShortcutStoryId (* pr .Title )
101
+ id , err := shortcut .ExtractShortcutStoryID (* pr .Title )
102
102
103
103
if err != nil {
104
104
// Extracting from the branch name
105
- id , err = shortcut .ExtractShortcutStoryId (* pr .Head .Ref )
105
+ id , err = shortcut .ExtractShortcutStoryID (* pr .Head .Ref )
106
106
}
107
107
108
108
if err != nil {
109
109
fmt .Printf ("There is no Shortcut story ID: %v \n " , err )
110
110
return ""
111
111
}
112
112
113
- return fmt .Sprintf ("### Shortcut story: [%s](%s)" , id , shortcut .GenerateShortcutStoryUrl (shortcutBaseUrl , id ))
113
+ return fmt .Sprintf ("### Shortcut story: [%s](%s)" , id , shortcut .GenerateShortcutStoryUrl (shortcutBaseURL , id ))
114
114
}
0 commit comments