@@ -33,10 +33,10 @@ type DataContainer struct {
3333// metrics returns the metrics map
3434func (d * DataContainer ) metrics (com * CommitStats , lang * LanguageStats ) map [string ]string {
3535 return map [string ]string {
36- "LANGUAGE_PER_REPO" : writer .MakeLanguagePerRepoList (d .Data .Repositories ),
37- "LANGUAGES_BASED_ON_REPO " : writer .MakeLanguageUsedList (lang .Languages , lang .TotalSize ),
38- "COMMIT_DAYS_OF_WEEK" : writer .MakeCommitDaysOfWeekList (com .DailyCommits , com .TotalCommits ),
39- "COMMIT_TIME_OF_DAY" : writer .MakeCommitTimeOfDayList (d .Data .Commits ),
36+ "LANGUAGE_PER_REPO" : writer .MakeLanguagePerRepoList (d .Data .Repositories ),
37+ "LANGUAGES_AND_TOOLS " : writer .MakeLanguageAndToolList (lang .Languages , lang .TotalSize ),
38+ "COMMIT_DAYS_OF_WEEK" : writer .MakeCommitDaysOfWeekList (com .DailyCommits , com .TotalCommits ),
39+ "COMMIT_TIME_OF_DAY" : writer .MakeCommitTimeOfDayList (d .Data .Commits ),
4040 "WAKATIME_SPENT_TIME" : writer .MakeWakaActivityList (
4141 d .Data .WakaTime ,
4242 strings .Split (os .Getenv ("WAKATIME_DATA" ), "," ),
@@ -100,6 +100,7 @@ func (d *DataContainer) InitRepositories(ctx context.Context) error {
100100 seenRepos := make (map [string ]bool )
101101 errChan := make (chan error , 2 )
102102 repoChan := make (chan []github.Repository , 2 )
103+ isExcludeForks := os .Getenv ("EXCLUDE_FORK_REPOS" ) == "true"
103104
104105 go func () {
105106 r , err := d .ClientManager .GetOwnedRepositories (ctx , d .Data .Viewer .Login , repoPerQuery )
@@ -138,6 +139,10 @@ func (d *DataContainer) InitRepositories(ctx context.Context) error {
138139 // Deduplicate repositories
139140 for repos := range repoChan {
140141 for _ , repo := range repos {
142+ if isExcludeForks && repo .IsFork {
143+ continue
144+ }
145+
141146 if ! seenRepos [repo .Url ] {
142147 seenRepos [repo .Url ] = true
143148 d .Data .Repositories = append (d .Data .Repositories , repo )
0 commit comments