1+ /*
2+ Copyright 2022 Guilhem Lettron (guilhem@barpilot.io).
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+ */
16+
117package main
218
319import (
420 "bytes"
521 "context"
622 "fmt"
723 "os"
24+ "regexp"
825 "strconv"
926 "strings"
1027 "text/template"
1128 "time"
12- "regexp"
1329
1430 "github.com/google/go-github/v33/github"
1531 "golang.org/x/oauth2"
@@ -24,15 +40,15 @@ import (
2440)
2541
2642const (
27- lastTimeInput = "lastTime"
28- labelsInput = "labels"
29- repoTokenInput = "repo-token"
30- feedInput = "feed"
31- prefixInput = "prefix"
32- aggregateInput = "aggragate"
33- dryRunInput = "dry-run"
34- titleFilterInput = "titleFilter"
35- contentFilterInput = "contentFilter"
43+ lastTimeInput = "lastTime"
44+ labelsInput = "labels"
45+ repoTokenInput = "repo-token"
46+ feedInput = "feed"
47+ prefixInput = "prefix"
48+ aggregateInput = "aggragate"
49+ dryRunInput = "dry-run"
50+ titleFilterInput = "titleFilter"
51+ contentFilterInput = "contentFilter"
3652)
3753
3854func main () {
@@ -118,17 +134,16 @@ func main() {
118134 content = item .Description
119135 }
120136
121-
122137 filter := a .GetInput (titleFilterInput )
123- if filter != "" {
138+ if filter != "" {
124139 matched , _ := regexp .MatchString (filter , item .Title )
125140 if matched {
126141 a .Debugf ("No issue created due to title filter" )
127142 continue
128143 }
129144 }
130145 filter = a .GetInput (contentFilterInput )
131- if filter != "" {
146+ if filter != "" {
132147 matched , _ := regexp .MatchString (filter , content )
133148 if matched {
134149 a .Debugf ("No issue created due to content filter" )
0 commit comments