Skip to content

Commit 5f7be8f

Browse files
committed
work on filepath matching
Signed-off-by: Jeffrey Sica <[email protected]>
1 parent dafe7da commit 5f7be8f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

utilities/labeler/main.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,19 @@ func githubClient() (*github.Client, error) {
9191
return github.NewClient(oauth2.NewClient(context.Background(), ts)), nil
9292
}
9393

94-
var (
95-
changedFiles = flag.String("changed-files", "", "Comma-separated list of changed files")
96-
)
97-
9894
func main() {
9995
flag.Parse()
10096

10197
if len(flag.Args()) < 5 {
102-
fmt.Println("Usage: labeler [flags] <labels_url> <owner> <repo> <issue_number> <comment_body>")
98+
fmt.Println("Usage: labeler [flags] <labels_url> <owner> <repo> <issue_number> <comment_body> <changed_files>")
10399
os.Exit(1)
104100
}
105101
labelsURL := flag.Arg(0)
106102
owner := flag.Arg(1)
107103
repo := flag.Arg(2)
108104
issueNum := flag.Arg(3)
109105
commentBody := flag.Arg(4)
106+
changedFiles := flag.Arg(5)
110107

111108
if labelsURL == "" {
112109
log.Fatal("labels URL not set")
@@ -138,10 +135,12 @@ func main() {
138135
}
139136

140137
// Parse changed files if provided
138+
log.Printf("Changed files: %s", changedFiles)
141139
var files []string
142-
if *changedFiles != "" {
143-
files = strings.Split(*changedFiles, ",")
140+
if changedFiles != "" {
141+
files = strings.Split(changedFiles, ",")
144142
}
143+
log.Printf("Parsed changed files: %v", files)
145144

146145
issue, _, err := client.Issues.Get(ctx, owner, repo, toInt(issueNum))
147146
if err != nil {

0 commit comments

Comments
 (0)