Skip to content

Commit b69b97b

Browse files
committed
Search forked repository
like rails/web-console is forked. So we cannot get the result with a current query.
1 parent a70fdbb commit b69b97b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/github/github.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ const QUERY_SEPARATOR = " "
1717
const SEARCH_REPOS_PER_ONCE = 20
1818
const TOKEN_NAME = "GITHUB_TOKEN"
1919

20+
// To find forked repositories by search
21+
// https://docs.github.com/en/search-github/searching-on-github/searching-in-forks
22+
const FORK_QUERY = "fork:true"
23+
2024
type GitHubRepository struct {
2125
Name string
2226
Owner string
@@ -156,7 +160,7 @@ func FetchFromGitHub(params []FetchRepositoryParam) []GitHubRepository {
156160
for i, param := range params {
157161
names[i] = param.QueryWord()
158162
}
159-
q := strings.Join(names, QUERY_SEPARATOR)
163+
q := strings.Join(names, QUERY_SEPARATOR) + " " + FORK_QUERY
160164
variables := map[string]interface{}{
161165
"query": githubv4.String(q),
162166
"count": githubv4.Int(len(names)),

0 commit comments

Comments
 (0)