Skip to content

Commit 8608653

Browse files
committed
interval
1 parent f058d4d commit 8608653

File tree

6 files changed

+45
-61
lines changed

6 files changed

+45
-61
lines changed

.github/dependabot.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ updates:
33
- package-ecosystem: github-actions
44
directory: /.github/workflows
55
schedule:
6-
interval: daily
6+
interval: weekly
7+
day: tuesday
8+
time: "12:00"
9+
timezone: America/New_York
710
- package-ecosystem: gomod
811
directory: /
912
schedule:
10-
interval: daily
13+
interval: weekly
14+
day: tuesday
15+
time: "12:00"
16+
timezone: America/New_York

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
release_name: Release ${{ github.ref }}
2727
body: |
2828
This release has the following changes:
29-
- Truncate updates if greater than 200.
29+
- Interval Options.
3030
draft: false
3131
prerelease: false
3232

README.md

+11-54
Original file line numberDiff line numberDiff line change
@@ -25,51 +25,12 @@ sudo chmod +x hinge-1.0.0-linux-amd64
2525
sudo mv hinge-1.0.0-linux-amd64 /usr/local/bin/hinge
2626
```
2727

28-
## How To Hinge :dancer:
28+
## Usage
2929

30-
### hinge
31-
32-
Running `hinge` with no arguments will produce the following output.
33-
34-
```bash
35-
$ hinge
36-
Hinge
37-
https://github.com/devops-kung-fu/hinge
38-
Version: 1.0.0
39-
40-
Please provide the path to the repository.
41-
42-
Usage:
43-
hinge [flags] path/to/repo
44-
45-
Examples:
46-
hinge path/to/repo
47-
48-
Flags:
49-
-h, --help help for hinge
50-
-v, --version version for hinge
51-
```
52-
53-
### hinge /path/to/repository
54-
55-
Running `hinge` with the path to the root of the repository will write the configuration to `.github/dependabot.yml`.
56-
57-
```bash
58-
$ hinge .
59-
Hinge
60-
https://github.com/devops-kung-fu/hinge
61-
Version: 1.0.0
6230
```
63-
64-
In the above example we are at the root of the repository.
65-
66-
### hinge -h|--help
67-
68-
```bash
69-
$ hinge -h
7031
Hinge
7132
https://github.com/devops-kung-fu/hinge
72-
Version: 1.0.0
33+
Version: 0.0.9
7334
7435
Creates and updates your Dependabot config.
7536
@@ -80,17 +41,13 @@ Examples:
8041
hinge path/to/repo
8142
8243
Flags:
83-
-h, --help help for hinge
84-
-v, --version version for hinge
85-
```
86-
87-
### hinge -v|--version
88-
89-
```bash
90-
$ hinge -v
91-
Hinge
92-
https://github.com/devops-kung-fu/hinge
93-
Version: 1.0.0
94-
95-
hinge version 1.0.0
44+
-d, --day string Specify a day to check for updates. (default "daily")
45+
--debug Displays debug level log messages.
46+
-h, --help help for hinge
47+
-i, --interval string How often to check for new versions. (default "daily")
48+
-t, --time string Specify a time of day to check for updates (format: hh:mm). (default "05:00")
49+
-z, --timezone string Specify a time zone. The time zone identifier must be from the Time Zone database maintained by IANA. (default "UTC")
50+
--trace Displays trace level log messages.
51+
-v, --verbose Displays dependabot.yml configuration in stardard output.
52+
--version version for hinge
9653
```

cmd/root.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
var (
14-
version = "0.0.9"
14+
version = "0.0.11"
1515
verbose bool
1616
trace bool
1717
debug bool
@@ -32,7 +32,7 @@ var (
3232
case debug:
3333
heyBo.ChangeGlobalLevel(heybo.TRACE)
3434
}
35-
heyBo.ChangeTagText(heybo.INFO, "pass")
35+
heyBo.ChangeTagText(heybo.INFO, "PASS")
3636
if len(args) == 0 {
3737
color.Style{color.FgRed, color.OpBold}.Println("Please provide the path to the repository.")
3838
fmt.Println()

lib/generate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func directoryParser(fs afero.Fs, regex string, repoPath string) []string {
7474
cleanFile := strings.Replace(file, repoPath, "", 1)
7575
cleanDiscovery = append(cleanDiscovery, cleanFile)
7676
} else if strings.HasPrefix(file, ".github") {
77-
cleanDiscovery = append(cleanDiscovery, "/"+file)
77+
cleanDiscovery = append(cleanDiscovery, "/" + file)
7878
} else {
7979
cleanDiscovery = append(cleanDiscovery, file)
8080
}

lib/generate_test.go

+22-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,31 @@ package lib
22

33
import (
44
"reflect"
5-
65
"testing"
6+
7+
"github.com/spf13/afero"
78
)
89

10+
func TestDirectoryParserGitHub(t *testing.T) {
11+
fs := afero.NewMemMapFs()
12+
_ = fs.Mkdir(".github", 0755)
13+
_ = fs.Mkdir(".github/workflows", 0755)
14+
_, _ = fs.Create(".github/workflows/ci.yml")
15+
results := directoryParser(fs, `(.*)\.yml`, ".")
16+
if results[0] != "/.github/workflows" {
17+
t.Error()
18+
}
19+
}
20+
21+
func TestDirectoryParserGoMod(t *testing.T) {
22+
fs := afero.NewMemMapFs()
23+
_, _ = fs.Create("go.mod")
24+
results := directoryParser(fs, `go\.mod`, ".")
25+
if results[0] != "/" {
26+
t.Error()
27+
}
28+
}
29+
930
func TestRemoveDuplicates(t *testing.T) {
1031
sliceWithDupes := []string{"1", "1", "2", "2", "3", "3"}
1132
correctSlice := []string{"1", "2", "3"}

0 commit comments

Comments
 (0)