@@ -3,8 +3,6 @@ package main
33import (
44 "context"
55 "fmt"
6- "github.com/ravilushqa/gpt-pullrequest-updater/description"
7- oAIClient "github.com/ravilushqa/gpt-pullrequest-updater/openai"
86 "github.com/ravilushqa/gpt-pullrequest-updater/shortcut"
97 "os"
108 "os/signal"
@@ -13,8 +11,10 @@ import (
1311 "github.com/google/go-github/v51/github"
1412 "github.com/jessevdk/go-flags"
1513
14+ "github.com/ravilushqa/gpt-pullrequest-updater/description"
1615 ghClient "github.com/ravilushqa/gpt-pullrequest-updater/github"
1716 "github.com/ravilushqa/gpt-pullrequest-updater/jira"
17+ oAIClient "github.com/ravilushqa/gpt-pullrequest-updater/openai"
1818)
1919
2020var opts struct {
@@ -26,7 +26,7 @@ var opts struct {
2626 OpenAIModel string `long:"openai-model" env:"OPENAI_MODEL" description:"OpenAI model" default:"gpt-3.5-turbo"`
2727 Test bool `long:"test" env:"TEST" description:"Test mode"`
2828 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/"`
3030}
3131
3232func main () {
@@ -74,8 +74,8 @@ func run(ctx context.Context) error {
7474 }
7575 }
7676
77- if opts .ShortcutBaseUrl != "" {
78- shortcutContent := buildShortcutContent (opts .ShortcutBaseUrl , pr )
77+ if opts .ShortcutBaseURL != "" {
78+ shortcutContent := buildShortcutContent (opts .ShortcutBaseURL , pr )
7979 if shortcutContent != "" {
8080 completion = fmt .Sprintf ("%s\n \n %s" , shortcutContent , completion )
8181 }
@@ -95,20 +95,20 @@ func run(ctx context.Context) error {
9595 return nil
9696}
9797
98- func buildShortcutContent (shortcutBaseUrl string , pr * github.PullRequest ) string {
98+ func buildShortcutContent (shortcutBaseURL string , pr * github.PullRequest ) string {
9999 fmt .Println ("Adding Shortcut ticket" )
100100
101- id , err := shortcut .ExtractShortcutStoryId (* pr .Title )
101+ id , err := shortcut .ExtractShortcutStoryID (* pr .Title )
102102
103103 if err != nil {
104104 // Extracting from the branch name
105- id , err = shortcut .ExtractShortcutStoryId (* pr .Head .Ref )
105+ id , err = shortcut .ExtractShortcutStoryID (* pr .Head .Ref )
106106 }
107107
108108 if err != nil {
109109 fmt .Printf ("There is no Shortcut story ID: %v \n " , err )
110110 return ""
111111 }
112112
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 ))
114114}
0 commit comments