Skip to content

Commit

Permalink
chore: Add apache2 license header
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhem committed Mar 18, 2022
1 parent 88779be commit 3abb886
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
/*
Copyright 2022 Guilhem Lettron (guilhem@barpilot.io).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
"bytes"
"context"
"fmt"
"os"
"regexp"
"strconv"
"strings"
"text/template"
"time"
"regexp"

"github.com/google/go-github/v33/github"
"golang.org/x/oauth2"
Expand All @@ -24,15 +40,15 @@ import (
)

const (
lastTimeInput = "lastTime"
labelsInput = "labels"
repoTokenInput = "repo-token"
feedInput = "feed"
prefixInput = "prefix"
aggregateInput = "aggragate"
dryRunInput = "dry-run"
titleFilterInput = "titleFilter"
contentFilterInput = "contentFilter"
lastTimeInput = "lastTime"
labelsInput = "labels"
repoTokenInput = "repo-token"
feedInput = "feed"
prefixInput = "prefix"
aggregateInput = "aggragate"
dryRunInput = "dry-run"
titleFilterInput = "titleFilter"
contentFilterInput = "contentFilter"
)

func main() {
Expand Down Expand Up @@ -118,17 +134,16 @@ func main() {
content = item.Description
}


filter := a.GetInput(titleFilterInput)
if filter !="" {
if filter != "" {
matched, _ := regexp.MatchString(filter, item.Title)
if matched {
a.Debugf("No issue created due to title filter")
continue
}
}
filter = a.GetInput(contentFilterInput)
if filter !="" {
if filter != "" {
matched, _ := regexp.MatchString(filter, content)
if matched {
a.Debugf("No issue created due to content filter")
Expand Down

0 comments on commit 3abb886

Please sign in to comment.