Skip to content

Commit 6209566

Browse files
authored
Bug fix GitHub repo scaffolding owner case sensitive (#232)
* bug: fix repo owner lower/upper case issue for repo scaffolding for github golang * chore: add more debug log * bug: github repo scaffolding repo owner should be case sensitive * doc: add clearer instructions in the plugin documentation * doc: add clearer instructions in the plugin documentation
1 parent fc34ff0 commit 6209566

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

docs/plugins/github-repo-scaffolding-golang_plugin.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This plugin installs github-repo-scaffolding-golang.
1010

1111
## 2 Usage:
1212

13+
**Please note that the `owner` parameter is case-sensitive.**
14+
1315
```yaml
1416
tools:
1517
# name of the instance with github-repo-scaffolding-golang
@@ -21,7 +23,7 @@ tools:
2123
version: 0.0.1
2224
# options for the plugin
2325
options:
24-
# the repo's owner. please use lowercase
26+
# the repo's owner. It should be case-sensitive here; strictly use your GitHub user name.
2527
owner: daniel-hutao
2628
# the repo which you'd like to create
2729
repo: golang-demo

internal/pkg/plugin/reposcaffolding/github/golang/golang.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func replaceAppNameInPathStr(filePath, appName string) (string, error) {
182182

183183
func buildState(param *Param) map[string]interface{} {
184184
res := make(map[string]interface{})
185-
res["owner"] = strings.ToLower(param.Owner)
185+
res["owner"] = param.Owner
186186
res["repoName"] = param.Repo
187187
return res
188188
}

internal/pkg/plugin/reposcaffolding/github/golang/read.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package golang
22

33
import (
44
"fmt"
5-
"strings"
65

76
"github.com/mitchellh/mapstructure"
87

@@ -45,7 +44,7 @@ func buildReadState(param *Param) (map[string]interface{}, error) {
4544
}
4645

4746
res := make(map[string]interface{})
48-
res["owner"] = strings.ToLower(*repo.Owner.Login)
47+
res["owner"] = *repo.Owner.Login
4948
res["repoName"] = *repo.Name
5049

5150
return res, nil

0 commit comments

Comments
 (0)