Skip to content

Commit 7bef4a7

Browse files
committed
close #71 404 when listing issues
1 parent 706f883 commit 7bef4a7

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

ci/notes/CHANGELOG.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ Last release brought some unexpected problems with our authentication og permiss
22
We have made a fix for theses problems, so just go ahead and get the update and these problems should be a part of the past.
33
To re-authenticate you need to delete the old 'git phlow' token on github.com and delete your phlow settings in your global .gitconfig file.
44

5-
6-
#### Features
7-
- web command #63 (Browser can be started from phlow) @groenborg
8-
- list issues #69 (Lists opens issues in the terminal) @groenborg
9-
- List issues only assigned to you
10-
- improved user experience #67 (certain commands can be run outside a repo) @groenborg
11-
125
#### Bug fixes
13-
- workon should fetch issues #68 (github issues should work) @groenborg
6+
- phlow can be authenticated on multiple machines #72 @groenborg
7+
- list issues should now work on private repositories #71 @groenborg

main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package main
22

3-
import "github.com/praqma/git-phlow/cmd"
3+
import (
4+
"github.com/praqma/git-phlow/cmd"
5+
)
46

57
func main() {
68
cmd.Execute()
7-
89
}

plugins/github.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,21 @@ func (i *IssueRequest) Get() ([]Issues, error) {
100100
var body []byte
101101

102102
i.URL = fmt.Sprintf(i.URL, i.org, i.repo)
103+
104+
token := githandler.ConfigGet("token", "phlow")
105+
request, err := http.NewRequest("GET", i.URL, nil)
106+
if err != nil {
107+
return nil, err
108+
}
109+
q := request.URL.Query()
110+
q.Add("access_token", token)
111+
request.URL.RawQuery = q.Encode()
112+
103113
if options.GlobalFlagVerbose {
104-
fmt.Println("github uri: " + i.URL)
114+
fmt.Println("github uri: " + request.URL.String())
105115
}
106116

107-
if resp, err = i.client.Get(i.URL); err != nil {
117+
if resp, err = i.client.Do(request); err != nil {
108118
return nil, err
109119
}
110120
if err = requestStatus(resp); err != nil {
@@ -143,7 +153,7 @@ func createPermissions() (string, error) {
143153
}
144154

145155
perm := Permissions{
146-
Scopes: []string{"public_repo", "repo", "repo_deployment"},
156+
Scopes: []string{"public_repo", "repo", "repo_deployment", "repo:status"},
147157
Note: note,
148158
}
149159
b2b, err := json.Marshal(&perm)

0 commit comments

Comments
 (0)